changeset 4450:9bf2f9e0af47

support empty PatientID in OrthancImport.py
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 14 Jan 2021 09:13:29 +0100
parents 6a6017027162
children f4dbdb2dcba6
files OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py	Thu Jan 14 08:50:48 2021 +0100
+++ b/OrthancServer/Resources/Samples/ImportDicomFiles/OrthancImport.py	Thu Jan 14 09:13:29 2021 +0100
@@ -107,8 +107,10 @@
         print('New imported study:')
         print('  Orthanc ID of the patient: %s' % info['ParentPatient'])
         print('  Orthanc ID of the study: %s' % info['ParentStudy'])
-        print('  DICOM Patient ID: %s' % tags['0010,0020'])
-        print('  DICOM Study Instance UID: %s' % tags['0020,000d'])
+        print('  DICOM Patient ID: %s' % (
+            tags['0010,0020'] if '0010,0020' in tags else '(empty)'))
+        print('  DICOM Study Instance UID: %s' % (
+            tags['0020,000d'] if '0020,000d' in tags else '(empty)'))
         print('')