changeset 2322:dc7c8eebcc80

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jul 2017 10:37:50 +0200
parents 65ffba10cace (current diff) 09cce85735b9 (diff)
children f5fc61337bdf
files
diffstat 7 files changed, 64 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Jul 14 10:37:33 2017 +0200
+++ b/NEWS	Fri Jul 14 10:37:50 2017 +0200
@@ -22,11 +22,19 @@
 
 * Query/retrieve: Added button for "DR" modality
 
+Configuration file
+------------------
+* Manufacturer type MedInria is now obsolete
+  Manufacturer type AgfaImpax & SyngoVia are obsolete too, use GenericNoWildcardInDates instead
+  obsolete manufacturers are still accepted but might disappear in the future
+  added new manufacturer: GenericNoWidlcards to replace all '*' by '' in outgoing C-Find requests
+
 Maintenance
 -----------
 
 * Ability to retrieve raw frames encoded as unsigned 32-bits integers
 * Fix issue 29 (more consistent handling of the "--upgrade" argument)
+* Fix issue 31 (Create new modality types for Philips ADW, GE Xeleris, GE AWServer)
 * Fix issue 35 (AET name is not transferred to Orthanc using DCMTK 3.6.0)
 * Fix issue 44 (Bad interpretation of photometric interpretation MONOCHROME1)
 * Fix issue 45 (crash when providing a folder to "--config" command-line option)
