diff OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp @ 4505:97d103b57cd1

removed cached dicom summary from DicomInstanceToStore
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Feb 2021 12:07:03 +0100
parents d9473bd5ed43
children b4c58795f3a8
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Wed Feb 10 11:29:53 2021 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Wed Feb 10 12:07:03 2021 +0100
@@ -39,6 +39,7 @@
 #include "../../../OrthancFramework/Sources/Logging.h"
 #include "../../../OrthancFramework/Sources/MetricsRegistry.h"
 #include "../../../OrthancFramework/Sources/SerializationToolbox.h"
+#include "../OrthancConfiguration.h"
 #include "../ServerContext.h"
 
 #include <boost/algorithm/string/predicate.hpp>
@@ -69,9 +70,13 @@
   {
     SetupResourceAnswer(result, instanceId, ResourceType_Instance, status);
 
-    result["ParentPatient"] = instance.GetHasher().HashPatient();
-    result["ParentStudy"] = instance.GetHasher().HashStudy();
-    result["ParentSeries"] = instance.GetHasher().HashSeries();
+    DicomMap summary;
+    OrthancConfiguration::DefaultExtractDicomSummary(summary, instance.GetParsedDicomFile());
+
+    DicomInstanceHasher hasher(summary);
+    result["ParentPatient"] = hasher.HashPatient();
+    result["ParentStudy"] = hasher.HashStudy();
+    result["ParentSeries"] = hasher.HashSeries();
   }