How to Remove PHI From Medical Documents Before Using AI
A practical workflow for protecting patient identifiers in medical documents before sending them to an AI system, including structured data, free text, dates, images and clinical case reports.
Start with the distinction between redaction, pseudonymization, and de-identification
| Approach | What it does | Typical AI use |
|---|---|---|
| Redaction | Removes or obscures information. | Useful when the information is not needed at all. |
| Pseudonymization | Replaces identity with consistent tokens while retaining a controlled mapping. | Useful when relationships and continuity matter. |
| HIPAA de-identification | Meets the HIPAA regulatory standard through Safe Harbor or Expert Determination. | Used when an organization needs information to qualify as de-identified under HIPAA. |
These concepts should not be used interchangeably. HHS describes two HIPAA methods for de-identification: Safe Harbor and Expert Determination. citeturn0search0
Why removing names is not enough
HHS's de-identification guidance explicitly addresses identifiers beyond names, including medical record numbers, dates, geographic information, telephone and fax numbers, email addresses, account numbers, device identifiers, IP addresses, biometric identifiers, full-face photographs and other unique identifying characteristics or codes. citeturn0search0
The guidance also emphasizes that the HIPAA standard applies to information in free text, not only structured database fields. Clinical narratives can contain rich contextual information that makes a patient identifiable. citeturn0search0
A practical workflow for protecting a medical document before AI
Identify whether the source is a clinical note, discharge summary, laboratory report, case report, referral, claim, scanned document, PDF, image, or another format.
Do not inspect only the visible text layer. Scanned pages, embedded images, signatures, headers, footers and tables may contain identifying information.
Look for names, addresses, phone numbers, emails, MRNs, health-plan identifiers, account numbers, dates, geographic details, URLs, IP addresses, biometrics and other unique identifiers.
Look for narrative clues such as occupation, rare events, unusual procedures, family relationships, specific locations, or combinations of facts that could identify the patient.
Not every sensitive field must be removed if it is necessary and appropriately governed for the intended task. The objective is controlled minimization, not indiscriminate destruction of context.
Redact unnecessary information or replace it with consistent placeholders when the relationship needs to be preserved.
Run a second privacy inspection. Check the body, tables, headers, footers, metadata, OCR text and images.
Keep the original document and identity mapping outside the AI-facing workflow.
Worked example: a clinical case report
This is where the third proposed article fits naturally. A case report is an excellent example because the clinical narrative itself is valuable. Removing too much information can destroy the educational or analytical purpose of the case.
“A 52-year-old patient, Maria Rodriguez, living at 18 Oak Street, presented to St. Mary's Hospital on 14 May 2026. Her MRN was 483920. She worked as the chief financial officer of a regional company and had previously been treated by Dr. James Patel...”
“A 52-year-old patient, [PATIENT_001], presented to [FACILITY_001] on [DATE_001]. Her medical record number was [MRN_001]. She worked as a senior executive and had previously been treated by [PROVIDER_001]...”
The protected version retains the chronology and relationships while reducing direct identifiers. Whether particular facts should be retained depends on the purpose of the case and the applicable privacy standard.
Why consistent placeholders are useful
Suppose a clinical report refers to the patient 20 times. Replacing the name with “[REDACTED]” everywhere preserves less semantic structure than replacing it consistently with [PATIENT_001].
The same principle can apply to other entities:
[PATIENT_001]— the same patient throughout the document[PROVIDER_001]— the same clinician throughout the document[FACILITY_001]— the same facility throughout the document[DATE_001]— a date whose exact value is unnecessary but whose relationship matters
Dates deserve special attention
Dates can be clinically important and privacy-sensitive at the same time. Under the HIPAA Safe Harbor method, many dates directly related to the individual are among the identifiers addressed by the rule. At the same time, chronology can be essential to clinical reasoning.
For an AI workflow, a date can sometimes be transformed rather than simply deleted — for example, preserving relative sequence or a controlled time representation where the task allows it. Whether such a transformation satisfies a particular legal de-identification standard is a separate compliance question and should not be assumed.
Free text is one of the hardest problems
Structured fields are comparatively straightforward: a field labeled “Medical Record Number” can be detected as an MRN. Free text is harder.
A clinician may write:
No single phrase necessarily looks like a standard identifier. Together, however, the details may make the person recognizable. HHS specifically warns that clinical narratives can contain rich contextual information that readily allows patient identification. citeturn0search0
What about physician and facility names?
HIPAA's Safe Harbor method does not require every provider or workforce member name to be removed simply because it is a person's name. HHS explains that the names of the individuals associated with the health information — including patients and specified related individuals — are the focus of the Safe Harbor identifier requirement, while provider/workforce names are not automatically required to be removed. citeturn0search0
However, organizations may have additional confidentiality, employment, contractual, or policy reasons to protect professional identities. AI workflows should therefore define their protection policy explicitly rather than assuming that the HIPAA Safe Harbor list is the only information that matters.
Scanned PDFs and images create another layer
A document may contain PHI that is invisible to a conventional text-only extraction pipeline: a scanned admission form, handwritten note, photograph, signature, embedded image, or image-based table.
A practical protection system therefore needs document-aware inspection, OCR where appropriate, and a final validation pass on the rendered document — not just a regular-expression scan of extracted text.
How to validate the protected document
Text layer
Search for names, identifiers, dates, contact information and residual narrative clues.
Structure
Inspect tables, headers, footers, captions, notes and document metadata.
Visual content
Inspect scans, photographs, signatures, charts and embedded images.
Consistency
Confirm the same person or entity receives the same placeholder throughout the document.
A useful checklist before sending a medical document to AI
- Have patient names and aliases been protected?
- Have MRNs and other healthcare identifiers been protected?
- Have dates been evaluated rather than blindly ignored?
- Have addresses and contact information been checked?
- Has free-text narrative been reviewed for identifying clues?
- Have images, scans, signatures and photographs been inspected?
- Have headers, footers, tables and metadata been checked?
- Does the protected document still preserve the clinical context needed for the AI task?
- Is the identity mapping stored separately from the AI-facing document?
- Has the final protected copy been validated before transmission?
Important: “anonymized” is not always the right word
If your system replaces Maria Rodriguez with [PATIENT_001] and retains a private mapping that can restore Maria Rodriguez later, the result is not necessarily anonymous.
For product and policy language, protected, pseudonymized, or identity-protected may be more precise. True legal de-identification under HIPAA has a defined standard, and GDPR separately distinguishes pseudonymisation from anonymisation.
Where IdentityVeil fits
The IdentityVeil model is deliberately built around the separation between identity and context. The original values remain in a controlled private vault while the AI-facing copy uses consistent placeholders.
That makes the clinical case-report scenario a concrete example of the broader architecture: the AI receives the information required for the task, while the organization retains control over the identity layer.
Key takeaway
Removing PHI before using AI should be treated as a document-protection workflow, not a simple find-and-delete operation. The best workflow understands the document, detects both structured and unstructured identifiers, protects unnecessary identity, preserves useful relationships, validates the result, and keeps restoration under appropriate control.
Sources & further reading
Protect the identity. Preserve the context.
IdentityVeil is designed around a simple principle: protect sensitive identity information while preserving the context needed for useful AI work.
Learn about IdentityVeil →