Implement HIPAA-compliant Protected Health Information (PHI) handling for OpenEvidence clinical AI integrations. Covers PHI detection, de-identification, encrypted storage, retention policies, and audit trails.
| Category | Examples | Handling |
|---|---|---|
| PHI Identifiers | Name, DOB, SSN, MRN | Never send to OpenEvidence |
| Clinical Data | Conditions, medications | May send de-identified |
| Query Results | Answers, citations | Cache with encryption, audit access |
| Audit Logs | User actions, timestamps | Retain 6 years, encrypt |
Create regex patterns for SSN, MRN, phone, email, DOB, dates, names, and addresses. Auto-detect and replace with [TYPE_REDACTED] placeholders before any API call.
Map exact ages to ranges (infant/child/adolescent/young-adult/adult/middle-aged/elderly). Map specific conditions to categories (cardiovascular, metabolic, respiratory). Map medications to drug classes.
Use AES-256-GCM encryption for all cached OpenEvidence responses. Store IV + AuthTag + ciphertext. Implement EncryptedCacheStore wrapping Redis.
Log all PHI access with userId, userRole, action, resourceId, encrypted IP and userAgent. Support filtered queries with pagination for compliance review.
| Data Issue | Detection | Resolution |
|---|---|---|
| PHI detected in query | Pattern matching | Auto-sanitize and warn |
| Decryption failure | Cache read error | Delete corrupted entry, re-query |
| Retention job fails | Cron monitoring | Check database permissions, re-run |
| Audit gap | Compliance review | Add middleware to missing routes |
Names, geographic data, dates, phone/fax, email, SSN, MRN, health plan numbers, account numbers, certificate/license numbers, vehicle/device identifiers, URLs, IPs, biometrics, photos, other unique characteristics.
User Query -> PHI Detection -> De-identification -> OpenEvidence API
| |
Audit Log (encrypted) Encrypted Cache
See detailed implementation for advanced patterns.