Individual Health Record Deletion
Application APIs
This guide demonstrates how to delete permitted FHIR resources at the user scope level using GraphQL mutations.
Prerequisites
- End-User Authentication - User must be authenticated
- Account Creation and Consent - User account must be created
- Health Record Retrieval - User's health records must already be connected and retrieved
Environment URL:
- Client-Sandbox:
https://api.client-sandbox.icanbwell.com/v1/graphql
Workflow Steps
Step 1: Determine Resource ID for Deletion
Identify the id of the FHIR resource you intend to delete. This is typically obtained from a prior query or from the resource retrieval workflow. The id must be provided in uuid format.
Step 2: Send Delete Mutation for Resource
Use the resource-specific delete mutation with the associated id to indicate a resource should be deleted. Delete mutation operations follow the naming pattern delete<ResourceName>(id: ID!).
GraphQL Mutation (deleting a Condition resource with id abc123):
mutation {
deleteCondition(id: "abc123") {
resourceType
issue {
severity
code
details {
text
coding {
system
code
display
}
}
}
}
}Deletable Resources
A subset of FHIR resources currently support delete mutations. This list will be expanded over time.
- AllergyIntolerance
- CarePlan
- Condition
- Encounter
- Immunization
- Observation
- Procedure
- DocumentReference
- Binary
- MedicationDispense
- MedicationRequest
- MedicationStatement
- DiagnosticReport
- ExplanationOfBenefit
- Goal
- ImagingStudy
- MedicationAdministration
- ServiceRequest
- Specimen
For complete query parameters and response schema, see b.well's GraphQL Playground documentation.
Additional Information
- The delete operation is asynchronous. The id passed will be validated at a primitive level (proper GUID format), but the mutation returns a consistent response regardless of whether the resource exists.
- Delete operations can create dangling references. A dangling reference occurs when other resources reference the resource under deletion — the system does not automatically clean up or invalidate these references at this time.
- Deleted resources will NOT be included in subsequent data retrieval attempts for the user.
- Currently, the only way to "un-delete" a resource (permit it to reappear after deletion) is to delete the entire account and reconnect the data source through a new account.
Updated 6 days ago
