Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerContext.cpp @ 4939:e8a2e145c80e more-tags
cleanup
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 15 Mar 2022 09:09:52 +0100 |
parents | 3f9b9865c8cc |
children | 304514ce84ee |
comparison
equal
deleted
inserted
replaced
4938:f630796a59b1 | 4939:e8a2e145c80e |
---|---|
2268 return ExpandResource(target, publicId, unusedInstanceId, unusedValue, level, format, requestedTags); | 2268 return ExpandResource(target, publicId, unusedInstanceId, unusedValue, level, format, requestedTags); |
2269 } | 2269 } |
2270 | 2270 |
2271 bool ServerContext::ExpandResource(Json::Value& target, | 2271 bool ServerContext::ExpandResource(Json::Value& target, |
2272 const std::string& publicId, | 2272 const std::string& publicId, |
2273 const std::string& instanceId, // optional: the id of an instance for the resource | 2273 const std::string& instanceId, // optional: the id of an instance for the resource (if already available) |
2274 const Json::Value& dicomAsJson, // optional: the dicom-as-json for the resource | 2274 const Json::Value& dicomAsJson, // optional: the dicom-as-json for the resource (if already available) |
2275 ResourceType level, | 2275 ResourceType level, |
2276 DicomToJsonFormat format, | 2276 DicomToJsonFormat format, |
2277 const std::set<DicomTag>& requestedTags) | 2277 const std::set<DicomTag>& requestedTags) |
2278 { | 2278 { |
2279 ExpandedResource resource; | 2279 ExpandedResource resource; |
2280 | 2280 |
2281 if (GetIndex().ExpandResource(resource, publicId, level, format, requestedTags)) | 2281 if (ExpandResource(resource, publicId, instanceId, dicomAsJson, level, requestedTags)) |
2282 { | |
2283 SerializeExpandedResource(target, resource, format, requestedTags); | |
2284 return true; | |
2285 } | |
2286 | |
2287 return false; | |
2288 } | |
2289 | |
2290 bool ServerContext::ExpandResource(ExpandedResource& resource, | |
2291 const std::string& publicId, | |
2292 const std::string& instanceId, // optional: the id of an instance for the resource (if already available) | |
2293 const Json::Value& dicomAsJson, // optional: the dicom-as-json for the resource (if already available) | |
2294 ResourceType level, | |
2295 const std::set<DicomTag>& requestedTags) | |
2296 { | |
2297 if (GetIndex().ExpandResource(resource, publicId, level, requestedTags)) | |
2282 { | 2298 { |
2283 // check the main dicom tags list has not changed since the resource was stored | 2299 // check the main dicom tags list has not changed since the resource was stored |
2284 if (resource.mainDicomTagsSignature_ != DicomMap::GetMainDicomTagsSignature(resource.type_)) | 2300 if (resource.mainDicomTagsSignature_ != DicomMap::GetMainDicomTagsSignature(resource.type_)) |
2285 { | 2301 { |
2286 OrthancConfiguration::ReaderLock lock; | 2302 OrthancConfiguration::ReaderLock lock; |
2323 allTags.FromDicomAsJson(dicomAsJson_); | 2339 allTags.FromDicomAsJson(dicomAsJson_); |
2324 | 2340 |
2325 resource.tags_.Merge(allTags); | 2341 resource.tags_.Merge(allTags); |
2326 } | 2342 } |
2327 | 2343 |
2328 SerializeExpandedResource(target, resource, format, requestedTags); | |
2329 | |
2330 return true; | 2344 return true; |
2331 } | 2345 } |
2332 | 2346 |
2333 return false; | 2347 return false; |
2334 } | 2348 } |