Delete Data

You can delete any of your FHIR® resources or versions from the 1up FHIR Server _history endpoint.

Delete a Single Resource

To delete a single resource, use the following command. It will delete only an individual resource. Past version histories will remain to help apps ensure HIPAA compliance and proper backups. After a resource is deleted, a GET request to the same endpoint will indicate it is no longer available with a 410 GONE status code, according to the FHIR specification.

curl -XDELETE 'https://api.1up.health/dstu2/Patient/{patientId}' \
  -H 'Authorization: Bearer access_token'

Delete the Version History for a Resource

Deleting version history is a capability outside the FHIR specification, but is provided for customers to allow for their specific requirements. Once a resource AND its history are deleted, the information is not recoverable. Deleting a resource's version history will permanently delete the resource's version history. When the resource's version history is deleted AND the resource is deleted, then reading the resource explicitly by its id will return a 404 NOT FOUND status code as though the resource had never existed

To delete a FHIR resource's version history use the following command. Each individual version history item must be deleted explicitly using this command.

curl -XDELETE 'https://api.1up.health/dstu2/Patient/{patientId}/_history/{versionId}' \
  -H 'Authorization: Bearer access_token'

After a resource has been deleted it will no longer be returned in search requests. For an explicit read request of the deleted resource by it's id, an OperationOutcome will be returned with status code 410, indicating that the resource has been deleted. The previous state of the resource will still be available through a versioned read of its history

Examples — Create & Delete a Resource

The following examples show how to create a patient resource, show the resource you created, and delete the same patient resource and resources history.