The MRN Format Problem
The US has around 6,100 hospitals. Each runs its own EHR system. Each uses its own Medical Record Number format. No national standard exists. The Joint Commission requires that hospitals can identify patients — but sets no format rules.
Formats vary widely. Some are 7-digit integers. Others are 8-digit integers. Some use prefix codes like HOSP-, MRN-, or PT-. Others add institution codes like SVHS- or CHOP-. Some embed the enrollment year in the number.
HIPAA Safe Harbor lists patient record numbers as identifier type 8 of 18. (45 CFR §164.514(b)(2)) All 18 must be removed. The rule does not limit this to any one format. If your hospital uses a custom format, you must detect it. A tool that misses it fails Safe Harbor — even if it removes all 17 other types.
Why the Code Approach Fails
The standard way to add a custom record number format to a de-identification pipeline is to extend Microsoft Presidio. That means writing Python.
A developer creates a class that extends EntityRecognizer. They write the regex, wire it into Presidio's registry, test it, and maintain it. For compliance teams — who rarely code — this is a hard block. Every format change needs an engineer.
Healthcare engineers are busy. They focus on EHR integration and clinical systems. Compliance tooling is rarely their top priority.
The No-Code Pattern Workflow
The guided pattern approach removes the coding step.
A compliance officer opens the Custom Entity Creator in the web app. They paste five sample numbers from their system — for example:
SVHS-0012345
SVHS-0987654
SVHS-1122334
SVHS-4455667
SVHS-8899001
They click Generate Pattern. The AI reads the structure and returns:
- Pattern:
SVHS-\d{7} - Confidence: high
- Suggested name:
HOSPITAL-MRN - Suggested replacement:
[MRN]
The officer pastes five more samples. The pattern passes. They save it to the HIPAA preset.
From that point, every session — web app, Office Add-in, Desktop App, and API — detects this format in the standard PHI pass. No code needed.
GDPR Research Note
GDPR Article 89 requires pseudonymization for research datasets. Custom entities put institution-specific identifiers in scope — closing the gap that generic tools leave open.
What You Get
This workflow takes one afternoon. Custom code takes weeks.
The compliance officer defines the pattern, tests it, and deploys it. No ticket. No wait. The preset holds the custom entity next to the standard 17 Safe Harbor identifiers.
When the next batch of clinical notes runs, all 18 identifier types are covered. Safe Harbor is complete.
See HIPAA Safe Harbor de-identification for healthcare research for how Safe Harbor works in practice. For hospital-specific detection patterns, see detecting hospital-specific MRN formats without engineering.