How to delete all resources for a given patient id?

R, Bharathkumar 5 Reputation points
2025-04-02T11:00:12.3966667+00:00

we want to delete all data for a given patientid in Azure Fhir Service. our current approach is getting all the data and issuing delete requests to fhir service for each resourceid received. is there any better approach for this?

Azure Health Data Services
Azure Health Data Services
An Azure offering that provides a suite of purpose-built technologies for protected health information in the cloud.
191 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 5,990 Reputation points Microsoft External Staff Moderator
    2025-04-02T11:11:04.8866667+00:00

    @R, Bharathkumar ,

    To delete all resources for a given patient ID in Azure FHIR Service, you can utilize the $bulk-delete operation, which allows you to delete multiple resources in a single request. This approach is more efficient than issuing individual delete requests for each resource ID.

    Here's how you can do it:

    1. Use the $bulk-delete operation at the system level or for individual resource types.
    2. You can specify search criteria to filter the resources you want to delete, such as using the patient's identifier.

    For example, you can execute a request like this to delete all resources associated with a specific patient ID:

    DELETE /Patient/$bulk-delete?identifier=patient_id
    

    Make sure to include the necessary headers and ensure that the user or application has the required roles to perform the bulk delete operation.

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know


    References:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.