如何在 Google Healthcare api FHIR 中使用数字 ID

How to use a numeric id in Google Healthcare api FHIR

我需要将 uuid 更改为数字 id,但我找不到如何做这个。

有人可以帮助我吗?

如果您在 FHIR 存储配置中将 enabledUpdateCreate 设置为 true,则可以使用您想要的任何 ID(FHIR 规范允许)创建资源。

This determines if the client can use an Update operation to create a new resource with a client-specified ID.

例如

curl -X PATCH \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    --data '{
      "enableUpdateCreate": true
    }' "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID?updateMask=enableUpdateCreate"

然后你可以像这样创建一个ID为1的新Patient

curl -X PUT \
     -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
     -H "Content-Type: application/fhir+json; charset=utf-8" \
     --data '{
         "resourceType": "Patient",
         "id": "1"
     }' \
"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/1"