Delete Resource Instance
The FHIR delete operation allows you to delete a specific resource instance from the FHIR server. This is done using an HTTP DELETE request to the endpoint corresponding to the resource type and ID.
- CLI
- TypeScript
- cURL
Delete a Patient resource using the Haste Health CLI:
haste-health api delete-instance Patient 12345
The CLI will prompt for confirmation before deleting the resource.
Delete a Patient resource using the TypeScript client:
import { AsynchronousClient } from '@haste-health/client';
import { R4 } from '@haste-health/fhir-types/versions';
// Assuming you have a configured client
const client: AsynchronousClient<{}> = /* ... */;
await client.delete_instance(
{},
R4,
'Patient',
'12345'
);
console.log('Patient deleted successfully');
Delete a Patient resource using cURL:
curl -X DELETE "https://api.haste.health/w/[tenant]/[project]/api/v1/fhir/r4/Patient/12345" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Replace [tenant] with your tenant name and [project] with your project ID.