changeset 5766:3915736c40a5 find-refactoring

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Sep 2024 16:14:34 +0200
parents 247fc5368693 (current diff) db4bd2f9e8d2 (diff)
children 23b5a090a64b
files
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ResourceFinder.cpp	Mon Sep 09 16:14:22 2024 +0200
+++ b/OrthancServer/Sources/ResourceFinder.cpp	Mon Sep 09 16:14:34 2024 +0200
@@ -839,6 +839,7 @@
 
       LOG(WARNING) << "W001: Accessing DICOM tags from storage when accessing "
                    << Orthanc::GetResourceTypeText(resource.GetLevel(), false, false)
+                   << " " << resource.GetIdentifier()
                    << ": " << missings;
     }
 
@@ -901,6 +902,13 @@
   void ResourceFinder::Execute(IVisitor& visitor,
                                ServerContext& context) const
   {
+    bool isWarning002Enabled = false;
+
+    {
+      OrthancConfiguration::ReaderLock lock;
+      isWarning002Enabled = lock.GetConfiguration().IsWarningEnabled(Warnings_002_InconsistentDicomTagsInDb);
+    }
+
     FindResponse response;
     context.GetIndex().ExecuteFind(response, request_);
 
@@ -958,6 +966,19 @@
             ReadMissingTagsFromStorageArea(requestedTags, context, request_, resource, missingTags);
           }
         }
+
+        std::string mainDicomTagsSignature;
+        if (isWarning002Enabled &&
+            resource.LookupMetadata(mainDicomTagsSignature, resource.GetLevel(), MetadataType_MainDicomTagsSignature) &&
+            mainDicomTagsSignature != DicomMap::GetMainDicomTagsSignature(resource.GetLevel()))
+        {
+          LOG(WARNING) << "W002: " << Orthanc::GetResourceTypeText(resource.GetLevel(), false , false)
+                      << " has been stored with another version of Main Dicom Tags list, you should POST to /"
+                      << Orthanc::GetResourceTypeText(resource.GetLevel(), true, false)
+                      << "/" << resource.GetIdentifier()
+                      << "/reconstruct to update the list of tags saved in DB or run the Housekeeper plugin.  Some MainDicomTags might be missing from this answer.";
+        }
+
       }
 
       bool match = true;