annotate OrthancServer/Search/LookupIdentifierQuery.h @ 1796:5e08a5fe6b27 worklists

HierarchicalMatcher - extracting tags
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Nov 2015 18:32:00 +0100
parents 9ead18ef460a
children b1291df2f780
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * In addition, as a special exception, the copyright holders of this
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * program give permission to link the code of its release with the
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * that use the same license as the "OpenSSL" library), and distribute
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * the linked executables. You must obey the GNU General Public License
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * in all respects for all of the code used other than "OpenSSL". If you
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * modify file(s) with this exception, you may extend this exception to
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * your version of the file(s), but you are not obligated to do so. If
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * you do not wish to do so, delete this exception statement from your
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * version. If you delete this exception statement from all source files
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * in the program, then also delete it here.
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 *
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * This program is distributed in the hope that it will be useful, but
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * WITHOUT ANY WARRANTY; without even the implied warranty of
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * General Public License for more details.
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 *
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * You should have received a copy of the GNU General Public License
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 **/
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #pragma once
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
1747
ca69082ab200 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
35 #include "../ServerEnumerations.h"
ca69082ab200 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
36 #include "../IDatabaseWrapper.h"
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1749
diff changeset
38 #include "SetOfResources.h"
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1749
diff changeset
39
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 #include <vector>
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 #include <boost/noncopyable.hpp>
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 namespace Orthanc
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 /**
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 * Primitive for wildcard matching, as defined in DICOM:
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 * http://dicom.nema.org/dicom/2013/output/chtml/part04/sect_C.2.html#sect_C.2.2.2.4
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 *
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 * "Any occurrence of an "*" or a "?", then "*" shall match any
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 * sequence of characters (including a zero length value) and "?"
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 * shall match any single character. This matching is case
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 * sensitive, except for Attributes with an PN Value
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 * Representation (e.g., Patient Name (0010,0010))."
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 *
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 * Pay attention to the fact that "*" (resp. "?") generally
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 * corresponds to "%" (resp. "_") in primitive LIKE of SQL. The
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 * values "%", "_", "\" should in the user request should
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 * respectively be escaped as "\%", "\_" and "\\".
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
59 *
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 * This matching must be case sensitive: The special case of PN VR
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 * is taken into consideration by normalizing the query string in
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 * method "NormalizeIdentifier()".
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 **/
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 class LookupIdentifierQuery : public boost::noncopyable
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 {
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
67 public:
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
68 class Constraint
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 {
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
70 private:
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 DicomTag tag_;
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 IdentifierConstraintType type_;
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 std::string value_;
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
75 public:
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 Constraint(const DicomTag& tag,
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 IdentifierConstraintType type,
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 const std::string& value) :
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 tag_(tag),
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 type_(type),
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
81 value_(NormalizeIdentifier(value))
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 }
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
84
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
85 const DicomTag& GetTag() const
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
86 {
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
87 return tag_;
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
88 }
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
89
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
90 IdentifierConstraintType GetType() const
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
91 {
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
92 return type_;
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
93 }
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
94
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
95 const std::string& GetValue() const
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
96 {
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
97 return value_;
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
98 }
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 };
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
101
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
102 class Disjunction : public boost::noncopyable
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
103 {
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
104 private:
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
105 std::vector<Constraint*> disjunction_;
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
106
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
107 public:
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
108 ~Disjunction();
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
109
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
110 void Add(const DicomTag& tag,
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
111 IdentifierConstraintType type,
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
112 const std::string& value);
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
113
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
114 size_t GetSize() const
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
115 {
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
116 return disjunction_.size();
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
117 }
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
118
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
119 const Constraint& GetConstraint(size_t i) const
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
120 {
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
121 return *disjunction_[i];
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
122 }
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
123 };
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
124
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
125
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
126 private:
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
127 typedef std::vector<Disjunction*> Constraints;
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 ResourceType level_;
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 Constraints constraints_;
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 public:
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 LookupIdentifierQuery(ResourceType level) : level_(level)
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 {
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 }
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 ~LookupIdentifierQuery();
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
139 bool IsIdentifier(const DicomTag& tag)
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
140 {
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
141 return IsIdentifier(tag, level_);
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
142 }
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 void AddConstraint(DicomTag tag,
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 IdentifierConstraintType type,
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 const std::string& value);
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
148 Disjunction& AddDisjunction();
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
149
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
150 ResourceType GetLevel() const
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
151 {
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
152 return level_;
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
153 }
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
154
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1745
diff changeset
155 size_t GetSize() const
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 {
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 return constraints_.size();
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 }
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
160 // The database must be locked
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
161 void Apply(std::list<std::string>& result,
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
162 IDatabaseWrapper& database);
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163
1750
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1749
diff changeset
164 void Apply(SetOfResources& result,
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1749
diff changeset
165 IDatabaseWrapper& database);
55d52567bebb LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1749
diff changeset
166
1749
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
167 static void LoadIdentifiers(const DicomTag*& tags,
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
168 size_t& size,
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
169 ResourceType level);
99f4a05f39fa various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1748
diff changeset
170
1748
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
171 static bool IsIdentifier(const DicomTag& tag,
92203f713205 IFindConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1747
diff changeset
172 ResourceType level);
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 static void StoreIdentifiers(IDatabaseWrapper& database,
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 int64_t resource,
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 ResourceType level,
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 const DicomMap& map);
1758
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1750
diff changeset
178
1764
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1758
diff changeset
179 static std::string NormalizeIdentifier(const std::string& value);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1758
diff changeset
180
1758
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1750
diff changeset
181 void Print(std::ostream& s) const;
1745
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 };
38dda23c7d7d LookupIdentifierQuery
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 }