How ranasl62/ehr-risk-framework works
EHR Risk Framework is a research workbench for leakage-aware clinical risk modeling, exposed through a FastAPI service and Angular UI. The principal loop is dataset/task setup, temporally safe feature construction and model training, audit and evaluation, then result review and prediction. Named runs, trust artifacts, fairness, SHAP, dataset health, adapters, and exports are additional capabilities documented in the README. Some links below use README workflow descriptions; unsampled implementations are represented only where the tree or README supports them.
Main entry points: framework_routes.py Framework routes · train.py Model training · main.py FastAPI application · researcher_routes.py Research routes
Components 22
Research interface
- Workbench routes
web/src/app/app.routes.ts - Workbench pages
web/src/app/pages - API client
web/src/app/core/api.service.ts
API and orchestration
- FastAPI application
api/main.py - Research routes
api/researcher_routes.py - Framework routes
api/framework_routes.py - Job orchestration
api/jobs.py - Dataset operations
api/data_io.py - Prediction validation
inference/validation.py
Data preparation
- EHR preprocessing
preprocessing/feature_engineering.py - Temporal features
feature_engineering/time_window_features.py - Data adapters
openhealth/adapters.py - Dataset health
openhealth/health.py
Modeling and assessment
- Model training
training/train.py - Model evaluation
training/evaluate.py - Fairness assessment
fairness/bias_metrics.py - SHAP explanations
explainability/shap_explainer.py
Research records
- Task specifications
openhealth/task_spec.py - Experiment runs
openhealth/runs.py - Trust artifacts
openhealth/trust_pack.py - Workspace events
openhealth/events.py
Other components
- Researcher
Connections 28
- Researcher → Workbench routes: uses
README.md - Workbench routes → Workbench pages: routes to
web/src/app/app.routes.ts - Workbench pages → API client: requests data
- API client → FastAPI application: calls API
- FastAPI application → Research routes: registers
api/main.py - FastAPI application → Framework routes: registers
api/main.py - Research routes → Dataset operations: manages datasets
api/researcher_routes.py - Research routes → Job orchestration: starts jobs
api/researcher_routes.py - Research routes → Task specifications: loads tasks
api/researcher_routes.py - Framework routes → Task specifications: writes task definitions
api/framework_routes.py - Framework routes → Workspace events: reads events
api/framework_routes.py - Framework routes → Experiment runs: reads runs
api/framework_routes.py - Framework routes → Data adapters: imports payloads
api/framework_routes.py - Framework routes → Dataset health: reports health
api/framework_routes.py - Job orchestration → Model training: runs training
api/jobs.py - Job orchestration → Fairness assessment: runs fairness
api/jobs.py - Job orchestration → SHAP explanations: runs SHAP
api/jobs.py - Model training → Task specifications: applies task settings
training/train.py - Model training → EHR preprocessing: uses preprocessing
training/train.py - EHR preprocessing → Temporal features: builds features
preprocessing/feature_engineering.py - Model training → Model evaluation: evaluates model
training/train.py - Model training → Prediction validation: validates features
training/train.py - Model training → Experiment runs: records experiment
- Experiment runs → Trust artifacts: summarizes trust
openhealth/runs.py - FastAPI application → Prediction validation: validates prediction
api/main.py - FastAPI application → SHAP explanations: serves explanations
api/main.py - Research routes → Experiment runs: exposes run records
api/researcher_routes.py - Researcher → FastAPI application: uses research API
README.md