

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 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. [AWS 署名バージョン 4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) または SMART on FHIR 認可を使用して`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) データ型の FHIR 認可の SMART の例。

   ```
   {
       "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. **[Run query]** (クエリの実行) を選択します。

------

## 例: 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) ]

age は FHIR で定義されたリソースタイプではありませんが、[https://hl7.org/fhir/R4/patient.html](https://hl7.org/fhir/R4/patient.html)リソースタイプの 要素としてキャプチャされます。次の例を使用して、[birthDate](https://hl7.org/fhir/R4/patient-definitions.html#Patient.birthDate) 要素を使用して[https://hl7.org/fhir/R4/patient.html](https://hl7.org/fhir/R4/patient.html)リソースタイプに対して `GET`ベースの検索リクエストを行い、`eq`[検索コンパレータ](reference-fhir-search-parameters.md#search-comparators)を使用して 1997 年生まれの個人を検索します。

```
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`リクエストを行います。検索では、SNOMED 医療コード を含む HealthLake データストア内の条件が検索され`72892002`、 に変換されます`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
```

------