From 01e15636fd4f08aa6150216b52b2328afcf24906 Mon Sep 17 00:00:00 2001 From: Benedict Noero Date: Fri, 16 Aug 2019 14:50:11 -0400 Subject: [PATCH] Change retrieve study output file to use .multipart extension --- healthcare/api-client/dicom/dicomweb.py | 5 ++++- healthcare/api-client/dicom/dicomweb_test.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/healthcare/api-client/dicom/dicomweb.py b/healthcare/api-client/dicom/dicomweb.py index 0a3e08eca86..4a0224722b5 100644 --- a/healthcare/api-client/dicom/dicomweb.py +++ b/healthcare/api-client/dicom/dicomweb.py @@ -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) diff --git a/healthcare/api-client/dicom/dicomweb_test.py b/healthcare/api-client/dicom/dicomweb_test.py index ff76d37bd1c..1f7d99f9e2e 100644 --- a/healthcare/api-client/dicom/dicomweb_test.py +++ b/healthcare/api-client/dicom/dicomweb_test.py @@ -159,7 +159,7 @@ 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() @@ -167,7 +167,7 @@ def test_dicomweb_retrieve_study(test_dataset, test_dicom_store, capsys): assert 'Retrieved study' in out # Delete downloaded study - os.remove('study.dcm') + os.remove('study.multipart') dicomweb.dicomweb_delete_study( service_account_json,