

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Menandai penyimpanan HealthLake data
<a name="managing-data-stores-tagging"></a>

Anda dapat menetapkan metadata ke penyimpanan HealthLake data dalam bentuk tag. Setiap tag adalah label yang terdiri dari kunci dan nilai yang ditentukan pengguna. Tag membantu Anda mengelola, mengidentifikasi, mengatur, mencari, dan memfilter penyimpanan data.

**Penting:**  
Jangan menyimpan informasi kesehatan yang dilindungi (PHI), informasi identitas pribadi (PII), atau informasi rahasia atau sensitif lainnya dalam tag. Tag tidak dimaksudkan untuk digunakan dalam data sensitif atau privat.

Topik berikut menjelaskan cara menggunakan operasi HealthLake penandaan menggunakan Konsol Manajemen AWS, AWS CLI, dan AWS SDKs. Untuk informasi selengkapnya, lihat [Menandai AWS sumber daya Anda](https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html) di *Referensi Umum AWS Panduan*.

**Topics**
+ [Menandai penyimpanan HealthLake data](#tagresource)
+ [Listing tag untuk penyimpanan HealthLake data](#listtagsforresource)
+ [Membuka tag penyimpanan data HealthLake](#untagresource)

## Menandai penyimpanan HealthLake data
<a name="tagresource"></a>

Gunakan `TagResource` untuk menandai penyimpanan HealthLake data. Menu berikut memberikan prosedur untuk contoh Konsol Manajemen AWS dan kode untuk AWS CLI dan AWS SDKs. Untuk informasi selengkapnya, lihat [https://docs.aws.amazon.com/healthlake/latest/APIReference/API_TagResource.html.html](https://docs.aws.amazon.com/healthlake/latest/APIReference/API_TagResource.html.html) di dalam *Referensi API AWS HealthLake *. 

**Untuk menandai penyimpanan HealthLake data**  
Pilih menu berdasarkan preferensi akses Anda AWS HealthLake.

### AWS CLI dan SDKs
<a name="tagresource-cli-sdk"></a>

------
#### [ CLI ]

**AWS CLI**  
**Untuk menambahkan tag ke penyimpanan data**  
`tag-resource`Contoh berikut menunjukkan cara menambahkan tag ke penyimpanan data.  

```
aws healthlake tag-resource \
    --resource-arn "arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/0725c83f4307f263e16fd56b6d8ebdbe" \
    --tags '[{"Key": "key1", "Value": "value1"}]'
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Menambahkan tag ke penyimpanan data](https://docs.aws.amazon.com/healthlake/latest/devguide/add-a-tag.html) di *Panduan AWS HealthLake Pengembang.* .  
+  Untuk detail API, lihat [TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/healthlake/tag-resource.html)di *Referensi AWS CLI Perintah*. 

------
#### [ Python ]

**SDK untuk Python (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 tag_resource(self, resource_arn: str, tags: list[dict[str, str]]) -> None:
        """
        Tags a HealthLake resource.
        :param resource_arn: The resource ARN.
        :param tags: The tags to add to the resource.
        """
        try:
            self.health_lake_client.tag_resource(ResourceARN=resource_arn, Tags=tags)
        except ClientError as err:
            logger.exception(
                "Couldn't tag resource %s. Here's why %s",
                resource_arn,
                err.response["Error"]["Message"],
            )
            raise
```
+  Untuk detail API, lihat [TagResource](https://docs.aws.amazon.com/goto/boto3/healthlake-2017-07-01/TagResource)di *AWS SDK for Python (Boto3) Referensi* API. 
 Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di [Repositori Contoh Kode AWS](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/healthlake#code-examples). 

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

**SDK for SAP ABAP**  
 Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di [Repositori Contoh Kode AWS](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/hll#code-examples). 

```
    TRY.
        " iv_resource_arn = 'arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
        lo_hll->tagresource(
          iv_resourcearn = iv_resource_arn
          it_tags = it_tags
        ).
        MESSAGE 'Resource tagged successfully.' TYPE 'I'.
      CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex).
        DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|.
        MESSAGE lv_error TYPE 'I'.
        RAISE EXCEPTION lo_validation_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.
```
+  Untuk detail API, lihat [TagResource](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html)di *AWS SDK untuk referensi SAP ABAP* API. 

------

**Ketersediaan contoh**  
Tidak dapat menemukan apa yang Anda butuhkan? Minta contoh kode menggunakan tautan **Berikan umpan balik** di bilah sisi kanan halaman ini.

### AWS Konsol
<a name="tagresource-console"></a>

1. Masuk ke halaman [Penyimpanan data](https://console.aws.amazon.com/healthlake/home#/list-datastores) di HealthLake Konsol.

1. Pilih penyimpanan data.

   Halaman **detail penyimpanan data** terbuka.

1. Di bawah bagian **Tag**, pilih **Kelola tag**.

   Halaman **Kelola tag** terbuka.

1. Pilih **Tambahkan tag baru**.

1. Masukkan **Kunci** dan **Nilai** (opsional).

1. Pilih **Simpan**.

## Listing tag untuk penyimpanan HealthLake data
<a name="listtagsforresource"></a>

Gunakan `ListTagsForResource` untuk daftar tag untuk penyimpanan HealthLake data. Menu berikut memberikan prosedur untuk contoh Konsol Manajemen AWS dan kode untuk AWS CLI dan AWS SDKs. Untuk informasi selengkapnya, lihat [https://docs.aws.amazon.com/healthlake/latest/APIReference/API_ListTagsForResource.html.html](https://docs.aws.amazon.com/healthlake/latest/APIReference/API_ListTagsForResource.html.html) di dalam *Referensi API AWS HealthLake *. 

**Untuk daftar tag untuk penyimpanan HealthLake data**  
Pilih menu berdasarkan preferensi akses Anda AWS HealthLake.

### AWS CLI dan SDKs
<a name="listtagsforresource-cli-sdk"></a>

------
#### [ CLI ]

**AWS CLI**  
**Untuk daftar tag untuk penyimpanan data**  
`list-tags-for-resource`Contoh berikut mencantumkan tag yang terkait dengan penyimpanan data yang ditentukan. :  

```
aws healthlake list-tags-for-resource \
    --resource-arn "arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/0725c83f4307f263e16fd56b6d8ebdbe"
```
Output:  

```
{
    "tags": {
        "key": "value",
        "key1": "value1"
    }
}
```
Untuk informasi selengkapnya, lihat [Menandai sumber daya AWS HealthLake di](https://docs.aws.amazon.com/healthlake/latest/devguide/tagging.html) Panduan AWS HealthLake Pengembang.  
+  Untuk detail API, lihat [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/healthlake/list-tags-for-resource.html)di *Referensi AWS CLI Perintah*. 

------
#### [ Python ]

**SDK untuk Python (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 list_tags_for_resource(self, resource_arn: str) -> dict[str, str]:
        """
        Lists the tags for a HealthLake resource.
        :param resource_arn: The resource ARN.
        :return: The tags for the resource.
        """
        try:
            response = self.health_lake_client.list_tags_for_resource(
                ResourceARN=resource_arn
            )
            return response["Tags"]
        except ClientError as err:
            logger.exception(
                "Couldn't list tags for resource %s. Here's why %s",
                resource_arn,
                err.response["Error"]["Message"],
            )
            raise
```
+  Untuk detail API, lihat [ListTagsForResource](https://docs.aws.amazon.com/goto/boto3/healthlake-2017-07-01/ListTagsForResource)di *AWS SDK for Python (Boto3) Referensi* API. 
 Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di [Repositori Contoh Kode AWS](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/healthlake#code-examples). 

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

**SDK for SAP ABAP**  
 Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di [Repositori Contoh Kode AWS](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/hll#code-examples). 

```
    TRY.
        " iv_resource_arn = 'arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
        DATA(lo_result) = lo_hll->listtagsforresource(
          iv_resourcearn = iv_resource_arn
        ).
        ot_tags = lo_result->get_tags( ).
        DATA(lv_tag_count) = lines( ot_tags ).
        MESSAGE |Found { lv_tag_count } tag(s).| TYPE 'I'.
      CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex).
        DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|.
        MESSAGE lv_error TYPE 'I'.
        RAISE EXCEPTION lo_validation_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.
```
+  Untuk detail API, lihat [ListTagsForResource](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html)di *AWS SDK untuk referensi SAP ABAP* API. 

------

**Ketersediaan contoh**  
Tidak dapat menemukan apa yang Anda butuhkan? Minta contoh kode menggunakan tautan **Berikan umpan balik** di bilah sisi kanan halaman ini.

### AWS Konsol
<a name="listtagsforresource-console"></a>

1. Masuk ke halaman [Penyimpanan data](https://console.aws.amazon.com/healthlake/home#/list-datastores) di HealthLake Konsol.

1. Pilih penyimpanan data.

   Halaman **detail penyimpanan data** terbuka. Di bawah bagian **Tag**, semua tag penyimpanan data terdaftar.

## Membuka tag penyimpanan data HealthLake
<a name="untagresource"></a>

Gunakan `UntagResource` untuk menghapus tag dari penyimpanan HealthLake data. Menu berikut memberikan prosedur untuk contoh Konsol Manajemen AWS dan kode untuk AWS CLI dan AWS SDKs. Untuk informasi selengkapnya, lihat [https://docs.aws.amazon.com/healthlake/latest/APIReference/API_UntagResource.html.html](https://docs.aws.amazon.com/healthlake/latest/APIReference/API_UntagResource.html.html) di dalam *Referensi API AWS HealthLake *. 

**Untuk menghapus tag penyimpanan HealthLake data**  
Pilih menu berdasarkan preferensi akses Anda AWS HealthLake.

### AWS CLI dan SDKs
<a name="untagresource-cli-sdk"></a>

------
#### [ CLI ]

**AWS CLI**  
**Untuk menghapus tag dari penyimpanan data.**  
`untag-resource`Contoh berikut menunjukkan cara menghapus tag dari penyimpanan data.  

```
aws healthlake untag-resource \
    --resource-arn "arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/b91723d65c6fdeb1d26543a49d2ed1fa" \
    --tag-keys '["key1"]'
```
Perintah ini tidak menghasilkan output.  
Untuk informasi selengkapnya, lihat [Menghapus tag dari penyimpanan data](https://docs.aws.amazon.com/healthlake/latest/devguide/remove-tags.html) di *Panduan AWS HealthLake Pengembang*.  
+  Untuk detail API, lihat [UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/healthlake/untag-resource.html)di *Referensi AWS CLI Perintah*. 

------
#### [ Python ]

**SDK untuk Python (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 untag_resource(self, resource_arn: str, tag_keys: list[str]) -> None:
        """
        Untags a HealthLake resource.
        :param resource_arn: The resource ARN.
        :param tag_keys: The tag keys to remove from the resource.
        """
        try:
            self.health_lake_client.untag_resource(
                ResourceARN=resource_arn, TagKeys=tag_keys
            )
        except ClientError as err:
            logger.exception(
                "Couldn't untag resource %s. Here's why %s",
                resource_arn,
                err.response["Error"]["Message"],
            )
            raise
```
+  Untuk detail API, lihat [UntagResource](https://docs.aws.amazon.com/goto/boto3/healthlake-2017-07-01/UntagResource)di *AWS SDK for Python (Boto3) Referensi* API. 
 Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di [Repositori Contoh Kode AWS](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/healthlake#code-examples). 

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

**SDK for SAP ABAP**  
 Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di [Repositori Contoh Kode AWS](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/hll#code-examples). 

```
    TRY.
        " iv_resource_arn = 'arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6'
        lo_hll->untagresource(
          iv_resourcearn = iv_resource_arn
          it_tagkeys = it_tag_keys
        ).
        MESSAGE 'Resource untagged successfully.' TYPE 'I'.
      CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex).
        DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|.
        MESSAGE lv_error TYPE 'I'.
        RAISE EXCEPTION lo_validation_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.
```
+  Untuk detail API, lihat [UntagResource](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html)di *AWS SDK untuk referensi SAP ABAP* API. 

------

**Ketersediaan contoh**  
Tidak dapat menemukan apa yang Anda butuhkan? Minta contoh kode menggunakan tautan **Berikan umpan balik** di bilah sisi kanan halaman ini.

### AWS Konsol
<a name="untagresource-console"></a>

1. Masuk ke halaman [Penyimpanan data](https://console.aws.amazon.com/healthlake/home#/list-datastores) di HealthLake Konsol.

1. Pilih penyimpanan data.

   Halaman **detail penyimpanan data** terbuka.

1. Di bawah bagian **Tag**, pilih **Kelola tag**.

   Halaman **Kelola tag** terbuka.

1. Pilih **Hapus** di samping tag yang ingin Anda hapus.

1. Pilih **Simpan**.