データストアの作成 - AWS HealthImaging

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

データストアの作成

CreateDatastore アクションを使用して、DICOMP10 ファイルをインポートするためのAWS HealthImaging データストアを作成します。以下のメニューは、 の手順を示しています。 AWS Management Console と のコード例 AWS CLI また、 AWS SDKs。詳細については、「 AWS HealthImaging APIリファレンスCreateDatastore」の「」を参照してください。

[重要]

データストアには、保護対象の医療情報 (PHI)、個人を特定できる情報 (PII)、その他の機密情報や機密情報を名前付けしないでください。

データストアを作成するには

へのアクセス設定に基づいてメニューを選択しますAWS HealthImaging。

  1. HealthImaging コンソール「データストアの作成」ページを開きます。

  2. [詳細][データストア名] に、データストアの名前を入力します。

  3. データ暗号化 で、 を選択します。 AWS KMS リソースを暗号化するための キー。詳細については、「でのデータ保護 AWS HealthImaging」を参照してください。

  4. [タグ - オプション] では、データストアを作成するときに、データストアにタグを追加できます。詳細については、「リソースのタギング」を参照してください。

  5. [データストアの作成] を選択します。

Bash
AWS CLI Bash スクリプトを使用する
############################################################################### # function errecho # # This function outputs everything sent to it to STDERR (standard error output). ############################################################################### function errecho() { printf "%s\n" "$*" 1>&2 } ############################################################################### # function imaging_create_datastore # # This function creates an AWS HealthImaging data store for importing DICOM P10 files. # # Parameters: # -n data_store_name - The name of the data store. # # Returns: # The datastore ID. # And: # 0 - If successful. # 1 - If it fails. ############################################################################### function imaging_create_datastore() { local datastore_name response local option OPTARG # Required to use getopts command in a function. # bashsupport disable=BP5008 function usage() { echo "function imaging_create_datastore" echo "Creates an AWS HealthImaging data store for importing DICOM P10 files." echo " -n data_store_name - The name of the data store." echo "" } # Retrieve the calling parameters. while getopts "n:h" option; do case "${option}" in n) datastore_name="${OPTARG}" ;; h) usage return 0 ;; \?) echo "Invalid parameter" usage return 1 ;; esac done export OPTIND=1 if [[ -z "$datastore_name" ]]; then errecho "ERROR: You must provide a data store name with the -n parameter." usage return 1 fi response=$(aws medical-imaging create-datastore \ --datastore-name "$datastore_name" \ --output text \ --query 'datastoreId') local error_code=${?} if [[ $error_code -ne 0 ]]; then aws_cli_error_log $error_code errecho "ERROR: AWS reports medical-imaging create-datastore operation failed.$response" return 1 fi echo "$response" return 0 }
  • API 詳細については、CreateDatastore「」の「」を参照してください 。AWS CLI コマンドリファレンス

注記

については、「」を参照してください GitHub。完全な例を検索し、 でセットアップして実行する方法を学びます。 AWS コード例リポジトリ

CLI
AWS CLI

データストアを作成するには

次の create-datastore コード例では、my-datastore という名が付けられたデータストアを作成しています。

aws medical-imaging create-datastore \ --datastore-name "my-datastore"

出力:

{ "datastoreId": "12345678901234567890123456789012", "datastoreStatus": "CREATING" }

詳細については、「 でのデータストアの作成」を参照してください。 AWS HealthImaging デベロッパーガイド

  • API 詳細については、CreateDatastore「」の「」を参照してください 。AWS CLI コマンドリファレンス

Java
SDK for Java 2.x
public static String createMedicalImageDatastore(MedicalImagingClient medicalImagingClient, String datastoreName) { try { CreateDatastoreRequest datastoreRequest = CreateDatastoreRequest.builder() .datastoreName(datastoreName) .build(); CreateDatastoreResponse response = medicalImagingClient.createDatastore(datastoreRequest); return response.datastoreId(); } catch (MedicalImagingException e) { System.err.println(e.awsErrorDetails().errorMessage()); System.exit(1); } return ""; }
  • API 詳細については、CreateDatastore「」の「」を参照してください 。AWS SDK for Java 2.x API リファレンス

注記

については、「」を参照してください GitHub。完全な例を検索し、 でセットアップして実行する方法について説明します。 AWS コード例リポジトリ

JavaScript
SDK の JavaScript (v3)
import { CreateDatastoreCommand } from "@aws-sdk/client-medical-imaging"; import { medicalImagingClient } from "../libs/medicalImagingClient.js"; /** * @param {string} datastoreName - The name of the data store to create. */ export const createDatastore = async (datastoreName = "DATASTORE_NAME") => { const response = await medicalImagingClient.send( new CreateDatastoreCommand({ datastoreName: datastoreName }) ); console.log(response); // { // '$metadata': { // httpStatusCode: 200, // requestId: 'a71cd65f-2382-49bf-b682-f9209d8d399b', // extendedRequestId: undefined, // cfId: undefined, // attempts: 1, // totalRetryDelay: 0 // }, // datastoreId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // datastoreStatus: 'CREATING' // } return response; };
  • API 詳細については、CreateDatastore「」の「」を参照してください 。AWS SDK for JavaScript API リファレンス

注記

については、「」を参照してください GitHub。完全な例を検索し、 でセットアップして実行する方法について説明します。 AWS コード例リポジトリ

Python
SDK for Python (Boto3)
class MedicalImagingWrapper: def __init__(self, health_imaging_client): self.health_imaging_client = health_imaging_client def create_datastore(self, name): """ Create a data store. :param name: The name of the data store to create. :return: The data store ID. """ try: data_store = self.health_imaging_client.create_datastore(datastoreName=name) except ClientError as err: logger.error( "Couldn't create data store %s. Here's why: %s: %s", name, err.response["Error"]["Code"], err.response["Error"]["Message"], ) raise else: return data_store["datastoreId"]

次のコードは MedicalImagingWrapper オブジェクトをインスタンス化します。

client = boto3.client("medical-imaging") medical_imaging_wrapper = MedicalImagingWrapper(client)
  • API 詳細については、CreateDatastore「」の「」を参照してください 。AWS SDK for Python (Boto3) APIリファレンス

注記

については、「」を参照してください GitHub。完全な例を検索し、 でセットアップして実行する方法について説明します。 AWS コード例リポジトリ