

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 删除 HealthLake 数据存储
<a name="managing-data-stores-delete"></a>

`DeleteFHIRDatastore`用于删除 HealthLake 数据存储。以下菜单提供了操作步骤 AWS 管理控制台 和 AWS CLI 和的代码示例 AWS SDKs。有关更多信息，请参阅《AWS HealthLake API Reference》**中的 [https://docs.aws.amazon.com/healthlake/latest/APIReference/API_DeleteFHIRDatastores.html](https://docs.aws.amazon.com/healthlake/latest/APIReference/API_DeleteFHIRDatastores.html)。

**删除 HealthLake 数据存储**  
根据您的访问偏好选择菜单 AWS HealthLake。

## AWS CLI 和 SDKs
<a name="managing-data-stores-delete-cli-sdk"></a>

------
#### [ 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)"
}
```
*有关更多信息，请参阅《开发人员指南》中的创建和监控 FHIR 数据存储 < https://docs.aws.amazon.com/healthlake/ latest/devguide/working-with-with-fhir-HealthLake.html>。AWS HealthLake *  
+  有关 API 的详细信息，请参阅FHIRDatastore《*AWS CLI 命令参考*》中的 [“删除”](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/healthlake/delete-fhir-datastore.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 的详细信息，请参阅 *Python FHIRDatastore 版AWS SDK 中[删除](https://docs.aws.amazon.com/goto/boto3/healthlake-2017-07-01/DeleteFHIRDatastore) (Boto3) API 参考*。
 还有更多相关信息 GitHub。在 [AWS 代码示例存储库](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/healthlake#code-examples)中查找完整示例，了解如何进行设置和运行。

------
#### [ SAP ABAP ]

**适用于 SAP ABAP 的 SDK**  
 还有更多相关信息 GitHub。在 [AWS 代码示例存储库](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/hll#code-examples)中查找完整示例，了解如何进行设置和运行。

```
    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 的详细信息，请参阅在 SAP 的 *AWS SDK FHIRDatastore 中[删除](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) ABAP API 参考*。

------

**示例可用性**  
找不到所需的内容？ 使用本页右侧边栏上的 “**提供反馈**” 链接请求代码示例。

## AWS 控制台
<a name="managing-data-stores-delete-console"></a>

1. 登录 HealthLake 控制台上的[数据存储](https://console.aws.amazon.com/healthlake/home#/list-datastores)页面。

1. 选择数据存储。

   **数据存储详细信息**页面将会打开。

1. 选择**删除**。

   **删除数据存储**页面将会打开。

1. 要确认删除数据存储，请在文本输入字段中输入数据存储名称。

1. 选择**删除**。