How sivamani-muraboyina/dr_keeper works
This is a privacy-conscious EHR retrieval application: a clinician selects a patient and asks about historical records, then receives a patient-scoped answer with safety checks, PHI redaction, and an audit event. The query path is orchestrated by the secure pipeline; separate ingestion and embedding jobs prepare encounter data for search. The README documents the Streamlit-to-FastAPI product shape and optional provider integrations. Source excerpts make the pipeline’s internal calls and database operations clear; the UI-to-API connection is documented at a high level but its transport is not shown.
Main entry points: pipeline.py Secure pipeline · 04_generate_embeddings.py Embedding generation · retrieval.py Patient retrieval · db.py Postgres encounters
Components 16
User interfaces
- Streamlit UI
ui/app.py - FastAPI API
src/ehr/api.py
Secure query
- Secure pipeline
src/ehr/pipeline.py - Rule guardrails
src/ehr/guardrails.py - PHI redaction
src/ehr/redaction.py - Embedder
src/ehr/embeddings.py - Patient retrieval
src/ehr/retrieval.py - Answer generation
src/ehr/llm.py - NeMo guardrail
src/ehr/nemo/adapter.py
Encounter data
- Postgres encounters
src/ehr/db.py - Audit log
src/ehr/db.py - CSV ingestion
scripts/02_ingest.py - Embedding generation
scripts/04_generate_embeddings.py
Configuration
- Application settings
src/ehr/config.py
Other components
- Clinician
- OpenAI-compatible provider
Connections 17
- Clinician → Streamlit UI: asks question
README.md - Streamlit UI → FastAPI API: submits query
README.md - FastAPI API → Secure pipeline: invokes pipeline
src/ehr/api.py - Secure pipeline → Rule guardrails: checks question
src/ehr/pipeline.py - Secure pipeline → PHI redaction: redacts text
src/ehr/pipeline.py - Secure pipeline → Embedder: embeds question
src/ehr/pipeline.py - Secure pipeline → Patient retrieval: searches patient
src/ehr/pipeline.py - Patient retrieval → Postgres encounters: queries encounters
src/ehr/retrieval.py - Secure pipeline → NeMo guardrail: checks context
src/ehr/pipeline.py - Secure pipeline → Answer generation: generates answer
src/ehr/pipeline.py - Answer generation → OpenAI-compatible provider: calls provider
README.md - Secure pipeline → Audit log: writes audit event
src/ehr/pipeline.py - CSV ingestion → Postgres encounters: writes encounters
scripts/02_ingest.py - Embedding generation → Embedder: encodes encounters
scripts/04_generate_embeddings.py - Embedding generation → Patient retrieval: formats encounter text
scripts/04_generate_embeddings.py - Embedding generation → Postgres encounters: stores vectors
scripts/04_generate_embeddings.py - Secure pipeline → Application settings: loads settings
src/ehr/pipeline.py