讀取 FHIR 資源歷史記錄 - AWS HealthLake

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

讀取 FHIR 資源歷史記錄

FHIR history互動會擷取 HealthLake 資料存放區中特定 FHIR 資源的歷史記錄。使用此互動,您可以判斷 FHIR 資源的內容隨著時間的變化。在協調稽核日誌時,查看修改前後的資源狀態也很有用。FHIR 互動 createupdatedelete會產生要儲存的歷史資源版本。如需詳細資訊,請參閱 FHIR R4 RESTful API 文件history中的 。

注意

您可以選擇不history接收特定 FHIR 資源類型。若要選擇退出,請使用 建立案例AWS Support Center Console。若要建立您的案例,請登入您的 AWS 帳戶 ,然後選擇建立案例

讀取 FHIR 資源歷史記錄

  1. 收集 HealthLake regiondatastoreId 值。如需詳細資訊,請參閱取得資料存放區屬性

  2. 決定Resource要讀取和收集相關聯id值的 FHIR 類型。如需詳細資訊,請參閱資源類型

  3. 使用 HealthLake region和 的收集值來建構請求的 URLdatastoreId。也包括 FHIR Resource類型、其相關聯的 id,以及選用的搜尋參數。若要在下列範例中檢視整個 URL 路徑,請捲動至複製按鈕。

    GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Resource/id/_history{?[parameters]}
    HealthLake 支援的 FHIR history互動搜尋參數
    參數 描述
    _count : integer 頁面上搜尋結果的數量上限。伺服器將傳回請求的數量,或資料存放區預設允許的搜尋結果數量上限,以較低者為準。
    _since : instant 僅包含在指定即時時或之後建立的資源版本。
    _at : date(Time) 僅包含日期時間值中指定期間內某個時間點的目前資源版本。如需詳細資訊,請參閱 HL7 FHIR RESTful API 文件date中的 。
  4. 傳送 請求。FHIR history互動使用具有AWS 簽章第 4 版或 FHIR 授權上的 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

    IdentityProviderConfiguration 資料類型的 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 範圍

    history 互動的傳回內容包含在 FHIR 資源 中Bundle,類型設定為 history。它包含指定的版本歷史記錄,最後以最舊的版本排序,並包含已刪除的資源。如需詳細資訊,請參閱 FHIR R4 文件Resource Bundle中的 。

讀取版本特定的 FHIR 資源歷史記錄

FHIR vread互動會對 HealthLake 資料存放區中的資源執行版本特定讀取。使用此互動,您可以像過去特定時間一樣檢視 FHIR 資源的內容。

注意

如果您在不使用 的情況下使用 FHIR history互動vread,HealthLake 一律會傳回資源中繼資料的最新版本。

HealthLake 宣告支援CapabilityStatement.rest.resource.versioning針對每個支援的資源在 中進行版本控制。所有 HealthLake 資料存放區在所有資源上都包含 Resource.meta.versionId(vid)。

啟用 FHIR history互動時 (預設為 10/25/2024 之後建立的資料存放區,或請求較舊的資料存放區),Bundle回應會包含 vid做為 location元素的一部分。在下列範例中, vid會顯示為數字 1。若要檢視完整範例,請參閱 Bundle/bundle-response (JSON) 範例

"response" : { "status" : "201 Created", "location" : "Patient/12423/_history/1", ...}
讀取版本特定的 FHIR 資源歷史記錄

  1. 收集 HealthLake regiondatastoreId 值。如需詳細資訊,請參閱取得資料存放區屬性

  2. 決定要讀取和收集相關聯 idvid值的 FHIR Resource類型。如需詳細資訊,請參閱資源類型

  3. 使用針對 HealthLake 和 FHIR 收集的值來建構請求的 URL。若要在下列範例中檢視整個 URL 路徑,請捲動至複製按鈕。

    GET https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Resource/id/_history/vid
  4. 傳送 請求。FHIR history互動使用具有AWS 簽章第 4 版或 FHIR 授權上的 SMART 的GET請求。下列vread互動會針對 指定的資源中繼資料版本,傳回具有 FHIR Patient 資源指定內容的單一執行個體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

    IdentityProviderConfiguration 資料類型的 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 範圍