# k-sahaj/hospitaliq architecture

> Architecture diagram of the GitHub repository k-sahaj/hospitaliq, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/k-sahaj/hospitaliq
- Repository: https://github.com/k-sahaj/hospitaliq

## Overview

HospitalIQ is an end-to-end healthcare analytics project: synthetic EHR data is loaded and validated in SQL Server, then used for a Power BI dashboard and a readmission-modeling workflow. The README documents the overall flow and major capabilities; source excerpts were not available, so the graph omits implementation details and relies on documented relationships.

Main entry points: [`PowerBI/HospitalIQ_Dashboard.pbix`](https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix) (Three-page dashboard), [`sql/01_setup_sqlserver.sql`](https://github.com/k-sahaj/hospitaliq/blob/main/sql/01_setup_sqlserver.sql) (Setup and import), [`sql/02_data_quality_checks.sql`](https://github.com/k-sahaj/hospitaliq/blob/main/sql/02_data_quality_checks.sql) (Data quality checks), [`notebooks/readmission_model.ipynb`](https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb) (Stratified data split)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_quality["Data preparation"]
  node_sql_setup["Setup and import"]
  node_quality_checks["Data quality checks"]
  node_data_fixes["Data fixes<br/>[03_data_fixes.sql]"]
end

subgraph group_sql_analytics["SQL analytics"]
  node_objective1["Analytics objective 1"]
  node_objective2["Analytics objective 2"]
  node_objective3["Analytics objective 3"]
end

subgraph group_dashboard["Power BI"]
  node_powerbi_report["Three-page dashboard"]
  node_operations_page["Operations page"]
  node_financial_page["Financial page"]
  node_risk_page["Patient Risk page"]
end

subgraph group_readmission_ml["Readmission ML"]
  node_feature_query["Feature engineering query"]
  node_model_split["Stratified data split"]
  node_logistic_model["Logistic baseline"]
  node_xgboost_model["XGBoost model"]
  node_shap_explanation["SHAP explanations"]
end

node_synthea_csv["Synthea EHR CSVs"]
node_sqlserver[("hospital_db")]

node_synthea_csv -->|"loads data"| node_sql_setup
node_sql_setup -->|"imports to"| node_sqlserver
node_quality_checks -->|"checks integrity"| node_sqlserver
node_data_fixes -->|"normalizes data"| node_sqlserver
node_sql_setup -->|"precedes"| node_quality_checks
node_quality_checks -->|"precedes"| node_data_fixes
node_sqlserver -->|"queries"| node_objective1
node_sqlserver -->|"queries"| node_objective2
node_sqlserver -->|"queries"| node_objective3
node_objective1 -->|"supports"| node_powerbi_report
node_objective2 -->|"supports"| node_powerbi_report
node_objective3 -->|"supports"| node_powerbi_report
node_sqlserver -->|"provides data"| node_powerbi_report
node_powerbi_report -->|"includes"| node_operations_page
node_powerbi_report -->|"includes"| node_financial_page
node_powerbi_report -->|"includes"| node_risk_page
node_sqlserver -->|"provides data"| node_feature_query
node_feature_query -->|"engineers features for"| node_model_split
node_model_split -->|"trains"| node_logistic_model
node_model_split -->|"trains"| node_xgboost_model
node_xgboost_model -->|"explained with"| node_shap_explanation

click node_sql_setup "https://github.com/k-sahaj/hospitaliq/blob/main/sql/01_setup_sqlserver.sql"
click node_quality_checks "https://github.com/k-sahaj/hospitaliq/blob/main/sql/02_data_quality_checks.sql"
click node_data_fixes "https://github.com/k-sahaj/hospitaliq/blob/main/sql/03_data_fixes.sql"
click node_objective1 "https://github.com/k-sahaj/hospitaliq/blob/main/sql/04_analytics_objective1.sql"
click node_objective2 "https://github.com/k-sahaj/hospitaliq/blob/main/sql/05_analytics_objective2.sql"
click node_objective3 "https://github.com/k-sahaj/hospitaliq/blob/main/sql/06_analytics_objective3.sql"
click node_powerbi_report "https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix"
click node_operations_page "https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix"
click node_financial_page "https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix"
click node_risk_page "https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix"
click node_feature_query "https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb"
click node_model_split "https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb"
click node_logistic_model "https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb"
click node_xgboost_model "https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb"
click node_shap_explanation "https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sql_setup,node_quality_checks,node_data_fixes toneBlue
class node_objective1,node_objective2,node_objective3,node_sqlserver toneAmber
class node_powerbi_report,node_operations_page,node_financial_page,node_risk_page toneMint
class node_feature_query,node_model_split,node_logistic_model,node_xgboost_model,node_shap_explanation toneRose
class node_synthea_csv toneIndigo
```

## Components

### Data preparation

- [Setup and import](https://github.com/k-sahaj/hospitaliq/blob/main/sql/01_setup_sqlserver.sql): `sql/01_setup_sqlserver.sql`
- [Data quality checks](https://github.com/k-sahaj/hospitaliq/blob/main/sql/02_data_quality_checks.sql): `sql/02_data_quality_checks.sql`
- [Data fixes](https://github.com/k-sahaj/hospitaliq/blob/main/sql/03_data_fixes.sql): `sql/03_data_fixes.sql`

### SQL analytics

- [Analytics objective 1](https://github.com/k-sahaj/hospitaliq/blob/main/sql/04_analytics_objective1.sql): `sql/04_analytics_objective1.sql`
- [Analytics objective 2](https://github.com/k-sahaj/hospitaliq/blob/main/sql/05_analytics_objective2.sql): `sql/05_analytics_objective2.sql`
- [Analytics objective 3](https://github.com/k-sahaj/hospitaliq/blob/main/sql/06_analytics_objective3.sql): `sql/06_analytics_objective3.sql`

### Power BI

- [Three-page dashboard](https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix): `PowerBI/HospitalIQ_Dashboard.pbix`
- [Operations page](https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix): `PowerBI/HospitalIQ_Dashboard.pbix`
- [Financial page](https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix): `PowerBI/HospitalIQ_Dashboard.pbix`
- [Patient Risk page](https://github.com/k-sahaj/hospitaliq/blob/main/PowerBI/HospitalIQ_Dashboard.pbix): `PowerBI/HospitalIQ_Dashboard.pbix`

### Readmission ML

- [Feature engineering query](https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb): `notebooks/readmission_model.ipynb`
- [Stratified data split](https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb): `notebooks/readmission_model.ipynb`
- [Logistic baseline](https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb): `notebooks/readmission_model.ipynb`
- [XGBoost model](https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb): `notebooks/readmission_model.ipynb`
- [SHAP explanations](https://github.com/k-sahaj/hospitaliq/blob/main/notebooks/readmission_model.ipynb): `notebooks/readmission_model.ipynb`

### Other components

- **Synthea EHR CSVs**
- **hospital_db**

## Connections

- Synthea EHR CSVs → Setup and import: loads data (evidence: `README.md`)
- Setup and import → hospital_db: imports to (evidence: `README.md`)
- Data quality checks → hospital_db: checks integrity (evidence: `README.md`)
- Data fixes → hospital_db: normalizes data (evidence: `README.md`)
- Setup and import → Data quality checks: precedes (evidence: `README.md`)
- Data quality checks → Data fixes: precedes (evidence: `README.md`)
- hospital_db → Analytics objective 1: queries (evidence: `README.md`)
- hospital_db → Analytics objective 2: queries (evidence: `README.md`)
- hospital_db → Analytics objective 3: queries (evidence: `README.md`)
- Analytics objective 1 → Three-page dashboard: supports (evidence: `README.md`)
- Analytics objective 2 → Three-page dashboard: supports (evidence: `README.md`)
- Analytics objective 3 → Three-page dashboard: supports (evidence: `README.md`)
- hospital_db → Three-page dashboard: provides data (evidence: `README.md`)
- Three-page dashboard → Operations page: includes (evidence: `README.md`)
- Three-page dashboard → Financial page: includes (evidence: `README.md`)
- Three-page dashboard → Patient Risk page: includes (evidence: `README.md`)
- hospital_db → Feature engineering query: provides data (evidence: `README.md`)
- Feature engineering query → Stratified data split: engineers features for (evidence: `README.md`)
- Stratified data split → Logistic baseline: trains (evidence: `README.md`)
- Stratified data split → XGBoost model: trains (evidence: `README.md`)
- XGBoost model → SHAP explanations: explained with (evidence: `README.md`)
