列出匯入工作 - AWS HealthImaging

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

列出匯入工作

使用此ListDICOMImportJobs動作可列出針對特定 HealthImaging 資料倉庫建立的匯入工作。下列功能表提供的程序 AWS Management Console 和程式碼範例 AWS CLI 以及 AWS SDKs。如需詳細資訊,請參閱〈AWS HealthImaging API參考ListDICOMImportJobs中的〈〉。

注意

匯入工作會保留在工作清單中 90 天,然後封存。

列出匯入工作

根據您的存取偏好選擇選單AWS HealthImaging。

  1. 開啟 HealthImaging 主控台 [資料存放區] 頁面

  2. 選擇資料倉庫。

    資料倉庫詳細資訊頁面隨即開啟。依預設,會選取 [影像集] 索引標籤。

  3. 選擇「入」頁籤以列出所有相關聯的匯入工作。

CLI
AWS CLI

若要列出讀入工作

下列list-dicom-import-jobs程式碼範例會列出 dicom 匯入工作。

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

輸出:

{ "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" } ] }

如需詳細資訊,請參閱 AWS HealthImaging 開發人員指南

Java
SDK對於爪哇 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<>(); }
注意

還有更多關於 GitHub。尋找完整的範例,並瞭解如何設定和執行 AWS 代碼示例存儲庫

JavaScript
SDK對於 JavaScript (3)
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; };
注意

還有更多關於 GitHub。尋找完整的範例,並瞭解如何設定和執行 AWS 代碼示例存儲庫

Python
SDK對於 Python(肉毒桿菌 3)
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

下面的代碼實例化對 MedicalImagingWrapper 象。

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

還有更多關於 GitHub。尋找完整的範例,並瞭解如何設定和執行 AWS 代碼示例存儲庫