How to use a numeric id in Google Healthcare api FHIR

I need to change uuid to numeric id, but I can't find how to make this.

Someone can help me, please?

1 answer

  • answered 2021-09-09 12:42 Nik Klassen

    You can create resources with any ID you want (that is allowed by the FHIR spec) if you set enabledUpdateCreate to true in your FHIR store config.

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

    For example

    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"
    

    Then you can create a new Patient with ID 1 like this

    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"
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum