Delete Patient Data

You can use the 1up Purge endpoint to delete resources for a 1up user ID for a specific FHIR® version (DSTU2, STU3, or R4) from the 1up FHIR Server. You can delete all resources or apply parameters to delete specific resources. When you delete resources, the Purge operation also deletes the resource history versions.

The Purge operation cannot be undone and the resources you delete cannot be recovered. We recommend that you use extreme caution with the Purge operation.

You can access the Purge endpoint using either a Bearer token, or using header-based authentication.

The client ID and client secret you use in the request defined below must have created the 1up user ID which you are attempting to purge data from. You can't purge the data for a 1up user that you didn't create under your own application (client ID and client secret).

If you don’t specify the _type and or _before parameter, the Purge endpoint deletes all of the FHIR resources (all types) for the specified 1up user for a particular FHIR version (DSTU2, STU3, or R4). If you specify the _type parameter, only resource of that resource type are deleted. If you specify the _before parameter, all resources with a meta.lastUpdated date that is less than the date you specify in the _before filter are deleted.

Purge doesn’t delete the 1up user, which remains in the FHIR Server after the Purge operation completes, but without the FHIR resources you deleted.

You cannot use Purge to delete all of the resources for a user with a large volume of resources (such as 400K patients). A request of this size won’t complete because the synchronous Purge request can only run for 30 seconds before it times out.

When you receive a timeout, resources that were deleted before the request timed out remain deleted. You can run the same Purge operation again until the amount of remaining resources to purge can be deleted within the 30 second time limit.

Purge Data with Bearer Token Authentication

You can connect to the Purge endpoint and start a Purge operation using a 1up access token.

If you don’t already have an access token, follow the steps in Authentication & Authorization APIs to get a token.

After you get your access token, you can send your Purge request.

Purge Data with Header Authentication

You can connect to the Purge endpoint and start a Purge operation for a 1up user ID with header authentication.

If you don’t have the oneup_user_id for your app_user_id, follow the steps in User Management APIs to get the user ID.

After you get the user ID, you can send your Purge request.