comparison OrthancServer/Sources/ResourceFinder.cpp @ 5620:4bfd885fb45f find-refactoring

optimization as patient-level tags are copied at study level
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 11 May 2024 15:11:22 +0200
parents 1864b16bc7b1
children 732ec9feeea8
comparison
equal deleted inserted replaced
5619:1864b16bc7b1 5620:4bfd885fb45f
395 395
396 void ResourceFinder::AddRequestedTags(const DicomTag& tag) 396 void ResourceFinder::AddRequestedTags(const DicomTag& tag)
397 { 397 {
398 if (DicomMap::IsMainDicomTag(tag, ResourceType_Patient)) 398 if (DicomMap::IsMainDicomTag(tag, ResourceType_Patient))
399 { 399 {
400 request_.GetParentRetrieveSpecification(ResourceType_Patient).SetRetrieveMainDicomTags(true); 400 if (request_.GetLevel() == ResourceType_Patient)
401 request_.GetParentRetrieveSpecification(ResourceType_Patient).SetRetrieveMetadata(true); 401 {
402 requestedPatientTags_.insert(tag); 402 request_.GetParentRetrieveSpecification(ResourceType_Patient).SetRetrieveMainDicomTags(true);
403 request_.GetParentRetrieveSpecification(ResourceType_Patient).SetRetrieveMetadata(true);
404 requestedPatientTags_.insert(tag);
405 }
406 else
407 {
408 /**
409 * This comes from the fact that patient-level tags are copied
410 * at the study level, as implemented by "ResourcesContent::AddResource()".
411 **/
412 request_.GetParentRetrieveSpecification(ResourceType_Study).SetRetrieveMainDicomTags(true);
413 request_.GetParentRetrieveSpecification(ResourceType_Study).SetRetrieveMetadata(true);
414 requestedStudyTags_.insert(tag);
415 }
403 } 416 }
404 else if (DicomMap::IsMainDicomTag(tag, ResourceType_Study)) 417 else if (DicomMap::IsMainDicomTag(tag, ResourceType_Study))
405 { 418 {
406 if (request_.GetLevel() == ResourceType_Patient) 419 if (request_.GetLevel() == ResourceType_Patient)
407 { 420 {