Mercurial > hg > orthanc
annotate OrthancServer/Sources/ResourceFinder.cpp @ 5641:3f13db27b399 find-refactoring
integration mainline->find-refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 May 2024 21:27:48 +0200 |
parents | 732ec9feeea8 |
children | d8c86698110c |
rev | line source |
---|---|
5608 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5641
3f13db27b399
integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5621
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
3f13db27b399
integration mainline->find-refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5621
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5608 | 7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
8 * | |
9 * This program is free software: you can redistribute it and/or | |
10 * modify it under the terms of the GNU General Public License as | |
11 * published by the Free Software Foundation, either version 3 of the | |
12 * License, or (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, but | |
15 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 * General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 **/ | |
22 | |
23 | |
24 #include "PrecompiledHeadersServer.h" | |
25 #include "ResourceFinder.h" | |
26 | |
27 #include "../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.h" | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
28 #include "../../OrthancFramework/Sources/Logging.h" |
5608 | 29 #include "../../OrthancFramework/Sources/OrthancException.h" |
30 #include "../../OrthancFramework/Sources/SerializationToolbox.h" | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
31 #include "OrthancConfiguration.h" |
5608 | 32 #include "ServerContext.h" |
33 #include "ServerIndex.h" | |
34 | |
35 | |
36 namespace Orthanc | |
37 { | |
38 SeriesStatus ResourceFinder::GetSeriesStatus(uint32_t& expectedNumberOfInstances, | |
39 const FindResponse::Resource& resource) const | |
40 { | |
41 if (request_.GetLevel() != ResourceType_Series) | |
42 { | |
43 throw OrthancException(ErrorCode_BadParameterType); | |
44 } | |
45 | |
46 std::string s; | |
47 if (!resource.LookupMetadata(s, ResourceType_Series, MetadataType_Series_ExpectedNumberOfInstances) || | |
48 !SerializationToolbox::ParseUnsignedInteger32(expectedNumberOfInstances, s)) | |
49 { | |
50 return SeriesStatus_Unknown; | |
51 } | |
52 | |
53 std::list<std::string> values; | |
54 if (!resource.LookupChildrenMetadata(values, MetadataType_Instance_IndexInSeries)) | |
55 { | |
56 throw OrthancException(ErrorCode_BadSequenceOfCalls); | |
57 } | |
58 | |
59 std::set<int64_t> instances; | |
60 | |
61 for (std::list<std::string>::const_iterator | |
62 it = values.begin(); it != values.end(); ++it) | |
63 { | |
64 int64_t index; | |
65 | |
66 if (!SerializationToolbox::ParseInteger64(index, *it)) | |
67 { | |
68 return SeriesStatus_Unknown; | |
69 } | |
70 | |
71 if (index <= 0 || | |
72 index > static_cast<int64_t>(expectedNumberOfInstances)) | |
73 { | |
74 // Out-of-range instance index | |
75 return SeriesStatus_Inconsistent; | |
76 } | |
77 | |
78 if (instances.find(index) != instances.end()) | |
79 { | |
80 // Twice the same instance index | |
81 return SeriesStatus_Inconsistent; | |
82 } | |
83 | |
84 instances.insert(index); | |
85 } | |
86 | |
87 if (instances.size() == static_cast<size_t>(expectedNumberOfInstances)) | |
88 { | |
89 return SeriesStatus_Complete; | |
90 } | |
91 else | |
92 { | |
93 return SeriesStatus_Missing; | |
94 } | |
95 } | |
96 | |
97 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
98 static void InjectRequestedTags(DicomMap& requestedTags, |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
99 std::set<DicomTag>& missingTags /* out */, |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
100 const FindResponse::Resource& resource, |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
101 ResourceType level, |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
102 const std::set<DicomTag>& tags) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
103 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
104 if (!tags.empty()) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
105 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
106 DicomMap m; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
107 resource.GetMainDicomTags(m, level); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
108 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
109 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
110 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
111 std::string value; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
112 if (m.LookupStringValue(value, *it, false /* not binary */)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
113 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
114 requestedTags.SetValue(*it, value, false /* not binary */); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
115 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
116 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
117 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
118 // This is the case where the Housekeeper should be run |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
119 missingTags.insert(*it); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
120 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
121 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
122 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
123 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
124 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
125 |
5608 | 126 void ResourceFinder::Expand(Json::Value& target, |
127 const FindResponse::Resource& resource, | |
128 ServerIndex& index) const | |
129 { | |
130 /** | |
131 * This method closely follows "SerializeExpandedResource()" in | |
132 * "ServerContext.cpp" from Orthanc 1.12.3. | |
133 **/ | |
134 | |
135 if (resource.GetLevel() != request_.GetLevel()) | |
136 { | |
137 throw OrthancException(ErrorCode_InternalError); | |
138 } | |
139 | |
140 target = Json::objectValue; | |
141 | |
142 target["Type"] = GetResourceTypeText(resource.GetLevel(), false, true); | |
143 target["ID"] = resource.GetIdentifier(); | |
144 | |
145 switch (resource.GetLevel()) | |
146 { | |
147 case ResourceType_Patient: | |
148 break; | |
149 | |
150 case ResourceType_Study: | |
151 target["ParentPatient"] = resource.GetParentIdentifier(); | |
152 break; | |
153 | |
154 case ResourceType_Series: | |
155 target["ParentStudy"] = resource.GetParentIdentifier(); | |
156 break; | |
157 | |
158 case ResourceType_Instance: | |
159 target["ParentSeries"] = resource.GetParentIdentifier(); | |
160 break; | |
161 | |
162 default: | |
163 throw OrthancException(ErrorCode_InternalError); | |
164 } | |
165 | |
166 if (resource.GetLevel() != ResourceType_Instance) | |
167 { | |
168 const std::set<std::string>& children = resource.GetChildrenIdentifiers(); | |
169 | |
170 Json::Value c = Json::arrayValue; | |
171 for (std::set<std::string>::const_iterator | |
172 it = children.begin(); it != children.end(); ++it) | |
173 { | |
174 c.append(*it); | |
175 } | |
176 | |
177 switch (resource.GetLevel()) | |
178 { | |
179 case ResourceType_Patient: | |
180 target["Studies"] = c; | |
181 break; | |
182 | |
183 case ResourceType_Study: | |
184 target["Series"] = c; | |
185 break; | |
186 | |
187 case ResourceType_Series: | |
188 target["Instances"] = c; | |
189 break; | |
190 | |
191 default: | |
192 throw OrthancException(ErrorCode_InternalError); | |
193 } | |
194 } | |
195 | |
196 switch (resource.GetLevel()) | |
197 { | |
198 case ResourceType_Patient: | |
199 case ResourceType_Study: | |
200 break; | |
201 | |
202 case ResourceType_Series: | |
203 { | |
204 uint32_t expectedNumberOfInstances; | |
205 SeriesStatus status = GetSeriesStatus(expectedNumberOfInstances, resource); | |
206 | |
207 target["Status"] = EnumerationToString(status); | |
208 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
209 static const char* const EXPECTED_NUMBER_OF_INSTANCES = "ExpectedNumberOfInstances"; |
5608 | 210 |
211 if (status == SeriesStatus_Unknown) | |
212 { | |
213 target[EXPECTED_NUMBER_OF_INSTANCES] = Json::nullValue; | |
214 } | |
215 else | |
216 { | |
217 target[EXPECTED_NUMBER_OF_INSTANCES] = expectedNumberOfInstances; | |
218 } | |
219 | |
220 break; | |
221 } | |
222 | |
223 case ResourceType_Instance: | |
224 { | |
225 FileInfo info; | |
226 if (resource.LookupAttachment(info, FileContentType_Dicom)) | |
227 { | |
228 target["FileSize"] = static_cast<Json::UInt64>(info.GetUncompressedSize()); | |
229 target["FileUuid"] = info.GetUuid(); | |
230 } | |
231 else | |
232 { | |
233 throw OrthancException(ErrorCode_InternalError); | |
234 } | |
235 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
236 static const char* const INDEX_IN_SERIES = "IndexInSeries"; |
5608 | 237 |
238 std::string s; | |
239 uint32_t index; | |
240 if (resource.LookupMetadata(s, ResourceType_Instance, MetadataType_Instance_IndexInSeries) && | |
241 SerializationToolbox::ParseUnsignedInteger32(index, s)) | |
242 { | |
243 target[INDEX_IN_SERIES] = index; | |
244 } | |
245 else | |
246 { | |
247 target[INDEX_IN_SERIES] = Json::nullValue; | |
248 } | |
249 | |
250 break; | |
251 } | |
252 | |
253 default: | |
254 throw OrthancException(ErrorCode_InternalError); | |
255 } | |
256 | |
257 std::string s; | |
258 if (resource.LookupMetadata(s, resource.GetLevel(), MetadataType_AnonymizedFrom)) | |
259 { | |
260 target["AnonymizedFrom"] = s; | |
261 } | |
262 | |
263 if (resource.LookupMetadata(s, resource.GetLevel(), MetadataType_ModifiedFrom)) | |
264 { | |
265 target["ModifiedFrom"] = s; | |
266 } | |
267 | |
268 if (resource.GetLevel() == ResourceType_Patient || | |
269 resource.GetLevel() == ResourceType_Study || | |
270 resource.GetLevel() == ResourceType_Series) | |
271 { | |
272 target["IsStable"] = !index.IsUnstableResource(resource.GetLevel(), resource.GetInternalId()); | |
273 | |
274 if (resource.LookupMetadata(s, resource.GetLevel(), MetadataType_LastUpdate)) | |
275 { | |
276 target["LastUpdate"] = s; | |
277 } | |
278 } | |
279 | |
280 { | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
281 DicomMap allMainDicomTags; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
282 resource.GetMainDicomTags(allMainDicomTags, resource.GetLevel()); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
283 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
284 /** |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
285 * This section was part of "StatelessDatabaseOperations::ExpandResource()" |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
286 * in Orthanc <= 1.12.3 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
287 **/ |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
288 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
289 // read all main sequences from DB |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
290 std::string serializedSequences; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
291 if (resource.LookupMetadata(serializedSequences, resource.GetLevel(), MetadataType_MainDicomSequences)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
292 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
293 Json::Value jsonMetadata; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
294 Toolbox::ReadJson(jsonMetadata, serializedSequences); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
295 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
296 if (jsonMetadata["Version"].asInt() == 1) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
297 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
298 allMainDicomTags.FromDicomAsJson(jsonMetadata["Sequences"], true /* append */, true /* parseSequences */); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
299 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
300 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
301 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
302 throw OrthancException(ErrorCode_NotImplemented); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
303 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
304 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
305 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
306 /** |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
307 * End of section from StatelessDatabaseOperations |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
308 **/ |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
309 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
310 |
5608 | 311 static const char* const MAIN_DICOM_TAGS = "MainDicomTags"; |
312 static const char* const PATIENT_MAIN_DICOM_TAGS = "PatientMainDicomTags"; | |
313 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
314 // TODO-FIND : Ignore "null" values |
5608 | 315 |
316 DicomMap levelMainDicomTags; | |
317 allMainDicomTags.ExtractResourceInformation(levelMainDicomTags, resource.GetLevel()); | |
318 | |
319 target[MAIN_DICOM_TAGS] = Json::objectValue; | |
320 FromDcmtkBridge::ToJson(target[MAIN_DICOM_TAGS], levelMainDicomTags, format_); | |
321 | |
322 if (resource.GetLevel() == ResourceType_Study) | |
323 { | |
324 DicomMap patientMainDicomTags; | |
325 allMainDicomTags.ExtractPatientInformation(patientMainDicomTags); | |
326 | |
327 target[PATIENT_MAIN_DICOM_TAGS] = Json::objectValue; | |
328 FromDcmtkBridge::ToJson(target[PATIENT_MAIN_DICOM_TAGS], patientMainDicomTags, format_); | |
329 } | |
330 } | |
331 | |
332 { | |
333 Json::Value labels = Json::arrayValue; | |
334 | |
335 for (std::set<std::string>::const_iterator | |
336 it = resource.GetLabels().begin(); it != resource.GetLabels().end(); ++it) | |
337 { | |
338 labels.append(*it); | |
339 } | |
340 | |
341 target["Labels"] = labels; | |
342 } | |
343 | |
344 if (includeAllMetadata_) // new in Orthanc 1.12.4 | |
345 { | |
346 const std::map<MetadataType, std::string>& m = resource.GetMetadata(resource.GetLevel()); | |
347 | |
348 Json::Value metadata = Json::objectValue; | |
349 | |
350 for (std::map<MetadataType, std::string>::const_iterator it = m.begin(); it != m.end(); ++it) | |
351 { | |
352 metadata[EnumerationToString(it->first)] = it->second; | |
353 } | |
354 | |
355 target["Metadata"] = metadata; | |
356 } | |
357 } | |
358 | |
359 | |
360 ResourceFinder::ResourceFinder(ResourceType level, | |
361 bool expand) : | |
362 request_(level), | |
363 expand_(expand), | |
364 format_(DicomToJsonFormat_Human), | |
5617
8905ffa45fc2
started listing of children resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5616
diff
changeset
|
365 allowStorageAccess_(true), |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
366 hasRequestedTags_(false), |
5608 | 367 includeAllMetadata_(false) |
368 { | |
369 if (expand) | |
370 { | |
5619
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
371 request_.SetRetrieveMainDicomTags(true); |
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
372 request_.SetRetrieveMetadata(true); |
5608 | 373 request_.SetRetrieveLabels(true); |
374 | |
5621
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
375 switch (level) |
5608 | 376 { |
5621
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
377 case ResourceType_Patient: |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
378 request_.GetChildrenRetrieveSpecification(ResourceType_Study).SetRetrieveIdentifiers(true); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
379 break; |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
380 |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
381 case ResourceType_Study: |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
382 request_.GetChildrenRetrieveSpecification(ResourceType_Series).SetRetrieveIdentifiers(true); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
383 request_.SetRetrieveParentIdentifier(true); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
384 break; |
5608 | 385 |
5621
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
386 case ResourceType_Series: |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
387 request_.AddRetrieveChildrenMetadata(MetadataType_Instance_IndexInSeries); // required for the SeriesStatus |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
388 request_.GetChildrenRetrieveSpecification(ResourceType_Instance).SetRetrieveIdentifiers(true); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
389 request_.SetRetrieveParentIdentifier(true); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
390 break; |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
391 |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
392 case ResourceType_Instance: |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
393 request_.SetRetrieveAttachments(true); // for FileSize & FileUuid |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
394 request_.SetRetrieveParentIdentifier(true); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
395 break; |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
396 |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
397 default: |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
398 throw OrthancException(ErrorCode_ParameterOutOfRange); |
5608 | 399 } |
400 } | |
401 } | |
402 | |
403 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
404 void ResourceFinder::AddRequestedTags(const DicomTag& tag) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
405 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
406 if (DicomMap::IsMainDicomTag(tag, ResourceType_Patient)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
407 { |
5620
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
408 if (request_.GetLevel() == ResourceType_Patient) |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
409 { |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
410 request_.GetParentRetrieveSpecification(ResourceType_Patient).SetRetrieveMainDicomTags(true); |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
411 request_.GetParentRetrieveSpecification(ResourceType_Patient).SetRetrieveMetadata(true); |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
412 requestedPatientTags_.insert(tag); |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
413 } |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
414 else |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
415 { |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
416 /** |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
417 * This comes from the fact that patient-level tags are copied |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
418 * at the study level, as implemented by "ResourcesContent::AddResource()". |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
419 **/ |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
420 request_.GetParentRetrieveSpecification(ResourceType_Study).SetRetrieveMainDicomTags(true); |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
421 request_.GetParentRetrieveSpecification(ResourceType_Study).SetRetrieveMetadata(true); |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
422 requestedStudyTags_.insert(tag); |
4bfd885fb45f
optimization as patient-level tags are copied at study level
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5619
diff
changeset
|
423 } |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
424 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
425 else if (DicomMap::IsMainDicomTag(tag, ResourceType_Study)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
426 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
427 if (request_.GetLevel() == ResourceType_Patient) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
428 { |
5612
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
429 LOG(WARNING) << "Requested tag " << tag.Format() |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
430 << " should only be read at the study, series, or instance level"; |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
431 requestedTagsFromFileStorage_.insert(tag); |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
432 request_.SetRetrieveOneInstanceIdentifier(true); |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
433 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
434 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
435 { |
5619
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
436 request_.GetParentRetrieveSpecification(ResourceType_Study).SetRetrieveMainDicomTags(true); |
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
437 request_.GetParentRetrieveSpecification(ResourceType_Study).SetRetrieveMetadata(true); |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
438 requestedStudyTags_.insert(tag); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
439 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
440 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
441 else if (DicomMap::IsMainDicomTag(tag, ResourceType_Series)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
442 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
443 if (request_.GetLevel() == ResourceType_Patient || |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
444 request_.GetLevel() == ResourceType_Study) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
445 { |
5612
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
446 LOG(WARNING) << "Requested tag " << tag.Format() |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
447 << " should only be read at the series or instance level"; |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
448 requestedTagsFromFileStorage_.insert(tag); |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
449 request_.SetRetrieveOneInstanceIdentifier(true); |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
450 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
451 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
452 { |
5619
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
453 request_.GetParentRetrieveSpecification(ResourceType_Series).SetRetrieveMainDicomTags(true); |
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
454 request_.GetParentRetrieveSpecification(ResourceType_Series).SetRetrieveMetadata(true); |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
455 requestedSeriesTags_.insert(tag); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
456 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
457 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
458 else if (DicomMap::IsMainDicomTag(tag, ResourceType_Instance)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
459 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
460 if (request_.GetLevel() == ResourceType_Patient || |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
461 request_.GetLevel() == ResourceType_Study || |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
462 request_.GetLevel() == ResourceType_Series) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
463 { |
5612
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
464 LOG(WARNING) << "Requested tag " << tag.Format() |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
465 << " should only be read at the instance level"; |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
466 requestedTagsFromFileStorage_.insert(tag); |
599ce5ed126c
added more tolerance to behave like previous releases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5610
diff
changeset
|
467 request_.SetRetrieveOneInstanceIdentifier(true); |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
468 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
469 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
470 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
471 // Main DICOM tags from the instance level will be retrieved anyway |
5619
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
472 assert(request_.IsRetrieveMainDicomTags()); |
1864b16bc7b1
added FindRequest::ParentRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5617
diff
changeset
|
473 assert(request_.IsRetrieveMetadata()); |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
474 requestedInstanceTags_.insert(tag); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
475 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
476 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
477 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
478 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
479 // This is not a main DICOM tag: We will be forced to access the DICOM file anyway |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
480 requestedTagsFromFileStorage_.insert(tag); |
5610
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
481 |
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
482 if (request_.GetLevel() != ResourceType_Instance) |
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
483 { |
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
484 request_.SetRetrieveOneInstanceIdentifier(true); |
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
485 } |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
486 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
487 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
488 hasRequestedTags_ = true; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
489 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
490 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
491 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
492 void ResourceFinder::AddRequestedTags(const std::set<DicomTag>& tags) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
493 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
494 for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
495 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
496 AddRequestedTags(*it); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
497 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
498 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
499 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
500 |
5608 | 501 void ResourceFinder::Execute(Json::Value& target, |
5621
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
502 ServerContext& context) const |
5608 | 503 { |
504 FindResponse response; | |
505 context.GetIndex().ExecuteFind(response, request_); | |
506 | |
507 target = Json::arrayValue; | |
508 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
509 for (size_t i = 0; i < response.GetSize(); i++) |
5608 | 510 { |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
511 const FindResponse::Resource& resource = response.GetResourceByIndex(i); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
512 |
5621
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
513 { |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
514 Json::Value v; |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
515 resource.DebugExport(v, request_); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
516 std::cout << v.toStyledString(); |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
517 } |
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
518 |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
519 if (expand_) |
5608 | 520 { |
521 Json::Value item; | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
522 Expand(item, resource, context.GetIndex()); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
523 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
524 std::set<DicomTag> missingTags = requestedTagsFromFileStorage_; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
525 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
526 DicomMap requestedTags; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
527 InjectRequestedTags(requestedTags, missingTags, resource, ResourceType_Patient, requestedPatientTags_); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
528 InjectRequestedTags(requestedTags, missingTags, resource, ResourceType_Study, requestedStudyTags_); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
529 InjectRequestedTags(requestedTags, missingTags, resource, ResourceType_Series, requestedSeriesTags_); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
530 InjectRequestedTags(requestedTags, missingTags, resource, ResourceType_Instance, requestedInstanceTags_); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
531 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
532 if (!missingTags.empty()) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
533 { |
5617
8905ffa45fc2
started listing of children resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5616
diff
changeset
|
534 if (!allowStorageAccess_) |
8905ffa45fc2
started listing of children resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5616
diff
changeset
|
535 { |
8905ffa45fc2
started listing of children resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5616
diff
changeset
|
536 throw OrthancException(ErrorCode_BadSequenceOfCalls, |
8905ffa45fc2
started listing of children resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5616
diff
changeset
|
537 "Cannot add missing requested tags, as access to file storage is disallowed"); |
8905ffa45fc2
started listing of children resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5616
diff
changeset
|
538 } |
8905ffa45fc2
started listing of children resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5616
diff
changeset
|
539 |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
540 OrthancConfiguration::ReaderLock lock; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
541 if (lock.GetConfiguration().IsWarningEnabled(Warnings_001_TagsBeingReadFromStorage)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
542 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
543 std::string missings; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
544 FromDcmtkBridge::FormatListOfTags(missings, missingTags); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
545 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
546 LOG(WARNING) << "W001: Accessing Dicom tags from storage when accessing " |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
547 << Orthanc::GetResourceTypeText(resource.GetLevel(), false, false) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
548 << ": " << missings; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
549 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
550 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
551 std::string instancePublicId; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
552 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
553 if (request_.IsRetrieveOneInstanceIdentifier()) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
554 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
555 instancePublicId = resource.GetOneInstanceIdentifier(); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
556 } |
5610
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
557 else if (request_.GetLevel() == ResourceType_Instance) |
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
558 { |
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
559 instancePublicId = resource.GetIdentifier(); |
d4b570834d3a
adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5609
diff
changeset
|
560 } |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
561 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
562 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
563 FindRequest requestDicomAttachment(request_.GetLevel()); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
564 requestDicomAttachment.SetOrthancId(request_.GetLevel(), resource.GetIdentifier()); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
565 requestDicomAttachment.SetRetrieveOneInstanceIdentifier(true); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
566 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
567 FindResponse responseDicomAttachment; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
568 context.GetIndex().ExecuteFind(responseDicomAttachment, requestDicomAttachment); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
569 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
570 if (responseDicomAttachment.GetSize() != 1 || |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
571 !responseDicomAttachment.GetResourceByIndex(0).HasOneInstanceIdentifier()) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
572 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
573 throw OrthancException(ErrorCode_InexistentFile); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
574 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
575 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
576 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
577 instancePublicId = responseDicomAttachment.GetResourceByIndex(0).GetOneInstanceIdentifier(); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
578 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
579 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
580 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
581 LOG(INFO) << "Will retrieve missing DICOM tags from instance: " << instancePublicId; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
582 |
5616 | 583 // TODO-FIND: What do we do if the DICOM has been removed since the request? |
584 // Do we fail, or do we skip the resource? | |
585 | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
586 Json::Value tmpDicomAsJson; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
587 context.ReadDicomAsJson(tmpDicomAsJson, instancePublicId, missingTags /* ignoreTagLength */); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
588 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
589 DicomMap tmpDicomMap; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
590 tmpDicomMap.FromDicomAsJson(tmpDicomAsJson, false /* append */, true /* parseSequences*/); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
591 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
592 for (std::set<DicomTag>::const_iterator it = missingTags.begin(); it != missingTags.end(); ++it) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
593 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
594 assert(!requestedTags.HasTag(*it)); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
595 if (tmpDicomMap.HasTag(*it)) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
596 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
597 requestedTags.SetValue(*it, tmpDicomMap.GetValue(*it)); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
598 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
599 else |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
600 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
601 requestedTags.SetNullValue(*it); // TODO-FIND: Is this compatible with Orthanc <= 1.12.3? |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
602 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
603 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
604 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
605 |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
606 if (hasRequestedTags_) |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
607 { |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
608 static const char* const REQUESTED_TAGS = "RequestedTags"; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
609 item[REQUESTED_TAGS] = Json::objectValue; |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
610 FromDcmtkBridge::ToJson(item[REQUESTED_TAGS], requestedTags, format_); |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
611 } |
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
612 |
5608 | 613 target.append(item); |
614 } | |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
615 else |
5608 | 616 { |
5609
4690a0d2b01e
preliminary support of requestedTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5608
diff
changeset
|
617 target.append(resource.GetIdentifier()); |
5608 | 618 } |
619 } | |
620 } | |
5615
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
621 |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
622 |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
623 bool ResourceFinder::ExecuteOneResource(Json::Value& target, |
5621
732ec9feeea8
introduction of FindRequest::ChildrenRetrieveSpecification
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5620
diff
changeset
|
624 ServerContext& context) const |
5615
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
625 { |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
626 Json::Value answer; |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
627 Execute(answer, context); |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
628 |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
629 if (answer.type() != Json::arrayValue) |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
630 { |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
631 throw OrthancException(ErrorCode_InternalError); |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
632 } |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
633 else if (answer.size() > 1) |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
634 { |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
635 throw OrthancException(ErrorCode_DatabasePlugin); |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
636 } |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
637 else if (answer.empty()) |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
638 { |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
639 // Inexistent resource (or was deleted between the first and second phases) |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
640 return false; |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
641 } |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
642 else |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
643 { |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
644 target = answer[0]; |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
645 return true; |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
646 } |
a10978a5e65c
expansion of single resources using ResourceFinder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5612
diff
changeset
|
647 } |
5608 | 648 } |