# ali-asif-git/hospital-opd-wait-time-analysis architecture

> Architecture diagram of the GitHub repository ali-asif-git/hospital-opd-wait-time-analysis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ali-asif-git/hospital-opd-wait-time-analysis
- Repository: https://github.com/ali-asif-git/hospital-opd-wait-time-analysis

## Overview

This repository is an outpatient wait-time analytics project, not a live prediction service. Its workflow cleans visit data, analyzes it with SQL and pandas, trains a prediction model, and exports summaries for a three-page Power BI dashboard. The README documents these stages and their data flow; source excerpts were not available, so implementation-level calls and dashboard wiring cannot be verified.

Main entry points: [`data/processed/opd_visits_clean.csv`](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/data/processed/opd_visits_clean.csv) (Clean visits), [`notebooks/01_data_cleaning.ipynb`](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/01_data_cleaning.ipynb) (Data cleaning), [`notebooks/02_wait_time_prediction.ipynb`](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/02_wait_time_prediction.ipynb) (Wait prediction), [`notebooks/04_export_for_powerbi.ipynb`](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/04_export_for_powerbi.ipynb) (Dashboard exports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_raw[("Raw visits")]
  node_cleaning["Data cleaning"]
  node_clean[("Clean visits")]
end

subgraph group_analysis["Analysis and prediction"]
  node_sql["SQL analysis"]
  node_eda["Pandas EDA"]
  node_prediction["Wait prediction"]
  node_model["Trained model"]
end

subgraph group_reporting["Reporting"]
  node_export["Dashboard exports"]
  node_tables[("Power BI tables")]
  node_powerbi["Power BI dashboard"]
end

node_raw -->|"provides data"| node_cleaning
node_cleaning -->|"exports cleaned data"| node_clean
node_clean -->|"analyzed by"| node_sql
node_clean -->|"analyzed by"| node_eda
node_clean -->|"trains models"| node_prediction
node_prediction -->|"exports model"| node_model
node_clean -->|"aggregated for"| node_export
node_export -->|"exports tables"| node_tables
node_tables -->|"feeds dashboard"| node_powerbi

click node_raw "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/tree/main/data/raw"
click node_cleaning "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/01_data_cleaning.ipynb"
click node_clean "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/data/processed/opd_visits_clean.csv"
click node_sql "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/sql/analysis_queries.sql"
click node_eda "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/03_pandas_analysis.ipynb"
click node_prediction "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/02_wait_time_prediction.ipynb"
click node_model "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/models/wait_time_model.pkl"
click node_export "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/04_export_for_powerbi.ipynb"
click node_tables "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/tree/main/dashboard/powerbi_data"
click node_powerbi "https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/tree/main/dashboard"

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_raw,node_cleaning,node_clean toneBlue
class node_sql,node_eda,node_prediction,node_model toneAmber
class node_export,node_tables,node_powerbi toneMint
```

## Components

### Data preparation

- [Raw visits](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/tree/main/data/raw): `data/raw`
- [Data cleaning](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/01_data_cleaning.ipynb): `notebooks/01_data_cleaning.ipynb`
- [Clean visits](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/data/processed/opd_visits_clean.csv): `data/processed/opd_visits_clean.csv`

### Analysis and prediction

- [SQL analysis](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/sql/analysis_queries.sql): `sql/analysis_queries.sql`
- [Pandas EDA](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/03_pandas_analysis.ipynb): `notebooks/03_pandas_analysis.ipynb`
- [Wait prediction](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/02_wait_time_prediction.ipynb): `notebooks/02_wait_time_prediction.ipynb`
- [Trained model](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/models/wait_time_model.pkl): `models/wait_time_model.pkl`

### Reporting

- [Dashboard exports](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/blob/main/notebooks/04_export_for_powerbi.ipynb): `notebooks/04_export_for_powerbi.ipynb`
- [Power BI tables](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/tree/main/dashboard/powerbi_data): `dashboard/powerbi_data`
- [Power BI dashboard](https://github.com/ali-asif-git/hospital-opd-wait-time-analysis/tree/main/dashboard): `dashboard`

## Connections

- Raw visits → Data cleaning: provides data (evidence: `README.md`)
- Data cleaning → Clean visits: exports cleaned data (evidence: `README.md`)
- Clean visits → SQL analysis: analyzed by (evidence: `README.md`)
- Clean visits → Pandas EDA: analyzed by (evidence: `README.md`)
- Clean visits → Wait prediction: trains models (evidence: `README.md`)
- Wait prediction → Trained model: exports model (evidence: `README.md`)
- Clean visits → Dashboard exports: aggregated for (evidence: `README.md`)
- Dashboard exports → Power BI tables: exports tables (evidence: `README.md`)
- Power BI tables → Power BI dashboard: feeds dashboard (evidence: `README.md`)
