Listing import jobs - AWS HealthImaging

Listing import jobs

Use the ListDICOMImportJobs action to list import jobs created for a specific HealthImaging data store. The following menus provide a procedure for the AWS Management Console and code examples for the AWS CLI and AWS SDKs. For more information, see ListDICOMImportJobs in the AWS HealthImaging API Reference.

Note

Import jobs are retained in the list of jobs for 90 days and then archived.

To list import jobs

Choose a menu based on your access preference to AWS HealthImaging.

  1. Open the HealthImaging console Data stores page.

  2. Choose a data store.

    The Data store details page opens. The Image sets tab is selected by default.

  3. Choose the Imports tab to list all associated import jobs.

CLI
AWS CLI

To list dicom import jobs

The following list-dicom-import-jobs code example lists dicom import jobs.

aws medical-imaging list-dicom-import-jobs \ --datastore-id "12345678901234567890123456789012"

Output:

{ "jobSummaries": [ { "jobId": "09876543210987654321098765432109", "jobName": "my-job", "jobStatus": "COMPLETED", "datastoreId": "12345678901234567890123456789012", "dataAccessRoleArn": "arn:aws:iam::123456789012:role/ImportJobDataAccessRole", "endedAt": "2022-08-12T11:21:56.504000+00:00", "submittedAt": "2022-08-12T11:20:21.734000+00:00" } ] }

Java
SDK for Java 2.x
public static List<DICOMImportJobSummary> listDicomImportJobs(MedicalImagingClient medicalImagingClient, String datastoreId) { try { ListDicomImportJobsRequest listDicomImportJobsRequest = ListDicomImportJobsRequest.builder() .datastoreId(datastoreId) .build(); ListDicomImportJobsResponse response = medicalImagingClient.listDICOMImportJobs(listDicomImportJobsRequest); return response.jobSummaries(); } catch (MedicalImagingException e) { System.err.println(e.awsErrorDetails().errorMessage()); System.exit(1); } return new ArrayList<>(); }
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

JavaScript
SDK for JavaScript (v3)
import { paginateListDICOMImportJobs } from "@aws-sdk/client-medical-imaging"; import { medicalImagingClient } from "../libs/medicalImagingClient.js"; /** * @param {string} datastoreId - The ID of the data store. */ export const listDICOMImportJobs = async ( datastoreId = "xxxxxxxxxxxxxxxxxx" ) => { const paginatorConfig = { client: medicalImagingClient, pageSize: 50, }; const commandParams = { datastoreId: datastoreId }; const paginator = paginateListDICOMImportJobs(paginatorConfig, commandParams); let jobSummaries = []; for await (const page of paginator) { // Each page contains a list of `jobSummaries`. The list is truncated if is larger than `pageSize`. jobSummaries.push(...page["jobSummaries"]); console.log(page); } // { // '$metadata': { // httpStatusCode: 200, // requestId: '3c20c66e-0797-446a-a1d8-91b742fd15a0', // extendedRequestId: undefined, // cfId: undefined, // attempts: 1, // totalRetryDelay: 0 // }, // jobSummaries: [ // { // dataAccessRoleArn: 'arn:aws:iam::xxxxxxxxxxxx:role/dicom_import', // datastoreId: 'xxxxxxxxxxxxxxxxxxxxxxxxx', // endedAt: 2023-09-22T14:49:51.351Z, // jobId: 'xxxxxxxxxxxxxxxxxxxxxxxxx', // jobName: 'test-1', // jobStatus: 'COMPLETED', // submittedAt: 2023-09-22T14:48:45.767Z // } // ]} return jobSummaries; };
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

Python
SDK for Python (Boto3)
class MedicalImagingWrapper: def __init__(self, health_imaging_client): self.health_imaging_client = health_imaging_client def list_dicom_import_jobs(self, datastore_id): """ List the DICOM import jobs. :param datastore_id: The ID of the data store. :return: The list of jobs. """ try: paginator = self.health_imaging_client.get_paginator( "list_dicom_import_jobs" ) page_iterator = paginator.paginate(datastoreId=datastore_id) job_summaries = [] for page in page_iterator: job_summaries.extend(page["jobSummaries"]) except ClientError as err: logger.error( "Couldn't list DICOM import jobs. Here's why: %s: %s", err.response["Error"]["Code"], err.response["Error"]["Message"], ) raise else: return job_summaries

The following code instantiates the MedicalImagingWrapper object.

client = boto3.client("medical-imaging") medical_imaging_wrapper = MedicalImagingWrapper(client)
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

Example availability

Can't find what you need? Request a code example using the Provide feedback link at the bottom of this page.