diff OrthancServer/OrthancInitialization.cpp @ 519:1b2cdc855bd3

Parameter for PACS manufacturer, support for ClearCanvas
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Aug 2013 13:39:42 +0200
parents bdbde1fbfab3
children 60d90e48e809
line wrap: on
line diff
--- a/OrthancServer/OrthancInitialization.cpp	Mon Aug 19 14:47:03 2013 +0200
+++ b/OrthancServer/OrthancInitialization.cpp	Tue Aug 20 13:39:42 2013 +0200
@@ -230,7 +230,8 @@
   void GetDicomModality(const std::string& name,
                         std::string& aet,
                         std::string& address,
-                        int& port)
+                        int& port,
+                        ModalityManufacturer& manufacturer)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -241,7 +242,8 @@
 
     const Json::Value& modalities = (*configuration_) ["DicomModalities"];
     if (modalities.type() != Json::objectValue ||
-        !modalities.isMember(name))
+        !modalities.isMember(name) ||
+        (modalities[name].size() != 3 && modalities[name].size() != 4))
     {
       throw OrthancException("");
     }
@@ -251,6 +253,15 @@
       aet = modalities[name].get(0u, "").asString();
       address = modalities[name].get(1u, "").asString();
       port = modalities[name].get(2u, "").asInt();
+
+      if (modalities[name].size() == 4)
+      {
+        manufacturer = StringToModalityManufacturer(modalities[name].get(3u, "").asString());
+      }
+      else
+      {
+        manufacturer = ModalityManufacturer_Generic;
+      }
     }
     catch (...)
     {