View a markdown version of this page

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

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

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

DeleteFHIRDatastore 搭配 AWS SDK 或 CLI 使用

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

CLI
AWS CLI

刪除 FHIR 資料存放區

下列delete-fhir-datastore範例示範如何刪除資料存放區及其在 AWS HealthLake 中的所有內容。

aws healthlake delete-fhir-datastore \ --datastore-id (Data store ID)

輸出:

{ "DatastoreEndpoint": "https://healthlake.us-east-1.amazonaws.com/datastore/(Data store ID)/r4/", "DatastoreArn": "arn:aws:healthlake:us-east-1:(AWS Account ID):datastore/(Data store ID)", "DatastoreStatus": "DELETING", "DatastoreId": "(Data store ID)" }

如需詳細資訊,請參閱《AWS HealthLake 開發人員指南》中的建立和監控 FHIR 資料存放區 <https://docs.aws.amazon.com/healthlake/latest/devguide/working-with-FHIR-healthlake.html>。

Python
適用於 Python 的 SDK (Boto3)
@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 delete_fhir_datastore(self, datastore_id: str) -> None: """ Deletes a HealthLake data store. :param datastore_id: The data store ID. """ try: self.health_lake_client.delete_fhir_datastore(DatastoreId=datastore_id) except ClientError as err: logger.exception( "Couldn't delete data store with ID %s. Here's why %s", datastore_id, err.response["Error"]["Message"], ) raise
  • 如需 API 詳細資訊,請參閱《AWS SDK for Python (Boto3) API 參考》中的 DeleteFHIRDatastore

注意

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

SAP ABAP
適用於 SAP ABAP 的開發套件
注意

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

TRY. " iv_datastore_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' oo_result = lo_hll->deletefhirdatastore( iv_datastoreid = iv_datastore_id ). MESSAGE 'Data store deleted successfully.' TYPE 'I'. CATCH /aws1/cx_hllaccessdeniedex INTO DATA(lo_access_ex). DATA(lv_error) = |Access denied: { lo_access_ex->av_err_code }-{ lo_access_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_access_ex. CATCH /aws1/cx_hllconflictexception INTO DATA(lo_conflict_ex). lv_error = |Conflict error: { lo_conflict_ex->av_err_code }-{ lo_conflict_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_conflict_ex. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). lv_error = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. ENDTRY.
  • 如需 API 詳細資訊,請參閱《適用於 AWS SAP ABAP 的 SDK API 參考》中的 DeleteFHIRDatastore