diff 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
line wrap: on
line diff
--- a/OrthancServer/Sources/ResourceFinder.cpp	Wed May 08 18:28:36 2024 +0200
+++ b/OrthancServer/Sources/ResourceFinder.cpp	Thu May 09 10:36:03 2024 +0200
@@ -449,8 +449,12 @@
     else
     {
       // This is not a main DICOM tag: We will be forced to access the DICOM file anyway
-      request_.SetRetrieveOneInstanceIdentifier(true);
       requestedTagsFromFileStorage_.insert(tag);
+
+      if (request_.GetLevel() != ResourceType_Instance)
+      {
+        request_.SetRetrieveOneInstanceIdentifier(true);
+      }
     }
 
     hasRequestedTags_ = true;
@@ -510,6 +514,10 @@
           {
             instancePublicId = resource.GetOneInstanceIdentifier();
           }
+          else if (request_.GetLevel() == ResourceType_Instance)
+          {
+            instancePublicId = resource.GetIdentifier();
+          }
           else
           {
             FindRequest requestDicomAttachment(request_.GetLevel());