

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

# SMART 対応 HealthLake データストアでの FHIR REST API リクエストの実行
<a name="reference-smart-on-fhir-request-example"></a>

SMART on FHIR 対応の HealthLake データストアで FHIR REST API リクエストを行うことができます。次の例は、認可ヘッダーに JWT を含むクライアントアプリケーションからのリクエストと、Lambda がレスポンスをデコードする方法を示しています。クライアントアプリケーションリクエストが承認され、認証されたら、認可サーバーからベアラートークンを受信する必要があります。SMART on FHIR 対応 HealthLake データストアで FHIR REST API リクエストを送信するときは、認可ヘッダーのベアラートークンを使用します。

```
GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Patient/[ID]
Authorization: Bearer auth-server-provided-bearer-token
```

ベアラートークンが認可ヘッダーで見つかり、IAM ID AWS が検出されなかったため、HealthLake は SMART on FHIR 対応 HealthLake データストアの作成時に指定された Lambda 関数を呼び出します。トークンが Lambda 関数によって正常にデコードされると、次のレスポンス例が HealthLake に送信されます。

```
{
  "authPayload": {
    "iss": "https://authorization-server-endpoint/oauth2/token", # The issuer identifier of the authorization server
    "aud": "https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/", # Required, data store endpoint
    "iat": 1677115637,  # Identifies the time at which the token was issued
    "nbf": 1677115637,  # Required, the earliest time the JWT would be valid
    "exp": 1997877061,  # Required, the time at which the JWT is no longer valid
    "isAuthorized": "true",  # Required, boolean indicating the request has been authorized
    "uid": "100101",  # Unique identifier returned by the auth server
    "scope": "system/*.*" # Required, the scope of the request
  },
  "iamRoleARN": "iam-role-arn" #Required, IAM role to complete the request
}
```