Mercurial > hg > orthanc
annotate OrthancServer/Resources/Graveyard/DatabaseOptimizations/LookupIdentifierQuery.cpp @ 5155:20911302c6e7
doc
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 01 Feb 2023 19:32:14 +0100 |
parents | 6eff25f70121 |
children | 0ea402b4d901 |
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 |
4870
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1745 | 7 * |
8 * This program is free software: you can redistribute it and/or | |
9 * modify it under the terms of the GNU General Public License as | |
10 * published by the Free Software Foundation, either version 3 of the | |
11 * License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
14 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 **/ | |
21 | |
22 | |
1747 | 23 #include "../PrecompiledHeadersServer.h" |
1745 | 24 #include "LookupIdentifierQuery.h" |
25 | |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
26 #include "../../Core/DicomParsing/FromDcmtkBridge.h" |
1747 | 27 #include "../../Core/OrthancException.h" |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
28 #include "../ServerToolbox.h" |
1746 | 29 #include "SetOfResources.h" |
1745 | 30 |
31 #include <cassert> | |
32 | |
33 | |
34 | |
35 namespace Orthanc | |
36 { | |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
37 LookupIdentifierQuery::SingleConstraint:: |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
38 SingleConstraint(const DicomTag& tag, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
39 IdentifierConstraintType type, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
40 const std::string& value) : |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
41 tag_(tag), |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
42 type_(type), |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
43 value_(ServerToolbox::NormalizeIdentifier(value)) |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
44 { |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
45 } |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
46 |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
47 |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
48 LookupIdentifierQuery::RangeConstraint:: |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
49 RangeConstraint(const DicomTag& tag, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
50 const std::string& start, |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
51 const std::string& end) : |
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 start_(ServerToolbox::NormalizeIdentifier(start)), |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
54 end_(ServerToolbox::NormalizeIdentifier(end)) |
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 |
1749
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
59 LookupIdentifierQuery::Disjunction::~Disjunction() |
1748 | 60 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
61 for (size_t i = 0; i < singleConstraints_.size(); i++) |
1748 | 62 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
63 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
|
64 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
65 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
66 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
|
67 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
68 delete rangeConstraints_[i]; |
1748 | 69 } |
70 } | |
71 | |
72 | |
1749
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
73 void LookupIdentifierQuery::Disjunction::Add(const DicomTag& tag, |
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
74 IdentifierConstraintType type, |
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
75 const std::string& value) |
1748 | 76 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
77 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
|
78 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
79 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
80 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
81 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
|
82 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
|
83 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
|
84 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
85 rangeConstraints_.push_back(new RangeConstraint(tag, start, end)); |
1748 | 86 } |
87 | |
1746 | 88 |
89 LookupIdentifierQuery::~LookupIdentifierQuery() | |
90 { | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
91 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
|
92 it != disjunctions_.end(); ++it) |
1746 | 93 { |
94 delete *it; | |
95 } | |
96 } | |
97 | |
98 | |
3001
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
99 bool LookupIdentifierQuery::IsIdentifier(const DicomTag& tag) |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
100 { |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
101 return ServerToolbox::IsIdentifier(tag, level_); |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
102 } |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
103 |
7695a9c81099
refactoring /tools/find using LookupResource::IVisitor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2697
diff
changeset
|
104 |
1745 | 105 void LookupIdentifierQuery::AddConstraint(DicomTag tag, |
106 IdentifierConstraintType type, | |
107 const std::string& value) | |
108 { | |
109 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
|
110 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
|
111 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
|
112 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
113 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
114 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
115 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
|
116 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
|
117 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
|
118 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
119 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
|
120 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
|
121 disjunctions_.back()->AddRange(tag, start, end); |
1745 | 122 } |
123 | |
124 | |
1749
99f4a05f39fa
various types of constraints
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1748
diff
changeset
|
125 LookupIdentifierQuery::Disjunction& LookupIdentifierQuery::AddDisjunction() |
1745 | 126 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
127 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
|
128 return *disjunctions_.back(); |
1745 | 129 } |
130 | |
131 | |
1746 | 132 void LookupIdentifierQuery::Apply(std::list<std::string>& result, |
133 IDatabaseWrapper& database) | |
134 { | |
135 SetOfResources resources(database, level_); | |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
136 Apply(resources, database); |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
137 |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
138 resources.Flatten(result); |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
139 } |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
140 |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
141 |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
142 void LookupIdentifierQuery::Apply(SetOfResources& result, |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
143 IDatabaseWrapper& database) |
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
144 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
145 for (size_t i = 0; i < disjunctions_.size(); i++) |
1746 | 146 { |
1748 | 147 std::list<int64_t> a; |
148 | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
149 for (size_t j = 0; j < disjunctions_[i]->GetSingleConstraintsCount(); j++) |
1748 | 150 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
151 const SingleConstraint& constraint = disjunctions_[i]->GetSingleConstraint(j); |
1748 | 152 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
|
153 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
|
154 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
|
155 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
156 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
|
157 } |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
158 |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
159 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
|
160 { |
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
161 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
|
162 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
|
163 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
|
164 constraint.GetStart(), constraint.GetEnd()); |
1748 | 165 |
166 a.splice(a.end(), b); | |
167 } | |
168 | |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
169 result.Intersect(a); |
1746 | 170 } |
1750
55d52567bebb
LookupResource implemented
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1749
diff
changeset
|
171 } |
1746 | 172 |
1758 | 173 |
174 void LookupIdentifierQuery::Print(std::ostream& s) const | |
175 { | |
176 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
|
177 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
|
178 it = disjunctions_.begin(); it != disjunctions_.end(); ++it) |
1758 | 179 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
180 if (it == disjunctions_.begin()) |
1758 | 181 s << " "; |
182 else | |
183 s << "OR "; | |
184 | |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
185 for (size_t j = 0; j < (*it)->GetSingleConstraintsCount(); j++) |
1758 | 186 { |
2697
e583478e0c6c
New primitive in database SDK: "lookupIdentifierRange" to speed up range searches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2696
diff
changeset
|
187 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
|
188 s << FromDcmtkBridge::GetTagName(c.GetTag(), ""); |
1758 | 189 |
190 switch (c.GetType()) | |
191 { | |
192 case IdentifierConstraintType_Equal: s << " == "; break; | |
193 case IdentifierConstraintType_SmallerOrEqual: s << " <= "; break; | |
194 case IdentifierConstraintType_GreaterOrEqual: s << " >= "; break; | |
195 case IdentifierConstraintType_Wildcard: s << " ~= "; break; | |
196 default: | |
197 s << " ? "; | |
198 } | |
199 | |
200 s << c.GetValue() << std::endl; | |
201 } | |
202 } | |
203 } | |
1745 | 204 } |