diff OrthancServer/OrthancInitialization.cpp @ 2115:a657f7772e69

Handling of private tags/creators in the "Dictionary" configuration option
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 31 Oct 2016 15:23:32 +0100
parents bcbc9137a535
children bb199bccdc45
line wrap: on
line diff
--- a/OrthancServer/OrthancInitialization.cpp	Thu Oct 27 12:37:30 2016 +0200
+++ b/OrthancServer/OrthancInitialization.cpp	Mon Oct 31 15:23:32 2016 +0100
@@ -394,11 +394,12 @@
       const Json::Value& content = configuration["Dictionary"][tags[i]];
       if (content.type() != Json::arrayValue ||
           content.size() < 2 ||
-          content.size() > 4 ||
+          content.size() > 5 ||
           content[0].type() != Json::stringValue ||
           content[1].type() != Json::stringValue ||
           (content.size() >= 3 && content[2].type() != Json::intValue) ||
-          (content.size() >= 4 && content[3].type() != Json::intValue))
+          (content.size() >= 4 && content[3].type() != Json::intValue) ||
+          (content.size() >= 5 && content[4].type() != Json::stringValue))
       {
         throw OrthancException(ErrorCode_BadFileFormat);
       }
@@ -408,8 +409,9 @@
       std::string name = content[1].asString();
       unsigned int minMultiplicity = (content.size() >= 2) ? content[2].asUInt() : 1;
       unsigned int maxMultiplicity = (content.size() >= 3) ? content[3].asUInt() : 1;
+      std::string privateCreator = (content.size() >= 4) ? content[4].asString() : "";
 
-      FromDcmtkBridge::RegisterDictionaryTag(tag, vr, name, minMultiplicity, maxMultiplicity);
+      FromDcmtkBridge::RegisterDictionaryTag(tag, vr, name, minMultiplicity, maxMultiplicity, privateCreator);
     }
   }