Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.fhir.create
Creates a FHIR resource.
Implements the FHIR standard create interaction (DSTU2, STU3, R4, R5), which creates a new resource with a server-assigned resource ID.
Also supports the FHIR standard conditional create interaction (DSTU2, STU3, R4, R5), specified by supplying an If-None-Exist header containing a FHIR search query, limited to searching by resource identifier. If no resources match this search query, the server processes the create operation as normal.
When using conditional create, the search term for identifier should be in the pattern identifier=system|value or identifier=value - similar to the search method on resources with a specific identifier.
The request body must contain a JSON-encoded FHIR resource, and the request headers must contain Content-Type: application/fhir+json.
On success, the response body contains a JSON-encoded representation of the resource as it was created on the server, including the server-assigned resource ID and 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.
Required. The name of the FHIR store this resource belongs to.
Authorization requires the following IAM permission on the specified resource parent:
healthcare.fhirResources.create
type
string
Required. The FHIR resource type to create, such as Patient or Observation. For a complete list, see the FHIR Resource Index (DSTU2, STU3, R4, R5). Must match the resource type in the provided content.
Request body
The request body contains an instance of HttpBody.
Response body
If successful, the response is a generic HTTP response whose format is defined by the method.
[[["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 service method \u003ccode\u003eprojects.locations.datasets.fhirStores.fhir.create\u003c/code\u003e facilitates the creation of new FHIR resources within a designated FHIR store using the FHIR standard create interaction.\u003c/p\u003e\n"],["\u003cp\u003eIt also supports FHIR standard conditional create interactions, allowing resource creation based on the absence of matching resources when an \u003ccode\u003eIf-None-Exist\u003c/code\u003e header is provided with a search query.\u003c/p\u003e\n"],["\u003cp\u003eThe request must include a JSON-encoded FHIR resource in the body, with \u003ccode\u003eContent-Type: application/fhir+json\u003c/code\u003e specified in the headers.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful creation returns a JSON-encoded representation of the resource with a server-assigned ID and version, while errors return a JSON-encoded \u003ccode\u003eOperationOutcome\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe method requires specific IAM permissions (\u003ccode\u003ehealthcare.fhirResources.create\u003c/code\u003e) and 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) for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: fhir.create\n\n**Full name**: projects.locations.datasets.fhirStores.fhir.create\n\nCreates a FHIR resource.\n\nImplements the FHIR standard create interaction ([DSTU2](https://hl7.org/fhir/DSTU2/http.html#create), [STU3](https://hl7.org/fhir/STU3/http.html#create), [R4](https://hl7.org/fhir/R4/http.html#create), [R5](https://hl7.org/fhir/R5/http.html#create)), which creates a new resource with a server-assigned resource ID.\n\nAlso supports the FHIR standard conditional create interaction ([DSTU2](https://hl7.org/fhir/DSTU2/http.html#ccreate), [STU3](https://hl7.org/fhir/STU3/http.html#ccreate), [R4](https://hl7.org/fhir/R4/http.html#ccreate), [R5](https://hl7.org/fhir/R5/http.html#ccreate)), specified by supplying an `If-None-Exist` header containing a FHIR search query, limited to searching by resource identifier. If no resources match this search query, the server processes the create operation as normal.\n\nWhen using conditional create, the search term for identifier should be in the pattern `identifier=system|value` or `identifier=value` - similar to the [`search`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores.fhir/search#google.cloud.healthcare.v1.fhir.rest.FhirService.SearchResources) method on resources with a specific identifier.\n\nThe request body must contain a JSON-encoded FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`.\n\nOn success, the response body contains a JSON-encoded representation of the resource as it was created on the server, including the server-assigned resource ID and 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\nFor samples that show how to call `create`, see [Creating a FHIR resource](https://cloud.google.com/healthcare/docs/how-tos/fhir-resources#creating_a_fhir_resource).\n\n### HTTP request\n\n`POST https://healthcare.googleapis.com/v1/{parent=projects/*/locations/*/datasets/*/fhirStores/*}/fhir/{type}`\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)."]]