changeset 1017:9d0c7301596e lua-scripting

storescp modality
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Jul 2014 10:43:47 +0200
parents 52e71b25f9ce
children 564e39d6df13
files OrthancServer/DicomProtocol/DicomUserConnection.cpp OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp OrthancServer/ServerEnumerations.cpp OrthancServer/ServerEnumerations.h Resources/Configuration.json
diffstat 5 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Thu Jul 10 09:48:38 2014 +0200
+++ b/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Thu Jul 10 10:43:47 2014 +0200
@@ -154,7 +154,8 @@
   {
     if (cond.bad())
     {
-      throw OrthancException("DicomUserConnection: " + std::string(cond.text()));
+      LOG(ERROR) << "DicomUserConnection: " << std::string(cond.text());
+       throw OrthancException(ErrorCode_NetworkProtocol);
     }
   }
 
@@ -162,7 +163,8 @@
   {
     if (!IsOpen())
     {
-      throw OrthancException("DicomUserConnection: First open the connection");
+      LOG(ERROR) << "DicomUserConnection: First open the connection";
+      throw OrthancException(ErrorCode_NetworkProtocol);
     }
   }
 
--- a/OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp	Thu Jul 10 09:48:38 2014 +0200
+++ b/OrthancServer/DicomProtocol/ReusableDicomUserConnection.cpp	Thu Jul 10 10:43:47 2014 +0200
@@ -172,6 +172,14 @@
 
   void ReusableDicomUserConnection::Unlock()
   {
+    if (connection_ != NULL &&
+        connection_->GetDistantManufacturer() == ModalityManufacturer_StoreScp)
+    {
+      // "storescp" from DCMTK has problems when reusing a
+      // connection. Always close.
+      Close();
+    }
+
     lastUse_ = Now();
     mutex_.unlock();
   }
--- a/OrthancServer/ServerEnumerations.cpp	Thu Jul 10 09:48:38 2014 +0200
+++ b/OrthancServer/ServerEnumerations.cpp	Thu Jul 10 10:43:47 2014 +0200
@@ -279,6 +279,9 @@
       case ModalityManufacturer_Generic:
         return "Generic";
 
+      case ModalityManufacturer_StoreScp:
+        return "StoreScp";
+      
       case ModalityManufacturer_ClearCanvas:
         return "ClearCanvas";
       
@@ -336,6 +339,10 @@
     {
       return ModalityManufacturer_ClearCanvas;
     }
+    else if (manufacturer == "StoreScp")
+    {
+      return ModalityManufacturer_StoreScp;
+    }
     else if (manufacturer == "MedInria")
     {
       return ModalityManufacturer_MedInria;
--- a/OrthancServer/ServerEnumerations.h	Thu Jul 10 09:48:38 2014 +0200
+++ b/OrthancServer/ServerEnumerations.h	Thu Jul 10 10:43:47 2014 +0200
@@ -57,6 +57,7 @@
   enum ModalityManufacturer
   {
     ModalityManufacturer_Generic,
+    ModalityManufacturer_StoreScp,
     ModalityManufacturer_ClearCanvas,
     ModalityManufacturer_MedInria,
     ModalityManufacturer_Dcm4Chee
--- a/Resources/Configuration.json	Thu Jul 10 09:48:38 2014 +0200
+++ b/Resources/Configuration.json	Thu Jul 10 10:43:47 2014 +0200
@@ -100,8 +100,9 @@
     /**
      * A fourth parameter is available to enable patches for a
      * specific PACS manufacturer. The allowed values are currently
-     * "Generic" (default value), "ClearCanvas", "MedInria" and
-     * "Dcm4Chee". This parameter is case-sensitive.
+     * "Generic" (default value), "StoreScp" (storescp tool from
+     * DCMTK), "ClearCanvas", "MedInria" and "Dcm4Chee". This
+     * parameter is case-sensitive.
      **/
     // "clearcanvas" : [ "CLEARCANVAS", "192.168.1.1", 104, "ClearCanvas" ]
   },