Stay organized with collections
Save and categorize content based on your preferences.
Full name: projects.locations.datasets.fhirStores.fhir.conditionalDelete
Deletes a FHIR resource that match an identifier search query.
Implements the FHIR standard conditional delete interaction, limited to searching by resource identifier. If multiple resources match, 412 Precondition Failed error will be returned.
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.
Note: Unless resource versioning is disabled by setting the disableResourceVersioning flag on the FHIR store, the deleted resource is moved to a history repository that can still be retrieved through vread and related methods, unless they are removed by the purge 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 function, \u003ccode\u003econditionalDelete\u003c/code\u003e, deletes a FHIR resource by matching an identifier search query, using the pattern \u003ccode\u003eidentifier=system|value\u003c/code\u003e or \u003ccode\u003eidentifier=value\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIf multiple resources match the search query, the operation will return a 412 Precondition Failed error, indicating that the deletion cannot proceed with the current parameters.\u003c/p\u003e\n"],["\u003cp\u003eDeleted resources are moved to a history repository and can be retrieved unless resource versioning is disabled in the FHIR store settings.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request for this operation is a \u003ccode\u003eDELETE\u003c/code\u003e request directed to a specific URL, where the \u003ccode\u003eparent\u003c/code\u003e parameter specifies the FHIR store and the \u003ccode\u003etype\u003c/code\u003e parameter specifies the resource type to delete.\u003c/p\u003e\n"],["\u003cp\u003eThis function requires authorization through IAM permissions, specifically the \u003ccode\u003ehealthcare.fhirResources.delete\u003c/code\u003e permission on the parent resource and one of the specified OAuth scopes.\u003c/p\u003e\n"]]],[],null,["# Method: fhir.conditionalDelete\n\n**Full name**: projects.locations.datasets.fhirStores.fhir.conditionalDelete\n\nDeletes a FHIR resource that match an identifier search query.\n\nImplements the FHIR standard conditional delete interaction, limited to searching by resource identifier. If multiple resources match, 412 Precondition Failed error will be returned.\n\nSearch 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\nNote: Unless resource versioning is disabled by setting the [disableResourceVersioning](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores#FhirStore.FIELDS.disable_resource_versioning) flag on the FHIR store, the deleted resource is moved to a history repository that can still be retrieved through [vread](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores.fhir/vread#google.cloud.healthcare.v1.fhir.rest.FhirService.GetResourceVersion) and related methods, unless they are removed by the [purge](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.fhirStores.fhir/Resource-purge#google.cloud.healthcare.v1.fhir.rest.FhirService.DeleteResourceVersions) method.\n\nFor samples that show how to call `conditionalDelete`, see [Conditionally deleting a FHIR resource](https://cloud.google.com/healthcare/docs/how-tos/fhir-resources#conditionally_deleting_a_fhir_resource).\n\n### HTTP request\n\n`DELETE 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 must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\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)."]]