changeset 3108:55dacaf139ed

Don't consider tags whose group is below 0x0008 in C-FIND SCP
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Jan 2019 21:23:31 +0100
parents 554832246eaa
children 6aa8d90aeee5
files Core/DicomNetworking/Internals/FindScp.cpp NEWS
diffstat 2 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomNetworking/Internals/FindScp.cpp	Thu Jan 10 20:55:28 2019 +0100
+++ b/Core/DicomNetworking/Internals/FindScp.cpp	Thu Jan 10 21:23:31 2019 +0100
@@ -166,6 +166,28 @@
     }
 
 
+    static void FixFindQuery(DicomMap& target,
+                             const DicomMap& source)
+    {
+      // "The definition of a Data Set in PS3.5 specifically excludes
+      // the range of groups below group 0008, and this includes in
+      // particular Meta Information Header elements such as Transfer
+      // Syntax UID (0002,0010)."
+      // http://dicom.nema.org/medical/dicom/current/output/chtml/part04/sect_C.4.html#sect_C.4.1.1.3
+      // https://groups.google.com/d/msg/orthanc-users/D3kpPuX8yV0/_zgHOzkMEQAJ
+
+      DicomArray a(source);
+
+      for (size_t i = 0; i < a.GetSize(); i++)
+      {
+        if (a.GetElement(i).GetTag().GetGroup() >= 0x0008)
+        {
+          target.SetValue(a.GetElement(i).GetTag(), a.GetElement(i).GetValue());
+        }
+      }
+    }
+
+
 
     void FindScpCallback(
       /* in */ 
@@ -255,7 +277,10 @@
               DicomMap input;
               FromDcmtkBridge::ExtractDicomSummary(input, *requestIdentifiers);
 
-              data.findHandler_->Handle(data.answers_, input, sequencesToReturn,
+              DicomMap filtered;
+              FixFindQuery(filtered, input);
+
+              data.findHandler_->Handle(data.answers_, filtered, sequencesToReturn,
                                         *data.remoteIp_, *data.remoteAet_,
                                         *data.calledAet_, modality.GetManufacturer());
               ok = true;
--- a/NEWS	Thu Jan 10 20:55:28 2019 +0100
+++ b/NEWS	Thu Jan 10 21:23:31 2019 +0100
@@ -4,6 +4,7 @@
 Maintenance
 -----------
 
+* Don't consider tags whose group is below 0x0008 in C-FIND SCP
 * Fix issue #118 (Wording in Configuration.json regarding SynchronousCMove)
 * Fix issue #124 (GET /studies/ID/media fails for certain dicom file)
 * Fixed Orthanc Explorer on IE and Firefox: Explorer always show "too many results"