Mercurial > hg > orthanc
annotate Resources/Graveyard/DatabaseOptimizations/LookupIdentifierQuery.cpp @ 3660:f159b731c47d storage-commitment
IStorageCommitmentFactory
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 10 Feb 2020 17:39:53 +0100 |
parents | 94f4a18a79cc |
children |
rev | line source |
---|---|
1745 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1745 | 4 * Department, University Hospital of Liege, Belgium |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3061
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
1745 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
11 * | |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
23 * | |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
32 | |
33 | |
1747 | 34 #include "../PrecompiledHeadersServer.h" |
1745 | 35 #include "LookupIdentifierQuery.h" |
36 | |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
37 #include "../../Core/DicomParsing/FromDcmtkBridge.h" |
1747 | 38 #include "../../Core/OrthancException.h" |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
39 #include "../ServerToolbox.h" |
1746 | 40 #include "SetOfResources.h" |
1745 | 41 |
42 #include <cassert> | |
43 | |
44 | |
45 | |
46 namespace Orthanc | |
47 { | |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
48 LookupIdentifierQuery::SingleConstraint:: |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
49 SingleConstraint(const DicomTag& tag, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
50 IdentifierConstraintType type, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
51 const std::string& value) : |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
52 tag_(tag), |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
53 type_(type), |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
54 value_(ServerToolbox::NormalizeIdentifier(value)) |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
55 { |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
56 } |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
57 |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
58 |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
59 LookupIdentifierQuery::RangeConstraint:: |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
60 RangeConstraint(const DicomTag& tag, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
61 const std::string& start, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
62 const std::string& end) : |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
63 tag_(tag), |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
64 start_(ServerToolbox::NormalizeIdentifier(start)), |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
65 end_(ServerToolbox::NormalizeIdentifier(end)) |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
66 { |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
67 } |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
68 |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
69 |
1749
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
70 LookupIdentifierQuery::Disjunction::~Disjunction() |
1748 | 71 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
72 for (size_t i = 0; i < singleConstraints_.size(); i++) |
1748 | 73 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
74 delete singleConstraints_[i]; |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
75 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
76 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
77 for (size_t i = 0; i < rangeConstraints_.size(); i++) |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
78 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
79 delete rangeConstraints_[i]; |
1748 | 80 } |
81 } | |
82 | |
83 | |
1749
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
84 void LookupIdentifierQuery::Disjunction::Add(const DicomTag& tag, |
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
85 IdentifierConstraintType type, |
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
86 const std::string& value) |
1748 | 87 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
88 singleConstraints_.push_back(new SingleConstraint(tag, type, value)); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
89 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
90 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
91 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
92 void LookupIdentifierQuery::Disjunction::AddRange(const DicomTag& tag, |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
93 const std::string& start, |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
94 const std::string& end) |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
95 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
96 rangeConstraints_.push_back(new RangeConstraint(tag, start, end)); |
1748 | 97 } |
98 | |
1746 | 99 |
100 LookupIdentifierQuery::~LookupIdentifierQuery() | |
101 { | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
102 for (Disjunctions::iterator it = disjunctions_.begin(); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
103 it != disjunctions_.end(); ++it) |
1746 | 104 { |
105 delete *it; | |
106 } | |
107 } | |
108 | |
109 | |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
110 bool LookupIdentifierQuery::IsIdentifier(const DicomTag& tag) |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
111 { |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
112 return ServerToolbox::IsIdentifier(tag, level_); |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
113 } |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
114 |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
115 |
1745 | 116 void LookupIdentifierQuery::AddConstraint(DicomTag tag, |
117 IdentifierConstraintType type, | |
118 const std::string& value) | |
119 { | |
120 assert(IsIdentifier(tag)); | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
121 disjunctions_.push_back(new Disjunction); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
122 disjunctions_.back()->Add(tag, type, value); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
123 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
124 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
125 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
126 void LookupIdentifierQuery::AddRange(DicomTag tag, |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
127 const std::string& start, |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
128 const std::string& end) |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
129 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
130 assert(IsIdentifier(tag)); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
131 disjunctions_.push_back(new Disjunction); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
132 disjunctions_.back()->AddRange(tag, start, end); |
1745 | 133 } |
134 | |
135 | |
1749
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
136 LookupIdentifierQuery::Disjunction& LookupIdentifierQuery::AddDisjunction() |
1745 | 137 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
138 disjunctions_.push_back(new Disjunction); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
139 return *disjunctions_.back(); |
1745 | 140 } |
141 | |
142 | |
1746 | 143 void LookupIdentifierQuery::Apply(std::list<std::string>& result, |
144 IDatabaseWrapper& database) | |
145 { | |
146 SetOfResources resources(database, level_); | |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
147 Apply(resources, database); |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
148 |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
149 resources.Flatten(result); |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
150 } |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
151 |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
152 |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
153 void LookupIdentifierQuery::Apply(SetOfResources& result, |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
154 IDatabaseWrapper& database) |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
155 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
156 for (size_t i = 0; i < disjunctions_.size(); i++) |
1746 | 157 { |
1748 | 158 std::list<int64_t> a; |
159 | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
160 for (size_t j = 0; j < disjunctions_[i]->GetSingleConstraintsCount(); j++) |
1748 | 161 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
162 const SingleConstraint& constraint = disjunctions_[i]->GetSingleConstraint(j); |
1748 | 163 std::list<int64_t> b; |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
164 database.LookupIdentifier(b, level_, constraint.GetTag(), |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
165 constraint.GetType(), constraint.GetValue()); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
166 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
167 a.splice(a.end(), b); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
168 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
169 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
170 for (size_t j = 0; j < disjunctions_[i]->GetRangeConstraintsCount(); j++) |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
171 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
172 const RangeConstraint& constraint = disjunctions_[i]->GetRangeConstraint(j); |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
173 std::list<int64_t> b; |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
174 database.LookupIdentifierRange(b, level_, constraint.GetTag(), |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
175 constraint.GetStart(), constraint.GetEnd()); |
1748 | 176 |
177 a.splice(a.end(), b); | |
178 } | |
179 | |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
180 result.Intersect(a); |
1746 | 181 } |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
182 } |
1746 | 183 |
1758 | 184 |
185 void LookupIdentifierQuery::Print(std::ostream& s) const | |
186 { | |
187 s << "Constraint: " << std::endl; | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
188 for (Disjunctions::const_iterator |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
189 it = disjunctions_.begin(); it != disjunctions_.end(); ++it) |
1758 | 190 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
191 if (it == disjunctions_.begin()) |
1758 | 192 s << " "; |
193 else | |
194 s << "OR "; | |
195 | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
196 for (size_t j = 0; j < (*it)->GetSingleConstraintsCount(); j++) |
1758 | 197 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
198 const SingleConstraint& c = (*it)->GetSingleConstraint(j); |
2115
a657f7772e69
Handling of private tags/creators in the "Dictionary" configuration option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
199 s << FromDcmtkBridge::GetTagName(c.GetTag(), ""); |
1758 | 200 |
201 switch (c.GetType()) | |
202 { | |
203 case IdentifierConstraintType_Equal: s << " == "; break; | |
204 case IdentifierConstraintType_SmallerOrEqual: s << " <= "; break; | |
205 case IdentifierConstraintType_GreaterOrEqual: s << " >= "; break; | |
206 case IdentifierConstraintType_Wildcard: s << " ~= "; break; | |
207 default: | |
208 s << " ? "; | |
209 } | |
210 | |
211 s << c.GetValue() << std::endl; | |
212 } | |
213 } | |
214 } | |
1745 | 215 } |