diff Plugins/Engine/OrthancPlugins.cpp @ 3710:1c69af37d8ae storage-commitment

integration mainline->storage-commitment
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Feb 2020 13:27:16 +0100
parents 898903022836 1f4910999fe7
children 56f2397f027a
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPlugins.cpp	Thu Feb 27 17:06:45 2020 +0100
+++ b/Plugins/Engine/OrthancPlugins.cpp	Fri Feb 28 13:27:16 2020 +0100
@@ -3049,9 +3049,18 @@
     std::string dicom;
 
     {
+      // Fix issue 168 (Plugins can't read private tags from the
+      // configuration file)
+      // https://bitbucket.org/sjodogne/orthanc/issues/168/
+      std::string privateCreator;
+      {
+        OrthancConfiguration::ReaderLock lock;
+        privateCreator = lock.GetConfiguration().GetDefaultPrivateCreator();
+      }
+      
       std::auto_ptr<ParsedDicomFile> file
         (ParsedDicomFile::CreateFromJson(json, static_cast<DicomFromJsonFlags>(p.flags),
-                                         "" /* TODO - private creator */));
+                                         privateCreator));
 
       if (p.pixelData)
       {
@@ -3224,7 +3233,25 @@
     DcmTagKey tag2(tag.GetGroup(), tag.GetElement());
 
     DictionaryReadLocker locker;
-    const DcmDictEntry* entry = locker->findEntry(tag2, NULL);
+    const DcmDictEntry* entry = NULL;
+
+    if (tag.IsPrivate())
+    {
+      // Fix issue 168 (Plugins can't read private tags from the
+      // configuration file)
+      // https://bitbucket.org/sjodogne/orthanc/issues/168/
+      std::string privateCreator;
+      {
+        OrthancConfiguration::ReaderLock lock;
+        privateCreator = lock.GetConfiguration().GetDefaultPrivateCreator();
+      }
+
+      entry = locker->findEntry(tag2, privateCreator.c_str());
+    }
+    else
+    {
+      entry = locker->findEntry(tag2, NULL);
+    }
 
     if (entry == NULL)
     {