StartFHIRExportJob 搭配 a AWS SDK 或 CLI 使用 - AWS SDK 程式碼範例

文件 AWS SDK AWS 範例 SDK 儲存庫中有更多可用的 GitHub 範例。

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

StartFHIRExportJob 搭配 a AWS SDK 或 CLI 使用

下列程式碼範例示範如何使用 StartFHIRExportJob

CLI
AWS CLI

啟動 FHIR 匯出任務

下列start-fhir-export-job範例示範如何使用 Amazon HealthLake 啟動 FHIR 匯出任務。

aws healthlake start-fhir-export-job \ --output-data-config S3Uri="s3://(Bucket Name)/(Prefix Name)/" \ --datastore-id (Datastore ID) \ --data-access-role-arn arn:aws:iam::(AWS Account ID):role/(Role Name)

輸出:

{ "DatastoreId": "(Datastore ID)", "JobStatus": "SUBMITTED", "JobId": "9b9a51943afaedd0a8c0c26c49135a31" }

如需詳細資訊,請參閱 Amazon HealthLake 開發人員指南中的從 FHIR Data Store 匯出檔案

Python
SDK for Python (Boto3)
注意

還有更多 on GitHub。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫中設定和執行。

@classmethod def from_client(cls) -> "HealthLakeWrapper": """ Creates a HealthLakeWrapper instance with a default AWS HealthLake client. :return: An instance of HealthLakeWrapper initialized with the default HealthLake client. """ health_lake_client = boto3.client("healthlake") return cls(health_lake_client) def start_fhir_export_job( self, job_name: str, datastore_id: str, output_s3_uri: str, kms_key_id: str, data_access_role_arn: str, ) -> dict[str, str]: """ Starts a HealthLake export job. :param job_name: The export job name. :param datastore_id: The datastore ID. :param output_s3_uri: The output S3 URI. :param kms_key_id: The KMS key ID associated with the output S3 bucket. :param data_access_role_arn: The data access role ARN. :return: The export job. """ try: response = self.health_lake_client.start_fhir_export_job( OutputDataConfig={ "S3Configuration": {"S3Uri": output_s3_uri, "KmsKeyId": kms_key_id} }, DataAccessRoleArn=data_access_role_arn, DatastoreId=datastore_id, JobName=job_name, ) return response except ClientError as err: logger.exception( "Couldn't start export job. Here's why %s", err.response["Error"]["Message"], ) raise
  • 如需 API 詳細資訊,請參閱 AWS SDK for Python (Boto3) Word 參考中的 SAPI tartFHIRExport任務