changeset 3107:554832246eaa

Fix issue #124 (GET /studies/ID/media fails for certain dicom file)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Jan 2019 20:55:28 +0100
parents b311cff247ca
children 55dacaf139ed
files Core/DicomParsing/DicomDirWriter.cpp NEWS
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomParsing/DicomDirWriter.cpp	Thu Jan 10 11:19:39 2019 +0100
+++ b/Core/DicomParsing/DicomDirWriter.cpp	Thu Jan 10 20:55:28 2019 +0100
@@ -410,7 +410,14 @@
       switch (level)
       {
         case ResourceType_Patient:
-          found = GetUtf8TagValue(id, dataset, encoding, DCM_PatientID);
+          if (!GetUtf8TagValue(id, dataset, encoding, DCM_PatientID))
+          {
+            // Be tolerant about missing patient ID. Fixes issue #124
+            // (GET /studies/ID/media fails for certain dicom file).
+            id = "";
+          }
+
+          found = true;
           type = ERT_Patient;
           break;
 
--- a/NEWS	Thu Jan 10 11:19:39 2019 +0100
+++ b/NEWS	Thu Jan 10 20:55:28 2019 +0100
@@ -5,6 +5,7 @@
 -----------
 
 * 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"
   and it's therefore impossible to browse the content.
 * Upgraded dependencies for static and Windows builds: