Skip to content

Commit 6e8acab

Browse files
author
Tejas Ganesh Naik
committed
making lint fixes in jsv3 and python
1 parent 7ca3641 commit 6e8acab

File tree

2 files changed

+42
-30
lines changed

2 files changed

+42
-30
lines changed

javascriptv3/example_code/medical-imaging/actions/start-dicom-import-job.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,20 @@ export const startDicomImportJob = async (
4444
}),
4545
);
4646
console.log(response);
47-
// {// '$metadata': {// httpStatusCode: 200,// requestId: '6e81d191-d46b-4e48-a08a-cdcc7e11eb79',// extendedRequestId: undefined,// cfId: undefined,// attempts: 1,// totalRetryDelay: 0// },// datastoreId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',// jobId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',// jobStatus: 'SUBMITTED',// submittedAt: 2023-09-22T14:48:45.767Z// }
47+
// {
48+
// '$metadata': {
49+
// httpStatusCode: 200,
50+
// requestId: '6e81d191-d46b-4e48-a08a-cdcc7e11eb79',
51+
// extendedRequestId: undefined,
52+
// cfId: undefined,
53+
// attempts: 1,
54+
// totalRetryDelay: 0
55+
// },
56+
// datastoreId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
57+
// jobId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
58+
// jobStatus: 'SUBMITTED',
59+
// submittedAt: 2023-09-22T14:48:45.767Z
60+
// }
4861
return response;
4962
};
5063
// snippet-end:[medical-imaging.JavaScript.dicom.startDicomImportJobV3]

python/example_code/medical-imaging/medical_imaging_basics.py

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -125,35 +125,34 @@ def delete_datastore(self, datastore_id):
125125
def start_dicom_import_job(
126126
self, job_name, datastore_id, role_arn, input_s3_uri, output_s3_uri, import_configuration
127127
):
128-
"""
129-
Start a DICOM import job.
130-
131-
:param job_name: The name of the job.
132-
:param datastore_id: The ID of the data store.
133-
:param role_arn: The Amazon Resource Name (ARN) of the role to use for the job.
134-
:param input_s3_uri: The S3 bucket input prefix path containing the DICOM files.
135-
:param output_s3_uri: The S3 bucket output prefix path for the result.
136-
:return: The job ID.
137-
"""
138-
try:
139-
job = self.health_imaging_client.start_dicom_import_job(
140-
jobName=job_name,
141-
datastoreId=datastore_id,
142-
dataAccessRoleArn=role_arn,
143-
inputS3Uri=input_s3_uri,
144-
outputS3Uri=output_s3_uri,
145-
importConfiguration=import_configuration
146-
)
147-
except ClientError as err:
148-
logger.error(
149-
"Couldn't start DICOM import job. Here's why: %s: %s",
150-
err.response["Error"]["Code"],
151-
err.response["Error"]["Message"],
152-
)
153-
raise
154-
else:
155-
return job["jobId"]
128+
"""
129+
Start a DICOM import job.
156130
131+
:param job_name: The name of the job.
132+
:param datastore_id: The ID of the data store.
133+
:param role_arn: The Amazon Resource Name (ARN) of the role to use for the job.
134+
:param input_s3_uri: The S3 bucket input prefix path containing the DICOM files.
135+
:param output_s3_uri: The S3 bucket output prefix path for the result.
136+
:return: The job ID.
137+
"""
138+
try:
139+
job = self.health_imaging_client.start_dicom_import_job(
140+
jobName=job_name,
141+
datastoreId=datastore_id,
142+
dataAccessRoleArn=role_arn,
143+
inputS3Uri=input_s3_uri,
144+
outputS3Uri=output_s3_uri,
145+
importConfiguration=import_configuration
146+
)
147+
except ClientError as err:
148+
logger.error(
149+
"Couldn't start DICOM import job. Here's why: %s: %s",
150+
err.response["Error"]["Code"],
151+
err.response["Error"]["Message"],
152+
)
153+
raise
154+
else:
155+
return job["jobId"]
157156
# snippet-end:[python.example_code.medical-imaging.StartDICOMImportJob]
158157

159158
# snippet-start:[python.example_code.medical-imaging.GetDICOMImportJob]
@@ -711,7 +710,7 @@ def usage_demo(self, source_s3_uri, dest_s3_uri, data_access_role_arn):
711710

712711
job_name = "python_usage_demo_job"
713712
job_id = self.start_dicom_import_job(
714-
job_name, data_store_id, data_access_role_arn, source_s3_uri, dest_s3_uri
713+
job_name, data_store_id, data_access_role_arn, source_s3_uri, dest_s3_uri, import_configuration
715714
)
716715
print(f"Started import job with id: {job_id}")
717716

0 commit comments

Comments
 (0)