How mithun50/medveil works
MedVeil is an offline privacy firewall for multilingual Indian hospital records. Its documented workflow takes an input directory and policy, parses supported records, learns context, detects sensitive and clinically protected spans, links records, plans privacy transformations, rewrites files, checks for leaks, and writes sanitized output and reports. The graph retains detection, identity resolution, privacy, and security layers; several connections rely on the CLI’s pipeline description because implementation excerpts are incomplete.
Main entry points: cli.py CLI workflow · engine.py Detection engine · ingest.py Ingest and parse · rewrite.py Rewrite and serialize
Components 20
Workflow and I/O
- CLI workflow
medveil/cli.py - Policy config
config/policy.yaml - Ingest and parse
medveil/ingest.py - Record model
medveil/model.py - Rewrite and serialize
medveil/rewrite.py - Sanitized files and reports
medveil/cli.py
Detection and language
- Text normalization
medveil/textnorm.py - Field classification
medveil/detect/fields.py - Detection engine
medveil/detect/engine.py - Pattern detection
medveil/detect/patterns.py - Name detection
medveil/detect/names.py - Date detection
medveil/detect/dates.py - Language lexicons
medveil/lexicon.py - Name transliteration
medveil/translit.py
Identity and privacy
- Record linking
medveil/link.py - Privacy planning
medveil/privacy.py
Security controls
- Runtime guard
medveil/guard.py - Key and vault crypto
medveil/crypto.py - Leak gate
medveil/gate.py
Other components
- Operator
Connections 22
- Operator → CLI workflow: runs
README.md - CLI workflow → Runtime guard: secures runtime
medveil/cli.py - CLI workflow → Policy config: loads policy
medveil/cli.py - CLI workflow → Ingest and parse: parses files
medveil/cli.py - Ingest and parse → Record model: builds records
medveil/ingest.py - CLI workflow → Field classification: classifies fields
medveil/cli.py - CLI workflow → Detection engine: learns and detects
medveil/cli.py - Detection engine → Pattern detection: uses patterns
medveil/detect/engine.py - Detection engine → Name detection: detects names
medveil/detect/engine.py - Detection engine → Date detection: detects dates
medveil/detect/engine.py - Detection engine → Language lexicons: uses vocabularies
medveil/detect/engine.py - Detection engine → Name transliteration: matches scripts
medveil/detect/engine.py - Ingest and parse → Text normalization: normalizes text
medveil/ingest.py - CLI workflow → Record linking: links records
medveil/cli.py - CLI workflow → Privacy planning: plans transformations
medveil/cli.py - Privacy planning → Key and vault crypto: uses cryptography
medveil/privacy.py - CLI workflow → Key and vault crypto: creates keys and vault
medveil/cli.py - CLI workflow → Rewrite and serialize: rewrites records
medveil/cli.py - Rewrite and serialize → Date detection: renders shifted dates
medveil/rewrite.py - Rewrite and serialize → Privacy planning: applies transformations
medveil/rewrite.py - CLI workflow → Leak gate: checks leaks
medveil/cli.py - CLI workflow → Sanitized files and reports: writes results
medveil/cli.py