Architecture
Package openhealth · CLI ehr-ai · Angular workbench · FastAPI. Research / education prototype — not a medical device.
System context
Entry surfaces share one FastAPI layer and ML core; artifacts stay on the host filesystem.
ehr-ai), or OpenAPI (:8000).
The API routes jobs, datasets, predict, and config into the ML core
(feature engineering, training, models, explainability, fairness),
which reads and writes artifacts such as model.pkl, reports/,
config/workspace.yaml, data/raw, and data/uploads.
Docker topology
docker compose up --build starts prepare, then API and web side by side.
prepare (trains model.pkl if missing),
api on :8000 (ehr-risk-api:local), and
web on :8080 (ehr-risk-web:local); nginx proxies /v1 to the API.
ML pipeline
- Ingest — demo CSV / upload / form / SQL / map
- Health — readiness blockers & warnings
- Features — multi-window aggregates truncated at index time
- Train / compare — calibrated models, manifests, runs
- Trust — leakage audit, SHAP, calibration plots
- Serve — schema + predict + workbench
Key paths
| Area | Path |
|---|---|
| Framework | openhealth/, tasks/, config/ |
| ML | training/, feature_engineering/, models/ |
| API / jobs | api/ |
| UI | web/ |
| Trust scripts | scripts/leakage_audit.py, explain_shap.py |
| This site | docs/ |
Canonical long-form: repository ARCHITECTURE.md. Visual diagrams: Diagrams. Model iteration: Fine-tuning.