--- a/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Fri Jul 14 10:37:33 2017 +0200
+++ b/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Fri Jul 14 10:37:50 2017 +0200
@@ -484,27 +484,29 @@
   static ParsedDicomFile* ConvertQueryFields(const DicomMap& fields,
                                              ModalityManufacturer manufacturer)
   {
+    // Fix outgoing C-Find requests
+    // issue for Syngo.Via and its solution was reported by
+    // Emsy Chan by private mail on 2015-06-17. According to
+    // Robert van Ommen (2015-11-30), the same fix is required for
+    // Agfa Impax.
+    // solutions was generalized for generic manufacturer since it seems to affect PhilipsADW, GEWAServer as well (check issue #31)
+
     switch (manufacturer)
     {
-      case ModalityManufacturer_AgfaImpax:
-      case ModalityManufacturer_SyngoVia:
+      case ModalityManufacturer_GenericNoWildcardInDates:
+      case ModalityManufacturer_GenericNoWildcards:
       {
         std::auto_ptr<DicomMap> fix(fields.Clone());
 
-        // This issue for Syngo.Via and its solution was reported by
-        // Emsy Chan by private mail on 2015-06-17. According to
-        // Robert van Ommen (2015-11-30), the same fix is required for
-        // Agfa Impax.
         std::set<DicomTag> tags;
         fix->GetTags(tags);
 
         for (std::set<DicomTag>::const_iterator it = tags.begin(); it != tags.end(); ++it)
         {
-          if (FromDcmtkBridge::LookupValueRepresentation(*it) == ValueRepresentation_Date)
+          // Replace a "*" query by an empty query ("") for "date" or "all" value representations depending on the manufacturer.
+          if ((manufacturer == ModalityManufacturer_GenericNoWildcards)
+              || (manufacturer == ModalityManufacturer_GenericNoWildcardInDates && FromDcmtkBridge::LookupValueRepresentation(*it) == ValueRepresentation_Date))
           {
-            // Replace a "*" query by an empty query ("") for "date"
-            // value representations. Necessary to search over dates
-            // in Syngo.Via.
             const DicomValue* value = fix->TestAndGetValue(*it);
 
             if (value != NULL && 
--- a/OrthancServer/OrthancFindRequestHandler.cpp	Fri Jul 14 10:37:33 2017 +0200
+++ b/OrthancServer/OrthancFindRequestHandler.cpp	Fri Jul 14 10:37:50 2017 +0200
@@ -451,19 +451,14 @@
                                                  const DicomTag& tag,
                                                  ModalityManufacturer manufacturer)
   {
+    // wathever the manufacturer, remote the GenericGroupLength tags (http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.2.html)
+    if (tag.GetGroup() == 0x0000)
+    {
+      return false;
+    }
+
     switch (manufacturer)
     {
-      case ModalityManufacturer_EFilm2:
-        // Following Denis Nesterov's mail on 2015-11-30
-        if (tag == DicomTag(0x0008, 0x0000) ||  // "GenericGroupLength"
-            tag == DicomTag(0x0010, 0x0000) ||  // "GenericGroupLength"
-            tag == DicomTag(0x0020, 0x0000))    // "GenericGroupLength"
-        {
-          return false;
-        }
-
-        break;
-
       case ModalityManufacturer_Vitrea:
         // Following Denis Nesterov's mail on 2015-11-30
         if (tag == DicomTag(0x5653, 0x0010))  // "PrivateCreator = Vital Images SW 3.4"
--- a/OrthancServer/ServerEnumerations.cpp	Fri Jul 14 10:37:33 2017 +0200
+++ b/OrthancServer/ServerEnumerations.cpp	Fri Jul 14 10:37:50 2017 +0200
@@ -325,27 +325,21 @@
       case ModalityManufacturer_Generic:
         return "Generic";
 
+      case ModalityManufacturer_GenericNoWildcardInDates:
+        return "GenericNoWildcardInDates";
+
+      case ModalityManufacturer_GenericNoWildcards:
+        return "GenericNoWildcards";
+
       case ModalityManufacturer_StoreScp:
         return "StoreScp";
       
       case ModalityManufacturer_ClearCanvas:
         return "ClearCanvas";
       
-      case ModalityManufacturer_MedInria:
-        return "MedInria";
-
       case ModalityManufacturer_Dcm4Chee:
         return "Dcm4Chee";
       
-      case ModalityManufacturer_SyngoVia:
-        return "SyngoVia";
-      
-      case ModalityManufacturer_AgfaImpax:
-        return "AgfaImpax";
-      
-      case ModalityManufacturer_EFilm2:
-        return "EFilm2";
-      
       case ModalityManufacturer_Vitrea:
         return "Vitrea";
       
@@ -392,6 +386,14 @@
     {
       return ModalityManufacturer_Generic;
     }
+    else if (manufacturer == "GenericNoWildcardInDates")
+    {
+      return ModalityManufacturer_GenericNoWildcardInDates;
+    }
+    else if (manufacturer == "GenericNoWildcards")
+    {
+      return ModalityManufacturer_GenericNoWildcards;
+    }
     else if (manufacturer == "ClearCanvas")
     {
       return ModalityManufacturer_ClearCanvas;
@@ -400,29 +402,24 @@
     {
       return ModalityManufacturer_StoreScp;
     }
-    else if (manufacturer == "MedInria")
-    {
-      return ModalityManufacturer_MedInria;
-    }
     else if (manufacturer == "Dcm4Chee")
     {
       return ModalityManufacturer_Dcm4Chee;
     }
-    else if (manufacturer == "SyngoVia")
-    {
-      return ModalityManufacturer_SyngoVia;
-    }
-    else if (manufacturer == "AgfaImpax")
-    {
-      return ModalityManufacturer_AgfaImpax;
-    }
     else if (manufacturer == "Vitrea")
     {
       return ModalityManufacturer_Vitrea;
     }
-    else if (manufacturer == "EFilm2")
+    else if (manufacturer == "AgfaImpax" || manufacturer == "SyngoVia")
     {
-      return ModalityManufacturer_EFilm2;
+      LOG(WARNING) << "The " << manufacturer << " manufacturer is obsolete since Orthanc 1.2.1.  To guarantee compatibility with future Orthanc version, you should use \"GenericNoWildcardInDates\" instead in your configuration file.";
+      return ModalityManufacturer_GenericNoWildcardInDates;
+    }
+    else if (manufacturer == "EFilm2" || manufacturer == "MedInria")
+    {
+      LOG(WARNING) << "The " << manufacturer << " manufacturer is obsolete since Orthanc 1.2.1.  To guarantee compatibility with future Orthanc version, you should remove it from your configuration file.";
+
+      return ModalityManufacturer_Generic;
     }
     else
     {
--- a/OrthancServer/ServerEnumerations.h	Fri Jul 14 10:37:33 2017 +0200
+++ b/OrthancServer/ServerEnumerations.h	Fri Jul 14 10:37:50 2017 +0200
@@ -59,13 +59,11 @@
   enum ModalityManufacturer
   {
     ModalityManufacturer_Generic,
+    ModalityManufacturer_GenericNoWildcardInDates,
+    ModalityManufacturer_GenericNoWildcards,
     ModalityManufacturer_StoreScp,
     ModalityManufacturer_ClearCanvas,
-    ModalityManufacturer_MedInria,
     ModalityManufacturer_Dcm4Chee,
-    ModalityManufacturer_SyngoVia,
-    ModalityManufacturer_AgfaImpax,
-    ModalityManufacturer_EFilm2,
     ModalityManufacturer_Vitrea
   };
 
--- a/Resources/Configuration.json	Fri Jul 14 10:37:33 2017 +0200
+++ b/Resources/Configuration.json	Fri Jul 14 10:37:50 2017 +0200
@@ -158,10 +158,12 @@
     /**
      * A fourth parameter is available to enable patches for a
      * specific PACS manufacturer. The allowed values are currently
-     * "Generic" (default value), "StoreScp" (storescp tool from
-     * DCMTK), "ClearCanvas", "MedInria", "Dcm4Chee", "SyngoVia",
-     * "AgfaImpax" (Agfa IMPAX), "EFilm2" (eFilm version 2), and
-     * "Vitrea". This parameter is case-sensitive.
+     * "Generic" (default value),
+     * "GenericNoWildcardInDates" (to replace '*' by '' in date fields in outgoing C-Find)
+     * "GenericNoWildcards" (to replace '*' by '' in all fields in outgoing C-Find)
+     * "StoreScp" (storescp tool from DCMTK),
+     * "ClearCanvas", "Dcm4Chee" and "Vitrea".
+     * This parameter is case-sensitive.
      **/
     // "clearcanvas" : [ "CLEARCANVAS", "192.168.1.1", 104, "ClearCanvas" ]
   },
--- a/UnitTestsSources/UnitTestsMain.cpp	Fri Jul 14 10:37:33 2017 +0200
+++ b/UnitTestsSources/UnitTestsMain.cpp	Fri Jul 14 10:37:50 2017 +0200
@@ -527,14 +527,17 @@
   ASSERT_EQ(2047, StringToMetadata("Ceci est un test"));
 
   ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("Generic")));
+  ASSERT_STREQ("GenericNoWildcardInDates", EnumerationToString(StringToModalityManufacturer("GenericNoWildcardInDates")));
+  ASSERT_STREQ("GenericNoWildcards", EnumerationToString(StringToModalityManufacturer("GenericNoWildcards")));
   ASSERT_STREQ("StoreScp", EnumerationToString(StringToModalityManufacturer("StoreScp")));
   ASSERT_STREQ("ClearCanvas", EnumerationToString(StringToModalityManufacturer("ClearCanvas")));
-  ASSERT_STREQ("MedInria", EnumerationToString(StringToModalityManufacturer("MedInria")));
   ASSERT_STREQ("Dcm4Chee", EnumerationToString(StringToModalityManufacturer("Dcm4Chee")));
-  ASSERT_STREQ("SyngoVia", EnumerationToString(StringToModalityManufacturer("SyngoVia")));
-  ASSERT_STREQ("AgfaImpax", EnumerationToString(StringToModalityManufacturer("AgfaImpax")));
-  ASSERT_STREQ("EFilm2", EnumerationToString(StringToModalityManufacturer("EFilm2")));
   ASSERT_STREQ("Vitrea", EnumerationToString(StringToModalityManufacturer("Vitrea")));
+  // backward compatibility tests (to remove once we make these manufacturer really obsolete)
+  ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("MedInria")));
+  ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("EFilm2")));
+  ASSERT_STREQ("GenericNoWildcardInDates", EnumerationToString(StringToModalityManufacturer("SyngoVia")));
+  ASSERT_STREQ("GenericNoWildcardInDates", EnumerationToString(StringToModalityManufacturer("AgfaImpax")));
 }