comparison OrthancServer/Sources/ResourceFinder.cpp @ 5610:d4b570834d3a find-refactoring

adding safeguards around FindRequest::SetRetrieveOneInstanceIdentifier()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 09 May 2024 10:36:03 +0200
parents 4690a0d2b01e
children 599ce5ed126c
comparison
equal deleted inserted replaced
5609:4690a0d2b01e 5610:d4b570834d3a
447 } 447 }
448 } 448 }
449 else 449 else
450 { 450 {
451 // This is not a main DICOM tag: We will be forced to access the DICOM file anyway 451 // This is not a main DICOM tag: We will be forced to access the DICOM file anyway
452 request_.SetRetrieveOneInstanceIdentifier(true);
453 requestedTagsFromFileStorage_.insert(tag); 452 requestedTagsFromFileStorage_.insert(tag);
453
454 if (request_.GetLevel() != ResourceType_Instance)
455 {
456 request_.SetRetrieveOneInstanceIdentifier(true);
457 }
454 } 458 }
455 459
456 hasRequestedTags_ = true; 460 hasRequestedTags_ = true;
457 } 461 }
458 462
507 std::string instancePublicId; 511 std::string instancePublicId;
508 512
509 if (request_.IsRetrieveOneInstanceIdentifier()) 513 if (request_.IsRetrieveOneInstanceIdentifier())
510 { 514 {
511 instancePublicId = resource.GetOneInstanceIdentifier(); 515 instancePublicId = resource.GetOneInstanceIdentifier();
516 }
517 else if (request_.GetLevel() == ResourceType_Instance)
518 {
519 instancePublicId = resource.GetIdentifier();
512 } 520 }
513 else 521 else
514 { 522 {
515 FindRequest requestDicomAttachment(request_.GetLevel()); 523 FindRequest requestDicomAttachment(request_.GetLevel());
516 requestDicomAttachment.SetOrthancId(request_.GetLevel(), resource.GetIdentifier()); 524 requestDicomAttachment.SetOrthancId(request_.GetLevel(), resource.GetIdentifier());