feat(analyzer): Add Healthcare identifiers recognizer - #2159
feat(analyzer): Add Healthcare identifiers recognizer#2159bhargavikalicheti wants to merge 5 commits into
Conversation
|
Hi @SharonHart @omri374 , No rush - gentle reminder on PR whenever you get a chance. Thank you! |
There was a problem hiding this comment.
Pull request overview
Adds a set of conservative, disabled-by-default US healthcare identifier recognizers to Presidio Analyzer, aiming to detect common healthcare administrative IDs only when appropriate workflow context is present (to reduce false positives in general alphanumeric/ID-like text).
Changes:
- Introduces new US healthcare admin ID recognizers (claim, prior auth, prescription, referral, provider tax ID) plus a health insurance member ID recognizer, all requiring nearby context.
- Wires the new recognizers into predefined recognizer exports and default registry YAML (disabled by default).
- Adds unit tests, supported-entities documentation entries, and changelog notes for the new entities/recognizers.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| presidio-analyzer/tests/test_us_healthcare_admin_recognizers.py | New tests for healthcare admin ID recognizers (positive/negative context + metadata). |
| presidio-analyzer/tests/test_us_health_insurance_member_id_recognizer.py | New tests for health insurance member ID recognizer detection behavior and metadata. |
| presidio-analyzer/presidio_analyzer/predefined_recognizers/country_specific/us/us_healthcare_admin_recognizers.py | Adds context-required pattern recognizer base + concrete admin ID recognizers. |
| presidio-analyzer/presidio_analyzer/predefined_recognizers/country_specific/us/us_health_insurance_member_id_recognizer.py | Adds context-required member/subscriber ID recognizer with negative-context pruning. |
| presidio-analyzer/presidio_analyzer/predefined_recognizers/country_specific/us/init.py | Exports the new US healthcare recognizers from the US package. |
| presidio-analyzer/presidio_analyzer/predefined_recognizers/init.py | Exposes the new recognizers via the top-level predefined_recognizers import surface. |
| presidio-analyzer/presidio_analyzer/conf/default_recognizers.yaml | Registers the recognizers as predefined + disabled-by-default with country_code: us. |
| docs/supported_entities.md | Documents the new supported entity types and brief descriptions. |
| CHANGELOG.md | Notes new analyzer recognizers under Unreleased. |
omri374
left a comment
There was a problem hiding this comment.
Thanks! Please add references to be able to trace where the regex pattern is coming from, and see the comment around context management.
|
@SharonHart @omri374 Hi! Just a friendly follow up on my PR whenever you have a chance. I'd appreciate a review when your schedule allows. Please let me know if there are any changes you'd like me to make. Thanks! |
Change Description
Adds conservative, context-aware US healthcare identifier recognizers to Presidio Analyzer.
New disabled-by-default recognizers:
US_HEALTH_INSURANCE_MEMBER_IDUS_PRIOR_AUTHORIZATION_NUMBERUS_CLAIM_NUMBERUS_PRESCRIPTION_NUMBERUS_REFERRAL_NUMBERUS_PROVIDER_TAX_IDThese recognizers require both a plausible identifier pattern and nearby healthcare/insurance workflow context to reduce false positives. They also include negative-context checks for similar-looking non-healthcare IDs such as order numbers, tracking numbers, case numbers and invoice numbers where applicable.
Issue reference
Fixes Feature Request: Healthcare Recognizer for Common Healthcare Identifiers (Member ID, Claims, Prior Authorization, etc.)
#2136
Checklist