Deleting data

The FHIR delete operation performs a "logical" delete. This means that data is not physically removed from the database.

For example, Patient resource with ID 123 is created (via an HTTP POST /Patient) and subsequently deleted (via an HTTP DELETE Patient/123). This causes a second version of the Patient/123 resource to be created with version Patient/123/_history/2 that is marked as deleted.

This patient no longer appears in search results and attempts to read the resource (using an HTTP GET Patient/123) fails with an "HTTP 410 Gone" response.

The original content of the resource is not destroyed, however. It can still be found using two FHIR operations:

  • Using a FHIR version-specific read: GET Patient/123/_history/1
  • Using a FHIR instance-history: GET Patient/123/_history

Note that HTTP 410 Gone responses include a Location header containing the fully qualified resource ID as well as the version ID.

Example: DELETE 410 Gone response with a Location Header

Figure 11-1 Status Code: 410 Gone Response


Status Code: 410 Gone

Example: DELETE 410 Gone response with latest non-deleted version

In this example, we can see that the deleted version of the resource is version 2. This means that the last non-deleted version is version 1, and this could be accessed using a version-specific read to the following URL:


Example: DELETE 410 Gone response with latest non-deleted version