8000 Change retrieve study output file to use .multipart extension (#2345) · hanv89/python-docs-samples@41161fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 41161fb

Browse files
noeroggguuss
authored andcommitted
Change retrieve study output file to use .multipart extension (GoogleCloudPlatform#2345)
1 parent a02fa46 commit 41161fb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

healthcare/api-client/dicom/dicomweb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def dicomweb_retrieve_study(
131131
dicomweb_path = '{}/datasets/{}/dicomStores/{}/dicomWeb/studies/{}'.format(
132132
url, dataset_id, dicom_store_id, study_uid)
133133

134-
file_name = 'study.dcm'
134+
# When specifying the output file, use an extension like ".multipart."
135+
# Then, parse the downloaded multipart file to get each individual
136+
# DICOM file.
137+
file_name = 'study.multipart'
135138

136139
# Make an authenticated API request
137140
session = get_session(service_account_json)

healthcare/api-client/dicom/dicomweb_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,15 @@ def test_dicomweb_retrieve_study(test_dataset, test_dicom_store, capsys):
159159
study_uid)
160160

161161
# Assert study was downloaded
162-
assert os.path.isfile('study.dcm')
162+
assert os.path.isfile('study.multipart')
163163

164164
out, _ = capsys.readouterr()
165165

166166
# Check that retrieve study worked
167167
assert 'Retrieved study' in out
168168

169169
# Delete downloaded study
170-
os.remove('study.dcm')
170+
os.remove('study.multipart')
171171

172172
dicomweb.dicomweb_delete_study(
173173
service_account_json,

0 commit comments

Comments
 (0)
0