comparison Resources/Samples/Python/ArchiveStudiesInTimeRange.py @ 4089:a2060a76ed6a

note in ArchiveStudiesInTimeRange.py
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 Jun 2020 18:43:42 +0200
parents 94f4a18a79cc
children
comparison
equal deleted inserted replaced
4088:ce7709cb380e 4089:a2060a76ed6a
60 for studyId in RestToolbox.DoGet('%s/studies' % URL): 60 for studyId in RestToolbox.DoGet('%s/studies' % URL):
61 # Retrieve the DICOM tags of the current study 61 # Retrieve the DICOM tags of the current study
62 study = RestToolbox.DoGet('%s/studies/%s' % (URL, studyId))['MainDicomTags'] 62 study = RestToolbox.DoGet('%s/studies/%s' % (URL, studyId))['MainDicomTags']
63 63
64 # Retrieve the DICOM tags of the parent patient of this study 64 # Retrieve the DICOM tags of the parent patient of this study
65
66 # Case 1: Baseline version
65 patient = RestToolbox.DoGet('%s/studies/%s/patient' % (URL, studyId))['MainDicomTags'] 67 patient = RestToolbox.DoGet('%s/studies/%s/patient' % (URL, studyId))['MainDicomTags']
68
69 # Case 2: Tweaked version that can be used if several patients
70 # share the same "Patient ID", but have different "Patient Name"
71 # (which is invalid according to the DICOM standard).
72 # https://groups.google.com/d/msg/orthanc-users/58AxIkxFbZs/N6Knub8MAgAJ
73 # patient = RestToolbox.DoGet('%s/studies/%s' % (URL, studyId)) ['PatientMainDicomTags']
66 74
67 # Check that the StudyDate tag lies within the given range 75 # Check that the StudyDate tag lies within the given range
68 studyDate = study['StudyDate'][:8] 76 studyDate = study['StudyDate'][:8]
69 if studyDate >= START and studyDate <= END: 77 if studyDate >= START and studyDate <= END:
70 # Create a filename 78 # Create a filename