changeset 2093:9e0712846be6

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Oct 2016 16:29:22 +0200
parents 50dd3249732e (current diff) a51014b3251c (diff)
children 72a7624215ae
files
diffstat 2 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Oct 05 16:29:00 2016 +0200
+++ b/NEWS	Wed Oct 05 16:29:22 2016 +0200
@@ -19,6 +19,7 @@
 * Fix serious performance issue with C-FIND
 * Fix extraction of the symbolic name of the private tags
 * Performance warning if runtime debug assertions are turned on
+* Improved robustness against files with no PatientID
 
 
 Version 1.1.0 (2016/06/27)
--- a/OrthancServer/ServerIndex.cpp	Wed Oct 05 16:29:00 2016 +0200
+++ b/OrthancServer/ServerIndex.cpp	Wed Oct 05 16:29:22 2016 +0200
@@ -1214,22 +1214,34 @@
       switch (currentType)
       {
         case ResourceType_Patient:
-          patientId = map.GetValue(DICOM_TAG_PATIENT_ID).GetContent();
+          if (map.HasTag(DICOM_TAG_PATIENT_ID))
+          {
+            patientId = map.GetValue(DICOM_TAG_PATIENT_ID).GetContent();
+          }
           done = true;
           break;
 
         case ResourceType_Study:
-          studyInstanceUid = map.GetValue(DICOM_TAG_STUDY_INSTANCE_UID).GetContent();
+          if (map.HasTag(DICOM_TAG_STUDY_INSTANCE_UID))
+          {
+            studyInstanceUid = map.GetValue(DICOM_TAG_STUDY_INSTANCE_UID).GetContent();
+          }
           currentType = ResourceType_Patient;
           break;
 
         case ResourceType_Series:
-          seriesInstanceUid = map.GetValue(DICOM_TAG_SERIES_INSTANCE_UID).GetContent();
+          if (map.HasTag(DICOM_TAG_SERIES_INSTANCE_UID))
+          {
+            seriesInstanceUid = map.GetValue(DICOM_TAG_SERIES_INSTANCE_UID).GetContent();
+          }
           currentType = ResourceType_Study;
           break;
 
         case ResourceType_Instance:
-          sopInstanceUid = map.GetValue(DICOM_TAG_SOP_INSTANCE_UID).GetContent();
+          if (map.HasTag(DICOM_TAG_SOP_INSTANCE_UID))
+          {
+            sopInstanceUid = map.GetValue(DICOM_TAG_SOP_INSTANCE_UID).GetContent();
+          }
           currentType = ResourceType_Series;
           break;