# abhinav556678/aceso architecture

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

- Interactive diagram: https://gitdiagram.com/abhinav556678/aceso
- Repository: https://github.com/abhinav556678/aceso

## Overview

Aceso is a clinical-record review application: clinicians work with patient charts, ingest documents or recordings, review extracted facts and safety alerts, and finalize encounters; administrators and export workflows are also exposed. The backend pipeline processes uploaded sources through perception, extraction, verification, persistence, safety analysis, and SOAP-note generation. Source excerpts support the ingestion and processing links; several route implementations and the web API client were not sampled, so those connections are omitted or marked unverified.

Main entry points: [`services/api/aceso/pipeline.py`](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/pipeline.py) (Ingestion pipeline), [`services/api/aceso/main.py`](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/main.py) (API application), [`apps/web/src/app/patients/[id]/page.tsx`](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/app/patients/%5Bid%5D/page.tsx) (Patient chart), [`apps/web/src/lib/api.ts`](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/lib/api.ts) (Web API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Clinical web app"]
  node_chart["Patient chart<br/>[page.tsx]"]
  node_patient_list["Patient list<br/>[page.tsx]"]
  node_admin_ui["Admin console<br/>[page.tsx]"]
  node_api_client["Web API client<br/>[api.ts]"]
  node_source_viewer["Source viewer<br/>[SourceViewer.tsx]"]
  node_trends["Patient trends<br/>[Trends.tsx]"]
  node_alert_drawer["Alert drawer<br/>[AlertDrawer.tsx]"]
end

subgraph group_api["API workflows"]
  node_api_app["API application<br/>[main.py]"]
  node_ingest_routes["Source ingestion<br/>[ingest.py]"]
  node_patient_routes["Patient workflows<br/>[patients.py]"]
  node_review_routes["Fact and alert review<br/>[review.py]"]
  node_export_routes["Clinical export<br/>[export.py]"]
  node_admin_routes["Administration<br/>[admin.py]"]
end

subgraph group_processing["Clinical processing"]
  node_pipeline["Ingestion pipeline<br/>[pipeline.py]"]
  node_pdf["PDF perception<br/>[pdf.py]"]
  node_stt["Audio transcription<br/>[stt.py]"]
  node_extract["Fact extraction<br/>[extract.py]"]
  node_terminology["Terminology mapping<br/>[terminology.py]"]
  node_llm["Language model client<br/>[client.py]"]
  node_privacy["Privacy redaction<br/>[privacy.py]"]
  node_soap["SOAP notes<br/>[soap.py]"]
  node_safety["Safety analysis<br/>[engine.py]"]
end

subgraph group_data["Clinical data"]
  node_database[("Clinical database<br/>[db.py]")]
end

node_clinician(("Clinician"))
node_external_llm{{"Transcription service"}}

node_clinician -->|"reviews chart"| node_chart
node_chart -->|"requests data"| node_api_client
node_chart -->|"shows provenance"| node_source_viewer
node_chart -->|"shows trends"| node_trends
node_chart -.->|"opens alerts"| node_alert_drawer
node_alert_drawer -->|"submits decisions"| node_api_client
node_patient_list -->|"requests data"| node_api_client
node_admin_ui -->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_api_app
node_api_app -->|"registers routes"| node_patient_routes
node_api_app -->|"registers routes"| node_ingest_routes
node_api_app -->|"registers routes"| node_review_routes
node_api_app -->|"registers routes"| node_export_routes
node_api_app -->|"registers routes"| node_admin_routes
node_ingest_routes -->|"queues processing"| node_pipeline
node_ingest_routes -->|"renders PDF pages"| node_pdf
node_pipeline -->|"perceives documents"| node_pdf
node_pipeline -->|"transcribes audio"| node_stt
node_pipeline -->|"extracts facts"| node_extract
node_pipeline -->|"loads terminology"| node_terminology
node_pipeline -->|"generates notes"| node_soap
node_pipeline -->|"checks safety"| node_safety
node_pipeline -->|"reads and writes"| node_database
node_extract -->|"normalizes facts"| node_terminology
node_extract -->|"requests extraction"| node_llm
node_extract -->|"redacts evidence"| node_privacy
node_stt -->|"requests transcription"| node_external_llm

click node_chart "https://github.com/abhinav556678/aceso/blob/main/apps/web/src/app/patients/%5Bid%5D/page.tsx"
click node_patient_list "https://github.com/abhinav556678/aceso/blob/main/apps/web/src/app/patients/page.tsx"
click node_admin_ui "https://github.com/abhinav556678/aceso/blob/main/apps/web/src/app/admin/page.tsx"
click node_api_client "https://github.com/abhinav556678/aceso/blob/main/apps/web/src/lib/api.ts"
click node_source_viewer "https://github.com/abhinav556678/aceso/blob/main/apps/web/src/components/SourceViewer.tsx"
click node_trends "https://github.com/abhinav556678/aceso/blob/main/apps/web/src/components/Trends.tsx"
click node_alert_drawer "https://github.com/abhinav556678/aceso/blob/main/apps/web/src/components/AlertDrawer.tsx"
click node_api_app "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/main.py"
click node_ingest_routes "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/ingest.py"
click node_patient_routes "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/patients.py"
click node_review_routes "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/review.py"
click node_export_routes "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/export.py"
click node_admin_routes "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/admin.py"
click node_pipeline "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/pipeline.py"
click node_pdf "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/perception/pdf.py"
click node_stt "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/perception/stt.py"
click node_extract "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/extraction/extract.py"
click node_terminology "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/extraction/terminology.py"
click node_llm "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/llm/client.py"
click node_privacy "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/privacy.py"
click node_soap "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/soap.py"
click node_safety "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/safety/engine.py"
click node_database "https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/db.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_chart,node_patient_list,node_admin_ui,node_api_client,node_source_viewer,node_trends,node_alert_drawer toneBlue
class node_api_app,node_ingest_routes,node_patient_routes,node_review_routes,node_export_routes,node_admin_routes toneAmber
class node_pipeline,node_pdf,node_stt,node_extract,node_terminology,node_llm,node_privacy,node_soap,node_safety toneMint
class node_database toneRose
class node_clinician,node_external_llm toneIndigo
```

## Components

### Clinical web app

- [Patient chart](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/app/patients/%5Bid%5D/page.tsx): `apps/web/src/app/patients/[id]/page.tsx`
- [Patient list](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/app/patients/page.tsx): `apps/web/src/app/patients/page.tsx`
- [Admin console](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/app/admin/page.tsx): `apps/web/src/app/admin/page.tsx`
- [Web API client](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/lib/api.ts): `apps/web/src/lib/api.ts`
- [Source viewer](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/components/SourceViewer.tsx): `apps/web/src/components/SourceViewer.tsx`
- [Patient trends](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/components/Trends.tsx): `apps/web/src/components/Trends.tsx`
- [Alert drawer](https://github.com/abhinav556678/aceso/blob/main/apps/web/src/components/AlertDrawer.tsx): `apps/web/src/components/AlertDrawer.tsx`

### API workflows

- [API application](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/main.py): `services/api/aceso/main.py`
- [Source ingestion](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/ingest.py): `services/api/aceso/routes/ingest.py`
- [Patient workflows](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/patients.py): `services/api/aceso/routes/patients.py`
- [Fact and alert review](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/review.py): `services/api/aceso/routes/review.py`
- [Clinical export](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/export.py): `services/api/aceso/routes/export.py`
- [Administration](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/routes/admin.py): `services/api/aceso/routes/admin.py`

### Clinical processing

- [Ingestion pipeline](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/pipeline.py): `services/api/aceso/pipeline.py`
- [PDF perception](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/perception/pdf.py): `services/api/aceso/perception/pdf.py`
- [Audio transcription](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/perception/stt.py): `services/api/aceso/perception/stt.py`
- [Fact extraction](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/extraction/extract.py): `services/api/aceso/extraction/extract.py`
- [Terminology mapping](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/extraction/terminology.py): `services/api/aceso/extraction/terminology.py`
- [Language model client](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/llm/client.py): `services/api/aceso/llm/client.py`
- [Privacy redaction](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/privacy.py): `services/api/aceso/privacy.py`
- [SOAP notes](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/soap.py): `services/api/aceso/soap.py`
- [Safety analysis](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/safety/engine.py): `services/api/aceso/safety/engine.py`

### Clinical data

- [Clinical database](https://github.com/abhinav556678/aceso/blob/main/services/api/aceso/db.py): `services/api/aceso/db.py`

### Other components

- **Clinician**
- **Transcription service**

## Connections

- Clinician → Patient chart: reviews chart (evidence: `apps/web/src/app/patients/[id]/page.tsx`)
- Patient chart → Web API client: requests data (evidence: `apps/web/src/app/patients/[id]/page.tsx`)
- Patient chart → Source viewer: shows provenance (evidence: `apps/web/src/app/patients/[id]/page.tsx`)
- Patient chart → Patient trends: shows trends (evidence: `apps/web/src/app/patients/[id]/page.tsx`)
- Patient chart → Alert drawer: opens alerts (evidence: `apps/web/src/app/patients/[id]/page.tsx`)
- Alert drawer → Web API client: submits decisions (evidence: `apps/web/src/components/AlertDrawer.tsx`)
- Patient list → Web API client: requests data (evidence: `apps/web/src/app/patients/page.tsx`)
- Admin console → Web API client: requests data (evidence: `apps/web/src/app/admin/page.tsx`)
- Web API client → API application: calls API
- API application → Patient workflows: registers routes (evidence: `services/api/aceso/main.py`)
- API application → Source ingestion: registers routes (evidence: `services/api/aceso/main.py`)
- API application → Fact and alert review: registers routes (evidence: `services/api/aceso/main.py`)
- API application → Clinical export: registers routes (evidence: `services/api/aceso/main.py`)
- API application → Administration: registers routes (evidence: `services/api/aceso/main.py`)
- Source ingestion → Ingestion pipeline: queues processing (evidence: `services/api/aceso/routes/ingest.py`)
- Source ingestion → PDF perception: renders PDF pages (evidence: `services/api/aceso/routes/ingest.py`)
- Ingestion pipeline → PDF perception: perceives documents (evidence: `services/api/aceso/pipeline.py`)
- Ingestion pipeline → Audio transcription: transcribes audio (evidence: `services/api/aceso/pipeline.py`)
- Ingestion pipeline → Fact extraction: extracts facts (evidence: `services/api/aceso/pipeline.py`)
- Ingestion pipeline → Terminology mapping: loads terminology (evidence: `services/api/aceso/pipeline.py`)
- Ingestion pipeline → SOAP notes: generates notes (evidence: `services/api/aceso/pipeline.py`)
- Ingestion pipeline → Safety analysis: checks safety (evidence: `services/api/aceso/pipeline.py`)
- Ingestion pipeline → Clinical database: reads and writes (evidence: `services/api/aceso/pipeline.py`)
- Fact extraction → Terminology mapping: normalizes facts (evidence: `services/api/aceso/extraction/extract.py`)
- Fact extraction → Language model client: requests extraction (evidence: `services/api/aceso/extraction/extract.py`)
- Fact extraction → Privacy redaction: redacts evidence (evidence: `services/api/aceso/extraction/extract.py`)
- Audio transcription → Transcription service: requests transcription (evidence: `services/api/aceso/perception/stt.py`)
