# vasanthabalanm/ai-healthcare-appointment architecture

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

- Interactive diagram: https://gitdiagram.com/vasanthabalanm/ai-healthcare-appointment
- Repository: https://github.com/vasanthabalanm/ai-healthcare-appointment

## Overview

Clinical Hub is a role-based patient-access and clinical-intelligence platform: patients register, book or join a waitlist, complete intake, and upload records; staff manage arrivals and queues, then review consolidated patient data and coding suggestions; admins manage users and audit activity. Angular provides patient, staff, and admin workflows over a .NET API, with PostgreSQL-backed operational data and supporting document, AI, and background-processing capabilities. The README documents several product stages whose endpoint-level wiring was not sampled, so those relationships are shown only where documented; unsampled implementation details are not inferred.

Main entry points: [`clinical-hub/src/app/features/patient`](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/patient) (Patient portal), [`clinical-hub/src/app/features/staff`](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/staff) (Staff workspace), [`src/ClinicalHealthcare.Infrastructure/Data/ClinicalDbContext.cs`](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Data/ClinicalDbContext.cs) (Clinical records), [`src/ClinicalHealthcare.Infrastructure/Data/ApplicationDbContext.cs`](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Data/ApplicationDbContext.cs) (Operational records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular workflows"]
  node_patient["Patient portal"]
  node_authui["Sign in"]
  node_staff["Staff workspace"]
  node_adminui["Admin console"]
  node_authservice["Auth client<br/>[auth.service.ts]"]
end

subgraph group_api["API capabilities"]
  node_booking["Scheduling API<br/>[Appointments]"]
  node_intake["Intake API<br/>[Intake]"]
  node_documents["Document API<br/>[ClinicalDocs]"]
  node_staffapi["Staff operations API<br/>[Staff]"]
  node_patientapi["Patient view API<br/>[Patients]"]
  node_codingapi["Coding API<br/>[Coding]"]
  node_adminapi["Admin API<br/>[Admin]"]
  node_authapi["Authentication API<br/>[Auth]"]
end

subgraph group_clinical["Clinical intelligence"]
  node_ocr["PDF OCR"]
  node_ai["Clinical code generation"]
  node_clinicaldata[("Clinical records")]
end

subgraph group_platform["Platform services"]
  node_operationaldata[("Operational records")]
  node_token["JWT tokens<br/>[JwtTokenService.cs]"]
  node_apiapp["API host<br/>[Program.cs]"]
end

node_patientactor(("Patient"))
node_staffactor(("Staff user"))
node_adminactor(("Administrator"))
node_ollama["Ollama service"]

node_patientactor -->|"uses"| node_patient
node_staffactor -->|"uses"| node_staff
node_adminactor -->|"uses"| node_adminui
node_patient -->|"books appointments"| node_booking
node_patient -->|"completes intake"| node_intake
node_patient -->|"uploads records"| node_documents
node_staff -->|"manages arrivals"| node_staffapi
node_staff -->|"reviews patient view"| node_patientapi
node_staff -->|"reviews codes"| node_codingapi
node_adminui -->|"manages users"| node_adminapi
node_authui -.->|"uses"| node_authservice
node_authservice -->|"calls auth endpoints"| node_authapi
node_booking -.->|"persists scheduling"| node_operationaldata
node_intake -.->|"persists intake"| node_operationaldata
node_documents -.->|"processes documents"| node_ocr
node_ocr -.->|"extracts clinical text"| node_clinicaldata
node_clinicaldata -.->|"supplies consolidated view"| node_patientapi
node_codingapi -.->|"generates suggestions"| node_ai
node_ai -->|"requests code generation"| node_ollama
node_authapi -.->|"issues tokens"| node_token
node_apiapp -->|"configures context"| node_operationaldata
node_apiapp -.->|"configures context"| node_clinicaldata

click node_patient "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/patient"
click node_authui "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/auth"
click node_staff "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/staff"
click node_adminui "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/admin"
click node_authservice "https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/clinical-hub/src/app/core/services/auth.service.ts"
click node_booking "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Appointments"
click node_intake "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Intake"
click node_documents "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/ClinicalDocs"
click node_staffapi "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Staff"
click node_patientapi "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Patients"
click node_codingapi "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Coding"
click node_adminapi "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Admin"
click node_authapi "https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Auth"
click node_ocr "https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/OCR/TesseractOcrService.cs"
click node_ai "https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/AI/OllamaCodeGenerationService.cs"
click node_clinicaldata "https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Data/ClinicalDbContext.cs"
click node_operationaldata "https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Data/ApplicationDbContext.cs"
click node_token "https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Auth/JwtTokenService.cs"
click node_apiapp "https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Api/Program.cs"

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_patient,node_authui,node_staff,node_adminui,node_authservice,node_staffactor toneBlue
class node_booking,node_intake,node_documents,node_staffapi,node_patientapi,node_codingapi,node_adminapi,node_authapi toneAmber
class node_ocr,node_ai,node_clinicaldata toneMint
class node_operationaldata,node_token,node_apiapp toneRose
class node_patientactor,node_adminactor,node_ollama toneIndigo
```

## Components

### Angular workflows

- [Patient portal](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/patient): `clinical-hub/src/app/features/patient`
- [Sign in](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/auth): `clinical-hub/src/app/features/auth`
- [Staff workspace](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/staff): `clinical-hub/src/app/features/staff`
- [Admin console](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/clinical-hub/src/app/features/admin): `clinical-hub/src/app/features/admin`
- [Auth client](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/clinical-hub/src/app/core/services/auth.service.ts): `clinical-hub/src/app/core/services/auth.service.ts`

### API capabilities

- [Scheduling API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Appointments): `src/ClinicalHealthcare.Api/Features/Appointments`
- [Intake API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Intake): `src/ClinicalHealthcare.Api/Features/Intake`
- [Document API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/ClinicalDocs): `src/ClinicalHealthcare.Api/Features/ClinicalDocs`
- [Staff operations API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Staff): `src/ClinicalHealthcare.Api/Features/Staff`
- [Patient view API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Patients): `src/ClinicalHealthcare.Api/Features/Patients`
- [Coding API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Coding): `src/ClinicalHealthcare.Api/Features/Coding`
- [Admin API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Admin): `src/ClinicalHealthcare.Api/Features/Admin`
- [Authentication API](https://github.com/vasanthabalanm/ai-healthcare-appointment/tree/main/src/ClinicalHealthcare.Api/Features/Auth): `src/ClinicalHealthcare.Api/Features/Auth`

### Clinical intelligence

- [PDF OCR](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/OCR/TesseractOcrService.cs): `src/ClinicalHealthcare.Infrastructure/OCR/TesseractOcrService.cs`
- [Clinical code generation](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/AI/OllamaCodeGenerationService.cs): `src/ClinicalHealthcare.Infrastructure/AI/OllamaCodeGenerationService.cs`
- [Clinical records](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Data/ClinicalDbContext.cs): `src/ClinicalHealthcare.Infrastructure/Data/ClinicalDbContext.cs`

### Platform services

- [Operational records](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Data/ApplicationDbContext.cs): `src/ClinicalHealthcare.Infrastructure/Data/ApplicationDbContext.cs`
- [JWT tokens](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Infrastructure/Auth/JwtTokenService.cs): `src/ClinicalHealthcare.Infrastructure/Auth/JwtTokenService.cs`
- [API host](https://github.com/vasanthabalanm/ai-healthcare-appointment/blob/main/src/ClinicalHealthcare.Api/Program.cs): `src/ClinicalHealthcare.Api/Program.cs`

### Other components

- **Patient**
- **Staff user**
- **Administrator**
- **Ollama service**

## Connections

- Patient → Patient portal: uses
- Staff user → Staff workspace: uses
- Administrator → Admin console: uses
- Patient portal → Scheduling API: books appointments
- Patient portal → Intake API: completes intake
- Patient portal → Document API: uploads records
- Staff workspace → Staff operations API: manages arrivals
- Staff workspace → Patient view API: reviews patient view
- Staff workspace → Coding API: reviews codes
- Admin console → Admin API: manages users
- Sign in → Auth client: uses
- Auth client → Authentication API: calls auth endpoints (evidence: `clinical-hub/src/app/core/services/auth.service.ts`)
- Scheduling API → Operational records: persists scheduling
- Intake API → Operational records: persists intake
- Document API → PDF OCR: processes documents
- PDF OCR → Clinical records: extracts clinical text
- Clinical records → Patient view API: supplies consolidated view
- Coding API → Clinical code generation: generates suggestions
- Clinical code generation → Ollama service: requests code generation (evidence: `src/ClinicalHealthcare.Infrastructure/AI/OllamaCodeGenerationService.cs`)
- Authentication API → JWT tokens: issues tokens (evidence: `src/ClinicalHealthcare.Api/Features/Auth/ExtendSessionEndpoint.cs`)
- API host → Operational records: configures context (evidence: `src/ClinicalHealthcare.Api/Program.cs`)
- API host → Clinical records: configures context (evidence: `src/ClinicalHealthcare.Api/Program.cs`)
