

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# HealthLake 데이터 스토어 생성
<a name="managing-data-stores-create"></a>

`CreateFHIRDatastore`를 사용하여 FHIR R4 사양을 준수하는 AWS HealthLake 데이터 스토어를 생성합니다. HealthLake 데이터 스토어는 FHIR 데이터를 가져오고, 관리하고, 검색하고, 내보내는 데 사용됩니다. Synthea 오픈 소스 FHIR R4 상태 데이터를 생성할 때 데이터 스토어로 가져오도록(사전 로드) 선택할 수 있습니다. 자세한 내용은 [사전 로드된 데이터 형식](reference-healthlake-preloaded-data-types.md) 단원을 참조하십시오.

**중요**  
HealthLake는 FHIR의 AWS SigV4 또는 SMART라는 두 가지 유형의 FHIR 데이터 스토어 권한 부여 전략을 지원합니다. HealthLake FHIR 데이터 스토어를 생성하기 전에 권한 부여 전략 중 하나를 선택해야 합니다. 자세한 내용은 [데이터 스토어 권한 부여 전략](getting-started-concepts.md#concept-data-store-authorization-strategy) 단원을 참조하십시오.

HealthLake 데이터 스토어를 생성하면 RESTful API [엔드포인트](reference-healthlake-endpoints-quotas.md#reference-healthlake-endpoints)를 통해 FHIR 데이터 리포지토리를 사용할 수 있습니다. HealthLake 데이터 스토어를 생성한 후 [기능 설명을](reference-fhir-capability-statement.md) 요청하여 연결된 모든 FHIR 관련 기능(동작)을 찾을 수 있습니다.

다음 메뉴는 AWS CLI 및 AWS SDKs에 대한 예제와에 대한 프로시저를 제공합니다 AWS Management Console. 자세한 내용을 알아보려면 [https://docs.aws.amazon.com/healthlake/latest/APIReference/API_CreateFHIRDatastore.html](https://docs.aws.amazon.com/healthlake/latest/APIReference/API_CreateFHIRDatastore.html) 섹션을 참조하세요.

**HealthLake 데이터 스토어를 생성하려면**  
액세스 기본 설정에 따라 메뉴를 선택합니다 AWS HealthLake.

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

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

**AWS CLI**  
**예제 1: SigV4-enabled HealthLake 데이터 스토어 생성**  
다음 `create-fhir-datastore` 예제에서는 AWS HealthLake에서 새 데이터 스토어를 생성하는 방법을 보여줍니다.  

```
aws healthlake create-fhir-datastore \
    --datastore-type-version R4 \
    --datastore-name "FhirTestDatastore"
```
출력:  

```
{
    "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": "CREATING",
    "DatastoreId": "(Data store ID)"
}
```
**예제 2: FHIR 지원 HealthLake 데이터 스토어에서 SMART 생성**  
다음 `create-fhir-datastore` 예제에서는 AWS HealthLake에서 FHIR 지원 데이터 스토어에서 새 SMART를 생성하는 방법을 보여줍니다.  

```
aws healthlake create-fhir-datastore \
    --datastore-name "your-data-store-name" \
    --datastore-type-version R4 \
    --preload-data-config PreloadDataType="SYNTHEA" \
    --sse-configuration '{ "KmsEncryptionConfig": {  "CmkType": "CUSTOMER_MANAGED_KMS_KEY", "KmsKeyId": "arn:aws:kms:us-east-1:your-account-id:key/your-key-id" } }' \
    --identity-provider-configuration  file://identity_provider_configuration.json
```
`identity_provider_configuration.json`의 콘텐츠:  

```
{
    "AuthorizationStrategy": "SMART_ON_FHIR_V1",
    "FineGrainedAuthorizationEnabled": true,
    "IdpLambdaArn": "arn:aws:lambda:your-region:your-account-id:function:your-lambda-name",
    "Metadata": "{\"issuer\":\"https://ehr.example.com\", \"jwks_uri\":\"https://ehr.example.com/.well-known/jwks.json\",\"authorization_endpoint\":\"https://ehr.example.com/auth/authorize\",\"token_endpoint\":\"https://ehr.token.com/auth/token\",\"token_endpoint_auth_methods_supported\":[\"client_secret_basic\",\"foo\"],\"grant_types_supported\":[\"client_credential\",\"foo\"],\"registration_endpoint\":\"https://ehr.example.com/auth/register\",\"scopes_supported\":[\"openId\",\"profile\",\"launch\"],\"response_types_supported\":[\"code\"],\"management_endpoint\":\"https://ehr.example.com/user/manage\",\"introspection_endpoint\":\"https://ehr.example.com/user/introspect\",\"revocation_endpoint\":\"https://ehr.example.com/user/revoke\",\"code_challenge_methods_supported\":[\"S256\"],\"capabilities\":[\"launch-ehr\",\"sso-openid-connect\",\"client-public\"]}"
}
```
출력:  

```
{
    "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": "CREATING",
    "DatastoreId": "(Data store ID)"
}
```
자세한 내용은 *AWS HealthLake 개발자 안내서*의 [FHIR 데이터 스토어 생성 및 모니터링](https://docs.aws.amazon.com/healthlake/latest/devguide/working-with-FHIR-healthlake.html)을 참조하세요.  
+  API 세부 정보는 *AWS CLI 명령 참조*의 [CreateFHIRDatastore](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/healthlake/create-fhir-datastore.html) 섹션을 참조하세요.

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

**SDK for 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 create_fhir_datastore(
        self,
        datastore_name: str,
        sse_configuration: dict[str, any] = None,
        identity_provider_configuration: dict[str, any] = None,
    ) -> dict[str, str]:
        """
        Creates a new HealthLake data store.
        When creating a SMART on FHIR data store, the following parameters are required:
        - sse_configuration: The server-side encryption configuration for a SMART on FHIR-enabled data store.
        - identity_provider_configuration: The identity provider configuration for a SMART on FHIR-enabled data store.

        :param datastore_name: The name of the data store.
        :param sse_configuration: The server-side encryption configuration for a SMART on FHIR-enabled data store.
        :param identity_provider_configuration: The identity provider configuration for a SMART on FHIR-enabled data store.
        :return: A dictionary containing the data store information.
        """
        try:
            parameters = {"DatastoreName": datastore_name, "DatastoreTypeVersion": "R4"}
            if (
                sse_configuration is not None
                and identity_provider_configuration is not None
            ):
                # Creating a SMART on FHIR-enabled data store
                parameters["SseConfiguration"] = sse_configuration
                parameters[
                    "IdentityProviderConfiguration"
                ] = identity_provider_configuration

            response = self.health_lake_client.create_fhir_datastore(**parameters)
            return response
        except ClientError as err:
            logger.exception(
                "Couldn't create data store %s. Here's why %s",
                datastore_name,
                err.response["Error"]["Message"],
            )
            raise
```
다음 코드에서는 SMART on FHIR이 활성화된 HealthLake 데이터 저장소의 파라미터 예시를 보여줍니다.  

```
            sse_configuration = {
                "KmsEncryptionConfig": {"CmkType": "AWS_OWNED_KMS_KEY"}
            }
            # TODO: Update the metadata to match your environment.
            metadata = {
                "issuer": "https://ehr.example.com",
                "jwks_uri": "https://ehr.example.com/.well-known/jwks.json",
                "authorization_endpoint": "https://ehr.example.com/auth/authorize",
                "token_endpoint": "https://ehr.token.com/auth/token",
                "token_endpoint_auth_methods_supported": [
                    "client_secret_basic",
                    "foo",
                ],
                "grant_types_supported": ["client_credential", "foo"],
                "registration_endpoint": "https://ehr.example.com/auth/register",
                "scopes_supported": ["openId", "profile", "launch"],
                "response_types_supported": ["code"],
                "management_endpoint": "https://ehr.example.com/user/manage",
                "introspection_endpoint": "https://ehr.example.com/user/introspect",
                "revocation_endpoint": "https://ehr.example.com/user/revoke",
                "code_challenge_methods_supported": ["S256"],
                "capabilities": [
                    "launch-ehr",
                    "sso-openid-connect",
                    "client-public",
                ],
            }
            # TODO: Update the IdpLambdaArn.
            identity_provider_configuration = {
                "AuthorizationStrategy": "SMART_ON_FHIR_V1",
                "FineGrainedAuthorizationEnabled": True,
                "IdpLambdaArn": "arn:aws:lambda:your-region:your-account-id:function:your-lambda-name",
                "Metadata": json.dumps(metadata),
            }
            data_store = self.create_fhir_datastore(
                datastore_name, sse_configuration, identity_provider_configuration
            )
```
+  API 세부 정보는 *AWS SDK for Python (Boto3) API 참조*의 [CreateFHIRDatastore](https://docs.aws.amazon.com/goto/boto3/healthlake-2017-07-01/CreateFHIRDatastore)를 참조하세요.
 GitHub에 더 많은 내용이 있습니다. [AWS 코드 예 리포지토리](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/healthlake#code-examples)에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

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

**SDK for SAP ABAP API**  
 GitHub에 더 많은 내용이 있습니다. [AWS 코드 예 리포지토리](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/hll#code-examples)에서 전체 예를 찾고 설정 및 실행하는 방법을 배워보세요.

```
    TRY.
        " iv_datastore_name = 'MyHealthLakeDataStore'
        oo_result = lo_hll->createfhirdatastore(
          iv_datastorename = iv_datastore_name
          iv_datastoretypeversion = 'R4'
        ).
        MESSAGE 'Data store created 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_hllinternalserverex INTO DATA(lo_internal_ex).
        lv_error = |Internal server error: { lo_internal_ex->av_err_code }-{ lo_internal_ex->av_err_msg }|.
        MESSAGE lv_error TYPE 'I'.
        RAISE EXCEPTION lo_internal_ex.
      CATCH /aws1/cx_hllthrottlingex INTO DATA(lo_throttling_ex).
        lv_error = |Throttling error: { lo_throttling_ex->av_err_code }-{ lo_throttling_ex->av_err_msg }|.
        MESSAGE lv_error TYPE 'I'.
        RAISE EXCEPTION lo_throttling_ex.
    ENDTRY.
```
+  API 세부 정보는 SDK for SAP ABAP API 참조의 [CreateFHIRDatastore](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html)를 참조하세요. *AWS * 

------

**예제 가용성**  
필요한 예제를 찾을 수 없습니까? 이 페이지의 오른쪽 사이드바에 있는 **피드백 제공** 링크를 사용하여 코드 예제를 요청합니다.

## AWS 콘솔
<a name="managing-data-stores-create-console"></a>

**Note**  
다음 절차에서는 [AWS SigV4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) 권한 부여를 사용하여 HealthLake 데이터 스토어를 생성합니다. HealthLake 콘솔은 FHIR 데이터 스토어에서 SMART 생성을 지원하지 않습니다.

**AWS SigV4 권한 부여를 사용하여 HealthLake 데이터 스토어를 생성하려면**

1. HealthLake 콘솔의 [데이터 스토어 생성](https://console.aws.amazon.com/healthlake/home#/create-datastore) 페이지에 로그인합니다.

1. **데이터 스토어 생성을** 선택합니다.

1. **데이터 스토어 설정** 섹션의 **데이터 스토어 이름**에 이름을 지정합니다.

1. (선택 사항) **데이터 스토어 설정** 섹션의 **샘플 데이터 사전 로드**에서 Synthea 데이터를 사전 로드할 확인란을 선택합니다. Synthea 데이터는 오픈 소스 샘플 데이터 세트입니다. 자세한 내용은 [HealthLake용 Synthea 사전 로드된 데이터 형식](reference-healthlake-preloaded-data-types.md) 단원을 참조하십시오.

1. **데이터 스토어 암호화** 섹션에서 **AWS 소유 키 사용(기본값)** 또는 **다른 AWS KMS 키 선택(고급)을** 선택합니다.

1. **태그 - *선택*** 사항 섹션에서 데이터 스토어에 태그를 추가할 수 있습니다. 데이터 스토어 태그 지정에 대한 자세한 내용은 섹션을 참조하세요[HealthLake 데이터 스토어에 태그 지정](managing-data-stores-tagging.md).

1. **데이터 스토어 생성을** 선택합니다.

   데이터 스토어의 상태는 **데이터 스토어** 페이지에서 확인할 수 있습니다.