Protecting Healthcare Documents
Detect and redact sensitive fields in healthcare records with special handling for GDPR Article 9 risk.
Protecting Healthcare Documents
Healthcare documents can contain multiple high-risk identifiers in the same record, including names, addresses, dates of birth, and Czech rodné číslo values. A safe default is to scan every document on ingestion and store only a redacted version outside the clinical system.
Detect common high-risk fields
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
medical_record = """
Patient: Jan Novak
Rodné číslo: 850101/1234
Date of birth: 1985-01-01
Address: Vodičkova 10, Praha
Diagnosis notes: follow-up required
"""
result = guard.detect(medical_record)
redacted_record = guard.redact(medical_record)
print(result.findings)This catches the categories that usually matter most for privacy reviews: rodne_cislo, name, address, and date of birth.
Redact for compliance workflows
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
def prepare_record_for_external_review(text: str) -> str:
return guard.redact(text)Use this before sharing records with external legal counsel, processors, AI tools, or support teams that do not need direct identifiers.
Flag Article 9 sensitive context
Rodné číslo can reveal biological sex, which can trigger GDPR Article 9 concerns in some workflows.
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
result = guard.detect("Rodné číslo pacienta: 850101/1234")
article_9_related = []
for finding in result.findings:
metadata = finding.metadata
if metadata and metadata.get("article_9"):
article_9_related.append(finding)Use metadata-driven checks like this to send records into a stricter review path.
Practical healthcare workflow
- Ingest the original record in the source clinical system.
- Run
detect()immediately. - Route records with Article 9-related metadata to compliance review.
- Use
redact()before indexing, summarization, or external sharing. - Retain raw data only where strictly required.