diff OrthancFramework/Sources/DicomFormat/DicomMap.cpp @ 4944:f377d5643538 more-tags

new Warnings configuration + InstanceAvailability tag
author Alain Mazy <am@osimis.io>
date Thu, 17 Mar 2022 17:03:59 +0100
parents 304514ce84ee
children c68265bf1f94
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp	Wed Mar 16 09:50:33 2022 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp	Thu Mar 17 17:03:59 2022 +0100
@@ -634,16 +634,28 @@
             IsMainDicomTag(tag, ResourceType_Instance));
   }
 
+  static bool IsGenericComputedTag(const DicomTag& tag)
+  {
+    return tag == DICOM_TAG_RETRIEVE_URL ||
+      tag == DICOM_TAG_RETRIEVE_AE_TITLE;
+  }
+
   bool DicomMap::IsComputedTag(const DicomTag& tag)
   {
     return (IsComputedTag(tag, ResourceType_Patient) ||
             IsComputedTag(tag, ResourceType_Study) ||
             IsComputedTag(tag, ResourceType_Series) ||
-            IsComputedTag(tag, ResourceType_Instance));
+            IsComputedTag(tag, ResourceType_Instance) ||
+            IsGenericComputedTag(tag));
   }
 
   bool DicomMap::IsComputedTag(const DicomTag& tag, ResourceType level)
   {
+    if (IsGenericComputedTag(tag))
+    {
+      return true;
+    }
+
     switch (level)
     {
       case ResourceType_Patient:
@@ -664,7 +676,9 @@
           tag == DICOM_TAG_NUMBER_OF_SERIES_RELATED_INSTANCES
         );
       case ResourceType_Instance:
-        return false;
+        return (
+          tag == DICOM_TAG_INSTANCE_AVAILABILITY
+        );
       default:
         throw OrthancException(ErrorCode_ParameterOutOfRange);
     }