Deleting a FHIR resource - AWS HealthLake

Deleting a FHIR resource

The FHIR delete interaction removes an existing FHIR resource from a HealthLake data store. For additional information, see delete in the FHIR R4 RESTful API documentation.

To delete a FHIR resource

  1. Collect HealthLake region and datastoreId values. For more information, see Getting data store properties.

  2. Determine the type of FHIR Resource to delete and collect the associated id value. For more information, see Resource types.

  3. Construct a URL for the request using the collected values for HealthLake region and datastoreId. Also include the FHIR Resource type and its associated id. To view the entire URL path in the following example, scroll over the Copy button.

    DELETE https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Resource/id
  4. Send the request. The FHIR delete interaction uses a DELETE request with either AWS Signature Version 4 or SMART on FHIR authorization. The following curl example removes an existing FHIR Patient resource from a HealthLake data store. To view the entire example, scroll over the Copy button.

    curl

    SigV4 authorization

    curl --request DELETE \ 'https://healthlake.region.amazonaws.com/datastore/datastoreId/r4/Patient/id \ --aws-sigv4 'aws:amz:region:healthlake' \ --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \ --header "x-amz-security-token:$AWS_SESSION_TOKEN" \ --header 'Accept: application/json'

    The server returns a 204 HTTP status code confirming the resource has been removed from the HealthLake data store. If a delete request fails, you will receive a 400 series HTTP status code indicating why the request failed.

    AWS Console

    1. Sign in to the Run query page on the HealthLake Console.

    2. Under the Query settings section, make the following selections.

    • Data Store ID — choose a data store ID to generate a query string.

    • Query type — choose Delete.

    • Resource type — choose the FHIR resource type to delete.

    • Resource ID — enter the FHIR resource ID.

    3. Choose Run query.