Mercurial > hg > orthanc
comparison OrthancServer/Sources/Database/FindResponse.cpp @ 5672:e300f22a46f0 find-refactoring
implemented computed tags
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 06 Jul 2024 14:24:45 +0200 |
parents | b4c97c51f9db |
children | ebcbb448bea8 |
comparison
equal
deleted
inserted
replaced
5671:b4c97c51f9db | 5672:e300f22a46f0 |
---|---|
153 throw OrthancException(ErrorCode_BadSequenceOfCalls); | 153 throw OrthancException(ErrorCode_BadSequenceOfCalls); |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 void FindResponse::ChildrenInformation::AddMetadataValue(MetadataType metadata, | |
159 const std::string& value) | |
160 { | |
161 MetadataValues::iterator found = metadataValues_.find(metadata); | |
162 | |
163 if (found == metadataValues_.end()) | |
164 { | |
165 std::set<std::string> s; | |
166 s.insert(value); | |
167 metadataValues_[metadata] = s; | |
168 } | |
169 else | |
170 { | |
171 found->second.insert(value); | |
172 } | |
173 } | |
174 | |
175 | |
176 void FindResponse::ChildrenInformation::GetMetadataValues(std::set<std::string>& values, | |
177 MetadataType metadata) const | |
178 { | |
179 MetadataValues::const_iterator found = metadataValues_.find(metadata); | |
180 | |
181 if (found == metadataValues_.end()) | |
182 { | |
183 values.clear(); | |
184 } | |
185 else | |
186 { | |
187 values = found->second; | |
188 } | |
189 } | |
190 | |
191 | |
192 void FindResponse::ChildrenInformation::AddMainDicomTagValue(const DicomTag& tag, | |
193 const std::string& value) | |
194 { | |
195 MainDicomTagValues::iterator found = mainDicomTagValues_.find(tag); | |
196 | |
197 if (found == mainDicomTagValues_.end()) | |
198 { | |
199 std::set<std::string> s; | |
200 s.insert(value); | |
201 mainDicomTagValues_[tag] = s; | |
202 } | |
203 else | |
204 { | |
205 found->second.insert(value); | |
206 } | |
207 } | |
208 | |
209 | |
210 void FindResponse::ChildrenInformation::GetMainDicomTagValues(std::set<std::string>& values, | |
211 const DicomTag& tag) const | |
212 { | |
213 MainDicomTagValues::const_iterator found = mainDicomTagValues_.find(tag); | |
214 | |
215 if (found == mainDicomTagValues_.end()) | |
216 { | |
217 values.clear(); | |
218 } | |
219 else | |
220 { | |
221 values = found->second; | |
222 } | |
223 } | |
224 | |
225 | |
158 FindResponse::ChildrenInformation& FindResponse::Resource::GetChildrenInformation(ResourceType level) | 226 FindResponse::ChildrenInformation& FindResponse::Resource::GetChildrenInformation(ResourceType level) |
159 { | 227 { |
160 switch (level) | 228 switch (level) |
161 { | 229 { |
162 case ResourceType_Study: | 230 case ResourceType_Study: |