Mercurial > hg > orthanc
comparison OrthancServer/Resources/Samples/Python/ArchiveStudiesInTimeRange.py @ 4090:160ec8417874 framework
integration mainline->framework
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 29 Jun 2020 19:33:22 +0200 |
parents | Resources/Samples/Python/ArchiveStudiesInTimeRange.py@a2060a76ed6a Resources/Samples/Python/ArchiveStudiesInTimeRange.py@d25f4c0fa160 |
children | d9473bd5ed43 |
comparison
equal
deleted
inserted
replaced
4087:dcf4d83374a6 | 4090:160ec8417874 |
---|---|
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 |