changeset 6009:1ddeb38049ea

Get SOPClassUID from metadata when available -> this fixes display of PDF files in Stone when StorageAccessOnFind is set to Never
author Alain Mazy <am@orthanc.team>
date Wed, 19 Feb 2025 15:36:55 +0100
parents 318f3234e9ed
children 89e2b1b7d283
files OrthancServer/Sources/ResourceFinder.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ResourceFinder.cpp	Tue Feb 18 17:35:27 2025 +0100
+++ b/OrthancServer/Sources/ResourceFinder.cpp	Wed Feb 19 15:36:55 2025 +0100
@@ -1148,6 +1148,14 @@
           Toolbox::RemoveSets(remainingRequestedTags, metaTagsToRemove);
         }
 
+        // if SOPClassUID has been requested, we might still find it at metadata level (useful e.g. for StoneViewer)
+        std::string sopClassUidFromMetadata;
+        if (resource.GetLevel() == ResourceType_Instance &&
+            remainingRequestedTags.find(DICOM_TAG_SOP_CLASS_UID) != remainingRequestedTags.end() && 
+            resource.LookupMetadata(sopClassUidFromMetadata, ResourceType_Instance, MetadataType_Instance_SopClassUid))
+        {
+          outRequestedTags.SetValue(DICOM_TAG_SOP_CLASS_UID, sopClassUidFromMetadata, false);
+        }
 
         if (!remainingRequestedTags.empty() && 
             !DicomMap::HasOnlyComputedTags(remainingRequestedTags)) // if the only remaining tags are computed tags, it is worthless to read them from disk