Patient data export & deletion (Articles 15 & 17)
Find the safe process for exporting or deleting patient data while keeping your UK clinic’s legal and clinical records in order.
UK GDPR Articles 15 (right of access) and 17 (right to erasure) are both built into the platform.
Article 15 — Patient data export
Every patient can download a copy of all the data we hold on them, in a structured JSON file.
How a patient requests their data
- Sign into the portal
- Open Account → Privacy
- Click Download my data
- The
export-patient-dataEdge Function:- Reads every row referencing the patient
- Generates a JSON file with patient profile, requirements, uploads metadata, cases, prescriptions, orders, comms log, consent records, audit log entries about them
- Returns a signed download URL
- Patient downloads — the export is available for 24 hours
What's in the export
- Their
patientsrow (everything they entered) - Every
patient_requirementsitem + verification status - Every
prescription_requests(cases) row + status - Every
prescriptionsrow + drug / dose / frequency - Every
ordersrow + dispatch / tracking - Every
consent_recordsrow + wording snapshots - Every
documentsrow (metadata + signed URL for download) - Every
patient_measurementsrow - Every
comm_eventsrow sent to them - Every
audit_logsrow with their patient ID as subject
What's NOT in the export
- Clinician notes that are flagged confidential (rare; only applies to safeguarding contexts)
- Server logs and observability data (held separately)
- Internal Stripe / Royal Mail data (held by those processors; patient should request directly from them under their DPAs)
Article 17 — Deletion / Right to be forgotten
A patient can request deletion of their data from the portal.
How a patient requests deletion
- Sign in → Account → Privacy → Delete my data
- They must confirm by typing their email
- A
patient_deletion_requestsrow is created with statuspending
What happens next
A clinic manager reviews the request (some requests must be denied for legal reasons — see below) and either:
- Approves — patient data is anonymised in-place (their
case record stays for clinical audit, but PII is overwritten
with
Anonymised Patient <id>) - Refuses — with a written reason. The patient is notified.
The anonymisation uses the same primitives as
anonymise_tenant (see tenant anonymise) but per-patient.
When can a request be refused?
UK GDPR Article 17 has exceptions. Common ones for clinical data:
- Ongoing clinical care — if the patient has an active prescription, deletion would harm continuity of care
- Legal obligation — UK clinical records retention is typically 10 years for adults
- Public health — adverse-event reports must be kept
The manager writes the refusal reason; the patient sees it + can escalate to the ICO. Both decision and reason are audited.
Self-service vs admin
- Patient triggers — request is created from their portal
- Manager triggers — anonymise an existing patient outside a self-service request (same SQL primitive)
- Platform admin triggers —
anonymise_tenant()for an entire clinic