Pseudonymising Mental Health Detention Papers – UK GDPR-compliant anonymisation per Mental Health Act 1983

Mental health detention documentation is a statutory record under the Mental Health Act 1983 (s.2/s.3), constituting special-category health data under UK GDPR Art. 9 and DPA 2018 Sch.1. Around 53,000 detention episodes occur in England per year; records are retained for 20 years under NHS RMC 2023. anonym.legal pseudonymises patient, Nearest Relative, and clinician identifiers, preserving the statutory basis for legal review.

When this applies

This task applies when detention papers are reviewed by mental health tribunals, independent reviewing solicitors, or academic researchers analysing detention patterns, and those reviewers require the clinical and statutory content of the documentation but not the identities of individual patients or their relatives. After-care obligations under MHA 1983 s.117 can extend record-processing requirements well beyond the initial detention period.

  1. Upload the detention assessment documentation (PDF or DOCX) to anonym.legal.
  2. The engine identifies patient name, date of birth, address, NHS number, Nearest Relative name and relationship, and the names of the approved mental health professional and responsible clinician.
  3. Each named individual is pseudonymised with a consistent pseudonym; the statutory basis and clinical assessment narrative are preserved in clear text.
  4. Detention duration, renewal dates, and statutory review timelines are preserved.
  5. A reversible mapping table is produced with UK data residency, accessible only to the Data Controller.
  6. The pseudonymised documentation is released for approved review; the mapping key is retained for re-identification when required for tribunal proceedings.

What you provide

  • Mental health assessment and detention recommendation documents
  • Nearest Relative notification correspondence (if included)
  • Any accompanying care plan or risk-assessment documentation

Limitations & cautions

  • Detention documentation submitted to the Mental Health Tribunal Service must contain the patient's real identity — the pseudonymised version is for pre-submission review only.
  • The DPA 2018 Schedule 1 Part 1 health condition requires processing to be for health or social care purposes; confirm the lawful basis before using pseudonymised records for secondary analysis. Breaches can attract fines of up to £17.5 million or 4% of annual global turnover under DPA 2018 s.157.
  • The tool pseudonymises personal data but does not assess the legal sufficiency of the detention criteria — obtain specialist mental health law advice. Mental health records must be retained for 20 years from the end of treatment under the NHS Records Management Code of Practice 2023.

FAQ

Can pseudonymised detention papers be used for academic research on compulsory admission rates?

Pseudonymised papers may be suitable for research under an HRA-approved protocol — the Health Research Authority approves around 6,000 research projects per year in the UK. Formal anonymisation or a section 251 NHS Act 2006 support waiver may be required depending on the research design. Consult the Health Research Authority before commencing.

Are Nearest Relative details pseudonymised as well as patient details?

Yes. Named Nearest Relatives and their stated relationship to the patient are pseudonymised individually; the relationship type (e.g. spouse, parent) is preserved to maintain the statutory context. The 8 Caldicott Principles (updated 2013, Principle 8 added 2020) require that only the minimum necessary data is disclosed.

Does the engine handle documentation completed on different statutory forms?

Yes. The engine detects named individuals irrespective of the form layout. Different statutory forms — including s.2 assessment forms, s.3 treatment order forms, and s.117 after-care plans — are processed in the same batch with consistent pseudonymisation.

What retention period applies to mental health detention records?

Under the NHS Records Management Code of Practice 2023, mental health records must be retained for 20 years from the end of treatment, or 8 years after the patient's death. Where s.117 after-care obligations are ongoing, the retention period runs from the end of after-care rather than discharge from hospital.

Healthcare Records

About this page

We update this page when our platform or the law changes.

Read our founder note for how we work.

Each change shows up in the timestamp at the top.

We follow these rules

  • GDPR (EU 2016/679).
  • ISO/IEC 27001:2022.
  • NIS2 (EU 2022/2555).
  • HIPAA safe harbor under 45 CFR § 164.514(b)(2).

Our promise

We do not sell your data.

We do not train models on your text.

We store your files in Germany.

You can delete your account at any time.

You own your work.

Where we run

Our company HQ is in Saarbrücken, Germany. Our servers run in Hetzner's Falkenstein datacenter.

Hetzner holds ISO 27001 certification.

All data stays in the EU.

Backups run every day.

Need help?

Email support@anonym.legal.

We reply within one business day.

How we test

We run a full check suite on every release.

Each surface gets its own sweep script and report.

Human reviewers spot-check the output each week.

We track recall and precision on a labelled set.

Bad runs block the deploy.

What we never do

  • We never sell your information to third parties.
  • We never train models on what you upload.
  • We never keep your work after you delete it.
  • We never share keys with any outside firm.
  • We never run ads inside the product.

Plans in plain words

We sell credits, not seats.

One credit covers one short job.

Long jobs use a few credits each.

You can top up at any time.

Unused credits roll over each month.

Read the plans page for current rates.

Who built this

A small team of engineers and lawyers built this.

We ship from Europe and work in the open.

Our founder note spells out why we started.

Where to start

How the parts fit

A browser add-on cleans text inside Chrome.

A Word plug-in handles drafts in Office.

A small desktop tool works on whole folders.

An agent protocol link feeds large models safely.

All four share one core engine and one rule set.

Words from our team

We started this work after a lunch about cookies.

One friend kept getting odd ads on her phone.

We asked why a court file leaked through a draft.

We sketched the first build on a napkin that week.

By month three we had a tiny demo for a friend.

She used it on her first case the next day.

Common questions we hear

Can the tool read scanned PDFs? Yes, with OCR.

Does it work on long files? Yes, in small chunks.

Can I roll my own rule set? Yes, save it as a preset.

Does it run offline? The desktop build runs offline.

Do you keep my files? No, the cloud build wipes after each run.

Will it learn from my work? No, we never train on inputs.

A short tour of the workflow

Upload a file or paste a snippet of prose.

Pick the entities you want gone from the draft.

Choose a method: replace, mask, hash, encrypt, or redact.

Press run and watch the side panel show each hit.

Skim the result and tweak any rule that misfired.

Save the cleaned file or send it to a teammate.