How saikrishna0107/healthcare-readmission-intelligence works
Hospital Readmission Intelligence ingests public CMS, CDC and Census releases, builds a tested DuckDB warehouse, and produces penalty analysis, risk predictions, governed metrics, an AI question-answering interface and a Power BI dashboard. The principal analyst workflow is source refresh → warehouse models → model/semantic results → dashboard or question-answering. README architecture documents the broad data flow; sampled Python excerpts establish the agent, model-data, semantic-query and export responsibilities. Individual dbt model dependencies were not sampled, so those stage links follow the README’s documented architecture.
Main entry points: semantic.py Semantic query layer · marts Warehouse marts · agent.py Question agent · export.py Power BI export
Components 21
Data ingestion
- Ingest runner
src/hri/ingest/run.py - Source registry
src/hri/ingest/sources.py - Release fetcher
src/hri/ingest/fetch.py - Raw release store
src/hri/ingest/store.py
Warehouse modeling
- Source staging
dbt/models/staging - Intermediate models
dbt/models/intermediate - Warehouse marts
dbt/models/marts - Metric definitions
dbt/models/semantic
Risk analysis
- Risk features
dbt/models/ml/ml_penalty_features.sql - Model data loader
src/hri/model/data.py - Risk model training
src/hri/model/train.py - Model evaluation
src/hri/model/metrics.py
Metrics and assistant
- Semantic query layer
src/hri/semantic.py - Question agent
src/hri/agent/agent.py - Local Ollama model
src/hri/agent/llm.py - Agent evaluation
src/hri/agent/evaluate.py
Analyst delivery
- Command interface
src/hri/cli.py - Streamlit interface
src/hri/app.py - Power BI export
src/hri/export.py - Power BI dashboard
powerbi/HRI.Report
Other components
- Public data
Connections 25
- Public data → Release fetcher: provides releases
README.md - Ingest runner → Source registry: loads sources
src/hri/ingest/run.py - Ingest runner → Release fetcher: fetches releases
src/hri/ingest/run.py - Ingest runner → Raw release store: stores releases
src/hri/ingest/run.py - Raw release store → Source staging: supplies raw data
README.md - Source staging → Intermediate models: cleans and joins
README.md - Intermediate models → Warehouse marts: builds star schema
README.md - Warehouse marts → Risk features: feeds features
README.md - Warehouse marts → Metric definitions: defines measures
README.md - Risk features → Model data loader: provides model table
src/hri/model/data.py - Model data loader → Risk model training: loads training data
src/hri/model/train.py - Risk model training → Model evaluation: evaluates candidates
src/hri/model/train.py - Metric definitions → Semantic query layer: drives MetricFlow
src/hri/semantic.py - Warehouse marts → Semantic query layer: queries warehouse
src/hri/semantic.py - Question agent → Local Ollama model: requests query plan
src/hri/agent/agent.py - Question agent → Semantic query layer: runs approved query
src/hri/agent/agent.py - Agent evaluation → Question agent: scores answers
src/hri/agent/evaluate.py - Agent evaluation → Semantic query layer: compares reference data
src/hri/agent/evaluate.py - Command interface → Question agent: answers CLI questions
src/hri/cli.py - Streamlit interface → Question agent: answers user questions
src/hri/app.py - Command interface → Semantic query layer: queries metrics
src/hri/cli.py - Power BI export → Warehouse marts: exports mart tables
src/hri/export.py - Power BI export → Risk model training: exports risk results
src/hri/export.py - Power BI export → Semantic query layer: builds metric checks
src/hri/export.py - Power BI export → Power BI dashboard: supplies Parquet
README.md