

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

# FHIR 리소스 기록 읽기
<a name="managing-fhir-resources-read-history"></a>

FHIR `history` 상호 작용은 HealthLake 데이터 스토어에서 특정 FHIR 리소스의 기록을 검색합니다. 이 상호 작용을 사용하여 시간이 지남에 따라 FHIR 리소스의 내용이 어떻게 변경되었는지 확인할 수 있습니다. 또한 감사 로그와 협력하여 수정 전후의 리소스 상태를 확인하는 데 유용합니다. FHIR 상호 작용 `create`, `update`및를 `delete` 수행하면 리소스의 기록 버전이 저장됩니다. 자세한 내용은 **FHIR R4 RESTful API 설명서**[https://hl7.org/fhir/R4/http.html#history](https://hl7.org/fhir/R4/http.html#history)의 섹션을 참조하세요.

**참고**  
특정 FHIR 리소스 유형에 `history` 대해 옵트아웃할 수 있습니다. 옵트아웃하려면를 사용하여 사례를 생성합니다[AWS Support Center Console](https://console.aws.amazon.com/support/home#/). 사례를 생성하려면에 로그인 AWS 계정 하고 **사례 생성을** 선택합니다.

**FHIR 리소스 기록을 읽으려면**  


1. HealthLake `region` 및 `datastoreId` 값을 수집합니다. 자세한 내용은 [데이터 스토어 속성 가져오기](managing-data-stores-describe.md) 단원을 참조하십시오.

1. 연결된 `id` 값을 `Resource` 읽고 수집할 FHIR 유형을 결정합니다. 자세한 내용은 [조건 키](reference-fhir-resource-types.md) 단원을 참조하십시오.

1. HealthLake `region` 및에 대해 수집된 값을 사용하여 요청에 대한 URL을 구성합니다`datastoreId`. FHIR `Resource` 유형, 연결된 및 `id`선택적 검색 파라미터도 포함합니다. 다음 예제에서 전체 URL 경로를 보려면 **복사** 버튼을 스크롤합니다.

   ```
   GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Resource/id/_history{?[parameters]}
   ```  
**FHIR `history` 상호 작용에 대해 HealthLake에서 지원하는 검색 파라미터**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/healthlake/latest/devguide/managing-fhir-resources-read-history.html)

1.  요청을 보냅니다. FHIR `history` 상호 작용은 FHIR 권한 부여에서 [AWS 서명 버전 4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) 또는 SMART와 함께 `GET` 요청을 사용합니다. 다음 `curl` 예제에서는 `_count` 검색 파라미터를 사용하여 HealthLake의 FHIR `Patient` 리소스에 대한 페이지당 100개의 과거 검색 결과를 반환합니다. 전체 예제를 보려면 **복사** 버튼을 스크롤합니다.

------
#### [ SigV4 ]

   SigV4 권한 부여

   ```
   curl --request GET \
     'https://healthlake.region.amazonaws.com/datastore/datastore-id/r4/Patient/id/_history?_count=100' \
     --aws-sigv4 'aws:amz:region:healthlake' \
     --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
     --header "x-amz-security-token:$AWS_SESSION_TOKEN" \
     --header 'Accept: application/json'
   ```

------
#### [ SMART on FHIR ]

   [https://docs.aws.amazon.com/healthlake/latest/APIReference/API_IdentityProviderConfiguration.html](https://docs.aws.amazon.com/healthlake/latest/APIReference/API_IdentityProviderConfiguration.html) 데이터 형식에 대한 SMART on FHIR 권한 부여 예제입니다.

   ```
   {
       "AuthorizationStrategy": "SMART_ON_FHIR",
       "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\",\"permission-v2\"]}"
   }
   ```

   호출자는 권한 부여 Lambda에 권한을 할당할 수 있습니다. 자세한 내용은 [OAuth 2.0 범위](reference-smart-on-fhir-oauth-scopes.md) 단원을 참조하십시오.

------

   `history` 상호 작용의 반환 콘텐츠는 `Bundle`유형이 로 설정된 FHIR 리소스에 포함되어 있습니다`history`. 지정된 버전 기록을 포함하고, 가장 오래된 버전을 마지막으로 정렬하며, 삭제된 리소스를 포함합니다. 자세한 내용은 **FHIR R4 설명서**[https://hl7.org/fhir/R4/bundle.html](https://hl7.org/fhir/R4/bundle.html)의 섹션을 참조하세요.

## 버전별 FHIR 리소스 기록 읽기
<a name="managing-fhir-data-get-version-specific-resource"></a>

FHIR `vread` 상호 작용은 HealthLake 데이터 스토어에서 리소스의 버전별 읽기를 수행합니다. 이 상호 작용을 사용하면 과거 특정 시간에 있던 FHIR 리소스의 내용을 볼 수 있습니다.

**참고**  
*없이* FHIR `history` 상호 작용을 사용하는 경우 `vread` HealthLake는 항상 리소스 메타데이터의 최신 버전을 반환합니다.

HealthLake는 지원되는 각 리소스에 대해에서 버전 관리를 지원한다고 선언[https://hl7.org/fhir/R4/capabilitystatement-definitions.html#CapabilityStatement.rest.resource.versioning](https://hl7.org/fhir/R4/capabilitystatement-definitions.html#CapabilityStatement.rest.resource.versioning)합니다. 모든 HealthLake 데이터 스토어는 모든 리소스에 `Resource.meta.versionId` (`vid`)를 포함합니다.

FHIR `history` 상호 작용이 활성화된 경우(기본적으로 10/25/2024 이후에 생성된 데이터 스토어의 경우 또는 이전 데이터 스토어의 요청에 따라) `Bundle` 응답에는 [https://hl7.org/fhir/R4/bundle-definitions.html#Bundle.entry.response.location](https://hl7.org/fhir/R4/bundle-definitions.html#Bundle.entry.response.location) 요소의 `vid` 일부로가 포함됩니다. 다음 예제에서는 숫자 로 `vid` 표시됩니다`1`. 전체 예제를 보려면 [예제 번들/번들 응답(JSON)](https://build.fhir.org/bundle-response.json.html)을 참조하세요.

```
"response" : {
    "status" : "201 Created",
    "location" : "Patient/12423/_history/1",
    ...}
```

**버전별 FHIR 리소스 기록을 읽으려면**  


1. HealthLake `region` 및 `datastoreId` 값을 수집합니다. 자세한 내용은 [데이터 스토어 속성 가져오기](managing-data-stores-describe.md) 단원을 참조하십시오.

1. 연결된 및 `id` `vid` 값을 읽고 수집할 FHIR `Resource` 유형을 결정합니다. 자세한 내용은 [조건 키](reference-fhir-resource-types.md) 단원을 참조하십시오.

1. HealthLake 및 FHIR에 대해 수집된 값을 사용하여 요청에 대한 URL을 구성합니다. 다음 예제에서 전체 URL 경로를 보려면 **복사** 버튼을 스크롤합니다.

   ```
   GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Resource/id/_history/vid
   ```

1.  요청을 보냅니다. FHIR `history` 상호 작용은 FHIR 권한 부여 시 [AWS 서명 버전 4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) 또는 SMART와 함께 `GET` 요청을 사용합니다. 다음 `vread` 상호 작용은에서 지정한 `Patient` 리소스 메타데이터 버전의 FHIR 리소스에 지정된 콘텐츠가 있는 단일 인스턴스를 반환합니다`vid`. 다음 예제에서 전체 URL 경로를 보려면 **복사** 버튼을 스크롤합니다.

------
#### [ SigV4 ]

   SigV4 권한 부여

   ```
   curl --request GET \
     'https://healthlake.region.amazonaws.com/datastore/datastore-id/r4/Patient/id/_history/vid' \
     --aws-sigv4 'aws:amz:region:healthlake' \
     --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
     --header "x-amz-security-token:$AWS_SESSION_TOKEN" \
     --header 'Accept: application/json'
   ```

------
#### [ SMART on FHIR ]

   [https://docs.aws.amazon.com/healthlake/latest/APIReference/API_IdentityProviderConfiguration.html](https://docs.aws.amazon.com/healthlake/latest/APIReference/API_IdentityProviderConfiguration.html) 데이터 형식에 대한 SMART on FHIR 권한 부여 예제입니다.

   ```
   {
       "AuthorizationStrategy": "SMART_ON_FHIR",
       "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\",\"permission-v2\"]}"
   }
   ```

   호출자는 권한 부여 Lambda에 권한을 할당할 수 있습니다. 자세한 내용은 [OAuth 2.0 범위](reference-smart-on-fhir-oauth-scopes.md) 단원을 참조하십시오.

------