# rakshitha-raksta/capstone-current architecture

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

- Interactive diagram: https://gitdiagram.com/rakshitha-raksta/capstone-current
- Repository: https://github.com/rakshitha-raksta/capstone-current

## Overview

ClearClaim prepares hospital encounters for claim submission through dependent clinical, billing, and insurance checks, then routes root blockers for human correction and selectively reruns affected stages. Its web command center exposes investigation, policy evidence, review, correction, audit, history, and research/lab capabilities. The README documents the principal backend flow; source excerpts confirm orchestration, rule evaluation, API setup, and UI/API behavior. Several subsystem internals are unsampled, so their links are limited to documented relationships.

Main entry points: [`backend/app/clearclaim/orchestrator.py`](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/orchestrator.py) (Run orchestrator), [`backend/app/clearclaim/server.py`](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/server.py) (FastAPI server), [`backend/app/clearclaim/api.py`](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/api.py) (Case and review API), [`backend/app/rules/engine.py`](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/rules/engine.py) (Policy rule engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_web["Command center<br/>[CommandCenter.tsx]"]
  node_panels["Workflow panels<br/>[panels.tsx]"]
  node_scene["3D workflow scene<br/>[engine.ts]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API and review"]
  node_api_server["FastAPI server<br/>[server.py]"]
  node_case_api["Case and review API<br/>[api.py]"]
  node_corrections["Audited corrections<br/>[corrections.py]"]
  node_workspace["Correction preview<br/>[workspace.py]"]
  node_studio["Execution studio<br/>[studio.py]"]
  node_legacy_api["Legacy validation API<br/>[main.py]"]
  node_control_room["Comparison control room<br/>[control_room.py]"]
  node_intel["Case intelligence<br/>[intel.py]"]
end

subgraph group_workflow["Preparation workflow"]
  node_orchestrator["Run orchestrator<br/>[orchestrator.py]"]
  node_dag["Dependency DAG<br/>[dag.py]"]
  node_stages["Claim stages"]
  node_findings["Finding attribution<br/>[findings.py]"]
  node_issues["Issue and review routing<br/>[issues.py]"]
  node_snapshot["Encounter snapshot<br/>[snapshot.py]"]
end

subgraph group_evidence["Rules and explanation"]
  node_rule_engine["Policy rule engine<br/>[engine.py]"]
  node_rule_evaluators["Rule evaluators"]
  node_rag["Policy explainer"]
end

subgraph group_data["Data and research"]
  node_datasets["Encounter datasets"]
  node_database[("Claim storage<br/>[db.py]")]
  node_domain_models["Claim domain models<br/>[models.py]"]
  node_experiments["Experiment analysis"]
end

node_reviewer(("Hospital reviewer"))

node_reviewer -->|"uses"| node_web
node_web -->|"presents"| node_panels
node_web -.->|"renders"| node_scene
node_panels -->|"requests data"| node_api_client
node_api_client -->|"calls API"| node_api_server
node_api_server -->|"installs routes"| node_case_api
node_case_api -->|"runs cases"| node_orchestrator
node_case_api -->|"previews fixes"| node_workspace
node_case_api -->|"applies fixes"| node_corrections
node_case_api -->|"serves live runs"| node_studio
node_orchestrator -->|"schedules stages"| node_dag
node_orchestrator -->|"executes stages"| node_stages
node_orchestrator -->|"reads inputs"| node_snapshot
node_stages -.->|"evaluates policy"| node_rule_engine
node_rule_engine -->|"dispatches rules"| node_rule_evaluators
node_orchestrator -->|"attributes findings"| node_findings
node_findings -->|"routes root blockers"| node_issues
node_corrections -->|"triggers rerun"| node_orchestrator
node_api_server -->|"serves explanations"| node_rag
node_rag -.->|"retrieves cited policy"| node_rule_evaluators
node_datasets -.->|"provides encounters"| node_orchestrator
node_orchestrator -->|"persists runs"| node_database
node_database -.->|"stores records"| node_domain_models
node_legacy_api -->|"validates claims"| node_rule_engine
node_rule_engine -->|"reads and writes results"| node_database
node_control_room -->|"compares executions"| node_orchestrator
node_experiments -.->|"measures reruns"| node_orchestrator
node_api_server -->|"installs routes"| node_control_room
node_api_server -->|"installs routes"| node_intel

click node_web "https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/pages/space/CommandCenter.tsx"
click node_panels "https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/pages/space/panels.tsx"
click node_scene "https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/world/engine.ts"
click node_api_client "https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/lib/api.ts"
click node_api_server "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/server.py"
click node_case_api "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/api.py"
click node_corrections "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/corrections.py"
click node_workspace "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/workspace.py"
click node_studio "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/studio.py"
click node_orchestrator "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/orchestrator.py"
click node_dag "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/dag.py"
click node_stages "https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/clearclaim/stages"
click node_findings "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/findings.py"
click node_issues "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/issues.py"
click node_snapshot "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/snapshot.py"
click node_rule_engine "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/rules/engine.py"
click node_rule_evaluators "https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/rules"
click node_rag "https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/rag"
click node_datasets "https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/datasets"
click node_database "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/database/db.py"
click node_domain_models "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/models.py"
click node_legacy_api "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/main.py"
click node_experiments "https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/experiments"
click node_control_room "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/control_room.py"
click node_intel "https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/intel.py"

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_web,node_panels,node_scene,node_api_client,node_reviewer toneBlue
class node_api_server,node_case_api,node_corrections,node_workspace,node_studio,node_legacy_api,node_control_room,node_intel toneAmber
class node_orchestrator,node_dag,node_stages,node_findings,node_issues,node_snapshot toneMint
class node_rule_engine,node_rule_evaluators,node_rag toneRose
class node_datasets,node_database,node_domain_models,node_experiments toneIndigo
```

## Components

### Web interface

- [Command center](https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/pages/space/CommandCenter.tsx): `frontend/src/pages/space/CommandCenter.tsx`
- [Workflow panels](https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/pages/space/panels.tsx): `frontend/src/pages/space/panels.tsx`
- [3D workflow scene](https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/world/engine.ts): `frontend/src/world/engine.ts`
- [API client](https://github.com/rakshitha-raksta/capstone-current/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API and review

- [FastAPI server](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/server.py): `backend/app/clearclaim/server.py`
- [Case and review API](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/api.py): `backend/app/clearclaim/api.py`
- [Audited corrections](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/corrections.py): `backend/app/clearclaim/corrections.py`
- [Correction preview](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/workspace.py): `backend/app/clearclaim/workspace.py`
- [Execution studio](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/studio.py): `backend/app/clearclaim/studio.py`
- [Legacy validation API](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/main.py): `backend/app/main.py`
- [Comparison control room](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/control_room.py): `backend/app/clearclaim/control_room.py`
- [Case intelligence](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/intel.py): `backend/app/clearclaim/intel.py`

### Preparation workflow

- [Run orchestrator](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/orchestrator.py): `backend/app/clearclaim/orchestrator.py`
- [Dependency DAG](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/dag.py): `backend/app/clearclaim/dag.py`
- [Claim stages](https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/clearclaim/stages): `backend/app/clearclaim/stages`
- [Finding attribution](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/findings.py): `backend/app/clearclaim/findings.py`
- [Issue and review routing](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/issues.py): `backend/app/clearclaim/issues.py`
- [Encounter snapshot](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/snapshot.py): `backend/app/clearclaim/snapshot.py`

### Rules and explanation

- [Policy rule engine](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/rules/engine.py): `backend/app/rules/engine.py`
- [Rule evaluators](https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/rules): `backend/app/rules`
- [Policy explainer](https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/rag): `backend/app/rag`

### Data and research

- [Encounter datasets](https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/datasets): `backend/app/datasets`
- [Claim storage](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/database/db.py): `backend/app/database/db.py`
- [Claim domain models](https://github.com/rakshitha-raksta/capstone-current/blob/main/backend/app/clearclaim/models.py): `backend/app/clearclaim/models.py`
- [Experiment analysis](https://github.com/rakshitha-raksta/capstone-current/tree/main/backend/app/experiments): `backend/app/experiments`

### Other components

- **Hospital reviewer**

## Connections

- Hospital reviewer → Command center: uses
- Command center → Workflow panels: presents (evidence: `frontend/src/pages/space/panels.tsx`)
- Command center → 3D workflow scene: renders
- Workflow panels → API client: requests data (evidence: `frontend/src/pages/space/panels.tsx`)
- API client → FastAPI server: calls API
- FastAPI server → Case and review API: installs routes (evidence: `backend/app/clearclaim/server.py`)
- Case and review API → Run orchestrator: runs cases
- Case and review API → Correction preview: previews fixes
- Case and review API → Audited corrections: applies fixes
- Case and review API → Execution studio: serves live runs
- Run orchestrator → Dependency DAG: schedules stages (evidence: `backend/app/clearclaim/orchestrator.py`)
- Run orchestrator → Claim stages: executes stages (evidence: `backend/app/clearclaim/orchestrator.py`)
- Run orchestrator → Encounter snapshot: reads inputs (evidence: `backend/app/clearclaim/orchestrator.py`)
- Claim stages → Policy rule engine: evaluates policy
- Policy rule engine → Rule evaluators: dispatches rules (evidence: `backend/app/rules/engine.py`)
- Run orchestrator → Finding attribution: attributes findings (evidence: `backend/app/clearclaim/orchestrator.py`)
- Finding attribution → Issue and review routing: routes root blockers
- Audited corrections → Run orchestrator: triggers rerun
- FastAPI server → Policy explainer: serves explanations (evidence: `backend/app/clearclaim/server.py`)
- Policy explainer → Rule evaluators: retrieves cited policy
- Encounter datasets → Run orchestrator: provides encounters
- Run orchestrator → Claim storage: persists runs
- Claim storage → Claim domain models: stores records
- Legacy validation API → Policy rule engine: validates claims (evidence: `backend/app/main.py`)
- Policy rule engine → Claim storage: reads and writes results (evidence: `backend/app/rules/engine.py`)
- Comparison control room → Run orchestrator: compares executions
- Experiment analysis → Run orchestrator: measures reruns
- FastAPI server → Comparison control room: installs routes (evidence: `backend/app/clearclaim/server.py`)
- FastAPI server → Case intelligence: installs routes (evidence: `backend/app/clearclaim/server.py`)
