Skip to main content

core.medplumclient.deleteresource

Home > @medplum/core > MedplumClient > deleteResource

MedplumClient.deleteResource() method

Deletes a FHIR resource by resource type and ID.

Signature:

deleteResource(resourceType: ResourceType, id: string, options?: MedplumRequestOptions): Promise<any>;

Parameters

ParameterTypeDescription
resourceTypeResourceTypeThe FHIR resource type.
idstringThe resource ID.
optionsMedplumRequestOptions(Optional) Optional fetch options.

Returns:

Promise<any>

The result of the delete operation.

Example

Example:

await medplum.deleteResource('Patient', '123');

See the FHIR "delete" operation for full details: https://www.hl7.org/fhir/http.html\#delete