Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.fhir.update
Updates the entire contents of a resource.
Implements the FHIR standard update interaction (DSTU2, STU3, R4, R5).
If the specified resource does not exist and the FHIR store has enableUpdateCreate set, creates the resource with the client-specified ID. It is strongly advised not to include or encode any sensitive data such as patient identifiers in client-specified resource IDs. Those IDs are part of the FHIR resource path recorded in Cloud Audit Logs and Pub/Sub notifications. Those IDs can also be contained in reference fields within other resources.
The request body must contain a JSON-encoded FHIR resource, and the request headers must contain Content-Type: application/fhir+json. The resource must contain an id element having an identical value to the ID in the REST path of the request.
On success, the response body contains a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store contain a JSON-encoded OperationOutcome resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead.
The conditional update interaction If-None-Match is supported, including the wildcard behaviour, as defined by the R5 spec. This functionality is supported in R4 and R5.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-23 UTC."],[[["\u003cp\u003eThis function \u003ccode\u003eprojects.locations.datasets.fhirStores.fhir.update\u003c/code\u003e updates the entire contents of a FHIR resource, adhering to the FHIR standard update interaction (DSTU2, STU3, R4).\u003c/p\u003e\n"],["\u003cp\u003eIf the resource doesn't exist and \u003ccode\u003eenableUpdateCreate\u003c/code\u003e is set in the FHIR store, this function will create the resource with the specified ID.\u003c/p\u003e\n"],["\u003cp\u003eThe request must include a JSON-encoded FHIR resource in the body and \u003ccode\u003eContent-Type: application/fhir+json\u003c/code\u003e in the headers, with an \u003ccode\u003eid\u003c/code\u003e element matching the ID in the request's REST path.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful update, the response will contain a JSON-encoded representation of the updated resource, including the server-assigned version ID.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization to use this function requires the \u003ccode\u003ehealthcare.fhirResources.update\u003c/code\u003e IAM permission and one of the specified OAuth scopes (\u003ccode\u003ehttps://www.googleapis.com/auth/cloud-healthcare\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e).\u003c/p\u003e\n"]]],[],null,["# Method: fhir.update\n\n**Full name**: projects.locations.datasets.fhirStores.fhir.update\n\nUpdates the entire contents of a resource.\n\nImplements the FHIR standard update interaction ([DSTU2](https://hl7.org/fhir/DSTU2/http.html#update), [STU3](https://hl7.org/fhir/STU3/http.html#update), [R4](https://hl7.org/fhir/R4/http.html#update), [R5](https://hl7.org/fhir/R5/http.html#update)).\n\nIf the specified resource does not exist and the FHIR store has [enableUpdateCreate](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores#FhirStore.FIELDS.enable_update_create) set, creates the resource with the client-specified ID. It is strongly advised not to include or encode any sensitive data such as patient identifiers in client-specified resource IDs. Those IDs are part of the FHIR resource path recorded in Cloud Audit Logs and Pub/Sub notifications. Those IDs can also be contained in reference fields within other resources.\n\nThe request body must contain a JSON-encoded FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. The resource must contain an `id` element having an identical value to the ID in the REST path of the request.\n\nOn success, the response body contains a JSON-encoded representation of the updated resource, including the server-assigned version ID. Errors generated by the FHIR store contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error might be returned instead.\n\nThe conditional update interaction If-None-Match is supported, including the wildcard behaviour, as defined by the R5 spec. This functionality is supported in R4 and R5.\n\nFor samples that show how to call `update`, see [Updating a FHIR resource](https://cloud.google.com/healthcare/docs/how-tos/fhir-resources#updating_a_fhir_resource).\n\n### HTTP request\n\n`PUT https://healthcare.googleapis.com/v1/{name=projects/*/locations/*/datasets/*/fhirStores/*/fhir/*/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains an instance of [HttpBody](/healthcare-api/docs/reference/rest/Shared.Types/HttpBody).\n\n### Response body\n\nIf successful, the response is a generic HTTP response whose format is defined by the method.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-healthcare`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]