

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

# GET을 사용하여 FHIR 리소스 검색
<a name="searching-fhir-resources-get"></a>

`GET` 요청을 사용하여 HealthLake 데이터 스토어를 검색할 수 있습니다. `GET`를 사용하는 경우 HealthLake는 URL의 일부로 검색 파라미터를 제공하는 것을 지원하지만 요청 본문의 일부로는 제공하지 않습니다. 자세한 내용은 [HealthLake에 대한 FHIR R4 검색 파라미터](reference-fhir-search-parameters.md) 단원을 참조하십시오.

**중요**  
개인 식별 정보(PII) 또는 보호 대상 건강 정보(PHI)가 포함된 검색의 경우 PII 및 PHI가 `POST` 요청 본문의 일부로 추가되고 전송 중에 암호화되므로 보안 모범 사례는 요청을 사용하기 위해를 호출합니다. 자세한 내용은 [POST를 사용하여 FHIR 리소스 검색](searching-fhir-resources-post.md) 단원을 참조하십시오.

다음 절차에는를 사용하여 HealthLake 데이터 스토어를 `GET` 검색하는 예제가 나와 있습니다.

**를 사용하여 HealthLake 데이터 스토어를 검색하려면 `GET`**  


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

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

1. HealthLake `region` 및에 대해 수집된 값을 사용하여 요청에 대한 URL을 구성합니다`datastoreId`. FHIR `Resource` 유형과 지원되는 [검색 파라미터](reference-fhir-search-parameters.md)도 포함합니다. 다음 예제에서 전체 URL 경로를 보려면 **복사** 버튼을 스크롤합니다.

   ```
   GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Resource{?[parameters]{&_format=[mime-type]}}
   ```

1. FHIR 권한 부여 시 [AWS 서명 버전 4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) 또는 SMART를 사용하여 `GET` 요청을 보냅니다. 다음 `curl` 예시에서는 HealthLake 데이터 스토어의 총 `Patient` 리소스 수를 반환합니다. 전체 예제를 보려면 **복사** 버튼을 스크롤합니다.

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

   SigV4 권한 부여

   ```
   curl --request GET \
     'https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Patient?_total=accurate' \   
     --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) 단원을 참조하십시오.

------
#### [ AWS Console ]

**참고**  
HealthLake 콘솔은 SigV4 권한 부여만 지원합니다. SMART on FHIR 권한 부여는 AWS CLI 및 AWS SDKs 통해 지원됩니다.

   1. HealthLake 콘솔의 [쿼리 실행](https://console.aws.amazon.com/healthlake/home#/crud) 페이지에 로그인합니다.

   2. **쿼리 설정** 섹션에서 다음을 선택합니다.
   + **데이터 스토어 ID** - 쿼리 문자열을 생성할 데이터 스토어 ID를 선택합니다.
   + **쿼리 유형** -를 선택합니다`Search with GET`.
   + **리소스 유형** - 검색할 FHIR [리소스 유형을](reference-fhir-resource-types.md) 선택합니다.
   + **검색 파라미터** - [검색 파라미터](reference-fhir-search-parameters.md) 또는 검색 파라미터 조합을 선택하여 쿼리를 특정 레코드에 집중합니다.

   3. **쿼리 실행**을 선택합니다.

------

## 예: GET으로 검색
<a name="searching-fhir-resources-get-examples"></a>

다음 탭은를 사용하여 특정 FHIR 리소스 유형을 검색하는 예제를 제공합니다`GET`. 이 예제에서는 요청 URLs에서 검색 파라미터를 지정하는 방법을 보여줍니다.

**참고**  
HealthLake 콘솔은 SigV4 권한 부여만 지원합니다. SMART on FHIR 권한 부여는 AWS CLI 및 AWS SDKs 통해 지원됩니다.  
HealthLake는 FHIR R4 검색 파라미터의 하위 집합을 지원합니다. 자세한 내용은 [검색 파라미터](reference-fhir-search-parameters.md) 단원을 참조하십시오.

------
#### [ Patient (age) ]

수명은 FHIR에서 정의된 리소스 유형이 아니지만 [https://hl7.org/fhir/R4/patient.html](https://hl7.org/fhir/R4/patient.html) 리소스 유형의 요소로 캡처됩니다. 다음 예제를 사용하여 1997년에 태어난 개인을 검색하기 위해 [birthDate](https://hl7.org/fhir/R4/patient-definitions.html#Patient.birthDate) 요소와 `eq` [검색 비교](reference-fhir-search-parameters.md#search-comparators)기를 사용하여 [https://hl7.org/fhir/R4/patient.html](https://hl7.org/fhir/R4/patient.html) 리소스 유형에 대한 `GET`기반 검색을 요청합니다.

```
GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Patient?birthdate=eq1997
```

------
#### [ Condition ]

다음 예제를 사용하여 [https://hl7.org/fhir/R4/condition.html](https://hl7.org/fhir/R4/condition.html) 리소스 유형을 `GET` 요청합니다. 검색은 HealthLake 데이터 스토어에서 로 변환`72892002`되는 SNOMED 의료 코드가 포함된 조건을 찾습니다`Normal pregnancy`.

```
GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Condition?code=72892002
```

------
#### [ DocumentationReference ]

다음 예제는 (`Patient`s)에 대한 [https://hl7.org/fhir/R4/documentreference.html](https://hl7.org/fhir/R4/documentreference.html) 리소스 유형에 대해 연쇄상 알균 진단을 받고 아목시실린도 처방받은에 대한 `GET` 요청을 생성하는 방법을 보여줍니다.

```
GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/DocumentReference?_lastUpdated=le2021-12-19&infer-icd10cm-entity-text-concept-score;=streptococcal|0.6&infer-rxnorm-entity-text-concept-score=Amoxicillin|0.8
```

------
#### [ Location ]

다음 예제를 사용하여 [https://hl7.org/fhir/R4/location.html](https://hl7.org/fhir/R4/location.html) 리소스 유형을 `GET` 요청합니다. 다음 검색은 주소의 일부로 도시 이름 보스턴이 포함된 HealthLake 데이터 스토어의 위치를 찾습니다.

```
GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Location?address=boston
```

------
#### [ Observation ]

다음 예제를 사용하여 [https://hl7.org/fhir/R4/observation.html](https://hl7.org/fhir/R4/observation.html) 리소스 유형에 대한 `GET`기반 검색 요청을 수행합니다. 이 검색은 `value-concept` [검색 파라미터를](reference-fhir-search-parameters.md) 사용하여 로 변환`266919005`되는 의료 코드를 찾습니다`Never smoker`.

```
GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Observation?value-concept=266919005
```

------