# kkrishkataria/healthcare-fraud-detection architecture

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

- Interactive diagram: https://gitdiagram.com/kkrishkataria/healthcare-fraud-detection
- Repository: https://github.com/kkrishkataria/healthcare-fraud-detection

## Overview

Verity Health is a provider-fraud risk prioritization application. Investigators review portfolio statistics, search or select a provider, edit a profile, and request a score; the dashboard presents risk bands and local feature-driver context to support human review. The FastAPI service validates inputs, derives features, imputes permitted missing values, and applies the saved model and threshold. The README documents the major dashboard and API capabilities; implementation details beyond the sampled excerpts are represented only where that documentation supports them.

Main entry points: [`app/main.py`](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py) (FastAPI Service), [`frontend/src/App.jsx`](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx) (Dashboard), [`models/xgb_tuned.pkl`](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/xgb_tuned.pkl) (XGBoost Model), [`models/imputer.pkl`](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/imputer.pkl) (Saved Imputer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Investigator Dashboard"]
  node_dashboard_ui["Dashboard<br/>[App.jsx]"]
  node_portfolio_view["Portfolio Summary<br/>[App.jsx]"]
  node_provider_search["Provider Search<br/>[App.jsx]"]
  node_assessment_form["Assessment Form<br/>[App.jsx]"]
  node_risk_explanation["Risk Explanation<br/>[App.jsx]"]
  node_api_client["API Requests<br/>[App.jsx]"]
end

subgraph group_api["Risk API"]
  node_fastapi["FastAPI Service<br/>[main.py]"]
  node_provider_endpoints["Provider Endpoints<br/>[main.py]"]
  node_portfolio_endpoint["Portfolio Endpoint<br/>[main.py]"]
  node_input_validation["Input Validation<br/>[main.py]"]
  node_feature_engineering["Feature Engineering<br/>[main.py]"]
  node_missing_value_handling["Missing Value Handling<br/>[main.py]"]
  node_risk_scoring["Risk Scoring<br/>[main.py]"]
end

subgraph group_inference["Scoring Assets"]
  node_model["XGBoost Model<br/>[xgb_tuned.pkl]"]
  node_imputer["Saved Imputer<br/>[imputer.pkl]"]
  node_metadata["Model Metadata"]
end

subgraph group_records["Provider Records"]
  node_provider_data[("Provider Features")]
end

node_investigator(("Investigator"))

node_investigator -->|"uses"| node_dashboard_ui
node_dashboard_ui -->|"shows"| node_portfolio_view
node_dashboard_ui -->|"offers"| node_provider_search
node_dashboard_ui -->|"offers"| node_assessment_form
node_dashboard_ui -->|"presents"| node_risk_explanation
node_portfolio_view -->|"requests summary"| node_api_client
node_provider_search -->|"requests providers"| node_api_client
node_assessment_form -->|"requests scoring"| node_api_client
node_api_client -->|"sends HTTPS requests"| node_fastapi
node_fastapi -->|"routes provider requests"| node_provider_endpoints
node_fastapi -->|"routes summary requests"| node_portfolio_endpoint
node_fastapi -->|"validates inputs"| node_input_validation
node_input_validation -->|"passes valid inputs"| node_feature_engineering
node_feature_engineering -->|"derives indicators"| node_missing_value_handling
node_missing_value_handling -->|"imputes missing values"| node_imputer
node_risk_scoring -->|"predicts probability"| node_model
node_risk_scoring -->|"uses threshold and bands"| node_metadata
node_provider_endpoints -->|"searches and reads"| node_provider_data
node_portfolio_endpoint -->|"aggregates records"| node_provider_data
node_provider_endpoints -->|"scores provider profile"| node_input_validation
node_risk_scoring -->|"uses imputed features"| node_missing_value_handling
node_risk_scoring -.->|"returns score context"| node_risk_explanation
node_fastapi -->|"loads"| node_model
node_fastapi -->|"loads"| node_imputer
node_fastapi -->|"loads"| node_metadata

click node_dashboard_ui "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx"
click node_portfolio_view "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx"
click node_provider_search "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx"
click node_assessment_form "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx"
click node_risk_explanation "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx"
click node_fastapi "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py"
click node_provider_endpoints "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py"
click node_portfolio_endpoint "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py"
click node_input_validation "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py"
click node_feature_engineering "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py"
click node_missing_value_handling "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py"
click node_risk_scoring "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py"
click node_model "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/xgb_tuned.pkl"
click node_imputer "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/imputer.pkl"
click node_metadata "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/model_metadata.json"
click node_provider_data "https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/data/provider_features.csv"

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_dashboard_ui,node_portfolio_view,node_provider_search,node_assessment_form,node_risk_explanation,node_api_client toneBlue
class node_fastapi,node_provider_endpoints,node_portfolio_endpoint,node_input_validation,node_feature_engineering,node_missing_value_handling,node_risk_scoring toneAmber
class node_model,node_imputer,node_metadata toneMint
class node_provider_data toneRose
class node_investigator toneIndigo
```

## Components

### Investigator Dashboard

- [Dashboard](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Portfolio Summary](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Provider Search](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Assessment Form](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Risk Explanation](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API Requests](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Risk API

- [FastAPI Service](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py): `app/main.py`
- [Provider Endpoints](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py): `app/main.py`
- [Portfolio Endpoint](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py): `app/main.py`
- [Input Validation](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py): `app/main.py`
- [Feature Engineering](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py): `app/main.py`
- [Missing Value Handling](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py): `app/main.py`
- [Risk Scoring](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/app/main.py): `app/main.py`

### Scoring Assets

- [XGBoost Model](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/xgb_tuned.pkl): `models/xgb_tuned.pkl`
- [Saved Imputer](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/imputer.pkl): `models/imputer.pkl`
- [Model Metadata](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/models/model_metadata.json): `models/model_metadata.json`

### Provider Records

- [Provider Features](https://github.com/kkrishkataria/healthcare-fraud-detection/blob/main/data/provider_features.csv): `data/provider_features.csv`

### Other components

- **Investigator**

## Connections

- Investigator → Dashboard: uses (evidence: `README.md`)
- Dashboard → Portfolio Summary: shows (evidence: `README.md`)
- Dashboard → Provider Search: offers (evidence: `README.md`)
- Dashboard → Assessment Form: offers (evidence: `README.md`)
- Dashboard → Risk Explanation: presents (evidence: `README.md`)
- Portfolio Summary → API Requests: requests summary (evidence: `README.md`)
- Provider Search → API Requests: requests providers (evidence: `README.md`)
- Assessment Form → API Requests: requests scoring (evidence: `README.md`)
- API Requests → FastAPI Service: sends HTTPS requests (evidence: `README.md`)
- FastAPI Service → Provider Endpoints: routes provider requests (evidence: `app/main.py`)
- FastAPI Service → Portfolio Endpoint: routes summary requests (evidence: `app/main.py`)
- FastAPI Service → Input Validation: validates inputs (evidence: `app/main.py`)
- Input Validation → Feature Engineering: passes valid inputs (evidence: `app/main.py`)
- Feature Engineering → Missing Value Handling: derives indicators (evidence: `app/main.py`)
- Missing Value Handling → Saved Imputer: imputes missing values (evidence: `app/main.py`)
- Risk Scoring → XGBoost Model: predicts probability (evidence: `app/main.py`)
- Risk Scoring → Model Metadata: uses threshold and bands (evidence: `app/main.py`)
- Provider Endpoints → Provider Features: searches and reads (evidence: `app/main.py`)
- Portfolio Endpoint → Provider Features: aggregates records (evidence: `README.md`)
- Provider Endpoints → Input Validation: scores provider profile (evidence: `app/main.py`)
- Risk Scoring → Missing Value Handling: uses imputed features (evidence: `app/main.py`)
- Risk Scoring → Risk Explanation: returns score context
- FastAPI Service → XGBoost Model: loads (evidence: `app/main.py`)
- FastAPI Service → Saved Imputer: loads (evidence: `app/main.py`)
- FastAPI Service → Model Metadata: loads (evidence: `app/main.py`)
