FHIR Delete a resource

With 1upHealth, you can DELETE any FHIR resource or version from the FHIR _history endpoint.

Here's how you delete a FHIR resource

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

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

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

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

An example delete item's response looks like this:

{
  "resourceType": "OperationOutcome",
  "id": "qk8jk2coi",
  "issue": [
    {
      "severity": "information",
      "code": "value",
      "details": {
        "text": "this resource with id 3ad226c56b9b and version 9000000000002 has been deleted"
      }
    }
  ]
}

After a resource has been deleted it will no longer be returned in search requests. Instead an OperationOutcome pointer to the resource will indicate that it has been deleted. Your application will no longer have the ability to recover that data so please ensure that you use the DELETE mechanism for FHIR resources and version history responsibly. It is your application's responsibility to adhere to requirement of HIPAA subject to backup and data retention policies.