Skip to content

Change retrieve study output file to use .multipart extension #2345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion healthcare/api-client/dicom/dicomweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def dicomweb_retrieve_study(
dicomweb_path = '{}/datasets/{}/dicomStores/{}/dicomWeb/studies/{}'.format(
url, dataset_id, dicom_store_id, study_uid)

file_name = 'study.dcm'
# When specifying the output file, use an extension like ".multipart."
# Then, parse the downloaded multipart file to get each individual
# DICOM file.
file_name = 'study.multipart'

# Make an authenticated API request
session = get_session(service_account_json)
Expand Down
4 changes: 2 additions & 2 deletions healthcare/api-client/dicom/dicomweb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ def test_dicomweb_retrieve_study(test_dataset, test_dicom_store, capsys):
study_uid)

# Assert study was downloaded
assert os.path.isfile('study.dcm')
assert os.path.isfile('study.multipart')

out, _ = capsys.readouterr()

# Check that retrieve study worked
assert 'Retrieved study' in out

# Delete downloaded study
os.remove('study.dcm')
os.remove('study.multipart')

dicomweb.dicomweb_delete_study(
service_account_json,
Expand Down