# ajinkyagadgil/patient-management-system architecture

> Architecture diagram of the GitHub repository ajinkyagadgil/patient-management-system, 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/ajinkyagadgil/patient-management-system
- Repository: https://github.com/ajinkyagadgil/patient-management-system

## Overview

Patient Management System is an Angular and .NET application for maintaining patient records, treatment history, images, and billing. The main workflow is users browsing or editing patient information and treatments, with backend handlers and services coordinating persistence and file operations; billing records can be listed by day or date range. The README documents UI capabilities beyond the sampled implementation. Several handler, record, and frontend-to-API connections are not shown in excerpts, so those links are marked unverified rather than asserted as inspected.

Main entry points: [`PMSBackend/Patient.Core/Implementation/PatientService.cs`](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/PatientService.cs) (Patient service), [`PMSUI/src/app/modules/patient/patient-details/patient-details.component.ts`](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSUI/src/app/modules/patient/patient-details/patient-details.component.ts) (Patient screens), [`PMSBackend/Patient.Core/Implementation/TreatmentService.cs`](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/TreatmentService.cs) (Treatment service), [`PMSBackend/Patient.Domain/Queries/TreatmentQuery.cs`](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Domain/Queries/TreatmentQuery.cs) (Treatment query)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Patient UI"]
  node_patient_ui["Patient screens"]
  node_patient_service_ui["Patient API client<br/>[patient.service.ts]"]
  node_image_viewer["Image viewer"]
end

subgraph group_api["API Handling"]
  node_patient_controller["Patient endpoints"]
  node_treatment_controller["Treatment endpoints"]
  node_record_controller["Billing endpoints"]
  node_patient_handler["Patient handler<br/>[PatientHandler.cs]"]
  node_treatment_handler["Treatment handler"]
  node_record_handler["Record handler"]
end

subgraph group_domain["Domain Services"]
  node_patient_service["Patient service<br/>[PatientService.cs]"]
  node_treatment_service["Treatment service"]
  node_record_service["Billing service<br/>[RecordService.cs]"]
  node_file_helper["File operations<br/>[FileHelper.cs]"]
  node_patient_query["Patient query<br/>[PatientQuery.cs]"]
  node_treatment_query["Treatment query<br/>[TreatmentQuery.cs]"]
  node_record_query["Billing query<br/>[RecordQuery.cs]"]
end

subgraph group_persistence["Persistence"]
  node_patient_repository["Patient repository"]
  node_treatment_repository["Treatment repository"]
  node_record_repository["Billing repository"]
  node_database[("PMS database<br/>[PMSDBContext.cs]")]
end

node_user(("Clinic user"))

node_user -->|"uses"| node_patient_ui
node_patient_ui -.->|"views images"| node_image_viewer
node_patient_ui -.->|"requests data"| node_patient_service_ui
node_patient_service_ui -.->|"calls API"| node_patient_controller
node_patient_controller -->|"dispatches"| node_patient_handler
node_treatment_controller -->|"dispatches"| node_treatment_handler
node_record_controller -->|"dispatches"| node_record_handler
node_patient_handler -->|"calls"| node_patient_service
node_treatment_handler -->|"calls"| node_treatment_service
node_record_handler -.->|"calls"| node_record_service
node_patient_service -->|"queries"| node_patient_query
node_patient_service -->|"queries"| node_treatment_query
node_patient_service -->|"deletes records"| node_record_query
node_patient_service -->|"uploads files"| node_file_helper
node_treatment_service -->|"queries"| node_treatment_query
node_treatment_service -->|"handles files"| node_file_helper
node_patient_query -->|"delegates"| node_patient_repository
node_treatment_query -->|"delegates"| node_treatment_repository
node_record_query -->|"delegates"| node_record_repository
node_patient_repository -->|"reads and writes"| node_database
node_treatment_repository -->|"reads and writes"| node_database
node_record_repository -->|"reads and writes"| node_database

click node_patient_ui "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSUI/src/app/modules/patient/patient-details/patient-details.component.ts"
click node_patient_service_ui "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSUI/src/app/modules/patient/patient.service.ts"
click node_image_viewer "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSUI/src/app/modules/shared/components/images-viewer/images-viewer.component.ts"
click node_patient_controller "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Controllers/PatientController.cs"
click node_treatment_controller "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Controllers/TreatmentController.cs"
click node_record_controller "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Controllers/RecordController.cs"
click node_patient_handler "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Handler/Patient/PatientHandler.cs"
click node_treatment_handler "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Handler/Treatment/TreatmentHandler.cs"
click node_record_handler "https://github.com/ajinkyagadgil/patient-management-system/tree/main/PMSBackend/PMSBackend/Handler/Record"
click node_patient_service "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/PatientService.cs"
click node_treatment_service "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/TreatmentService.cs"
click node_record_service "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/RecordService.cs"
click node_file_helper "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Helpers/FileHelper.cs"
click node_patient_query "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Domain/Queries/PatientQuery.cs"
click node_treatment_query "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Domain/Queries/TreatmentQuery.cs"
click node_record_query "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Domain/Queries/RecordQuery.cs"
click node_patient_repository "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Repository/PatientRepository.cs"
click node_treatment_repository "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Repository/TreatmentRepository.cs"
click node_record_repository "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Repository/RecordRepository.cs"
click node_database "https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Context/PMSDBContext.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_ui,node_patient_service_ui,node_image_viewer,node_user toneBlue
class node_patient_controller,node_treatment_controller,node_record_controller,node_patient_handler,node_treatment_handler,node_record_handler toneAmber
class node_patient_service,node_treatment_service,node_record_service,node_file_helper,node_patient_query,node_treatment_query,node_record_query toneMint
class node_patient_repository,node_treatment_repository,node_record_repository,node_database toneRose
```

## Components

### Patient UI

- [Patient screens](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSUI/src/app/modules/patient/patient-details/patient-details.component.ts): `PMSUI/src/app/modules/patient/patient-details/patient-details.component.ts`
- [Patient API client](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSUI/src/app/modules/patient/patient.service.ts): `PMSUI/src/app/modules/patient/patient.service.ts`
- [Image viewer](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSUI/src/app/modules/shared/components/images-viewer/images-viewer.component.ts): `PMSUI/src/app/modules/shared/components/images-viewer/images-viewer.component.ts`

### API Handling

- [Patient endpoints](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Controllers/PatientController.cs): `PMSBackend/PMSBackend/Controllers/PatientController.cs`
- [Treatment endpoints](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Controllers/TreatmentController.cs): `PMSBackend/PMSBackend/Controllers/TreatmentController.cs`
- [Billing endpoints](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Controllers/RecordController.cs): `PMSBackend/PMSBackend/Controllers/RecordController.cs`
- [Patient handler](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Handler/Patient/PatientHandler.cs): `PMSBackend/PMSBackend/Handler/Patient/PatientHandler.cs`
- [Treatment handler](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/PMSBackend/Handler/Treatment/TreatmentHandler.cs): `PMSBackend/PMSBackend/Handler/Treatment/TreatmentHandler.cs`
- [Record handler](https://github.com/ajinkyagadgil/patient-management-system/tree/main/PMSBackend/PMSBackend/Handler/Record): `PMSBackend/PMSBackend/Handler/Record`

### Domain Services

- [Patient service](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/PatientService.cs): `PMSBackend/Patient.Core/Implementation/PatientService.cs`
- [Treatment service](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/TreatmentService.cs): `PMSBackend/Patient.Core/Implementation/TreatmentService.cs`
- [Billing service](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Implementation/RecordService.cs): `PMSBackend/Patient.Core/Implementation/RecordService.cs`
- [File operations](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Core/Helpers/FileHelper.cs): `PMSBackend/Patient.Core/Helpers/FileHelper.cs`
- [Patient query](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Domain/Queries/PatientQuery.cs): `PMSBackend/Patient.Domain/Queries/PatientQuery.cs`
- [Treatment query](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Domain/Queries/TreatmentQuery.cs): `PMSBackend/Patient.Domain/Queries/TreatmentQuery.cs`
- [Billing query](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Domain/Queries/RecordQuery.cs): `PMSBackend/Patient.Domain/Queries/RecordQuery.cs`

### Persistence

- [Patient repository](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Repository/PatientRepository.cs): `PMSBackend/Patient.Data/Repository/PatientRepository.cs`
- [Treatment repository](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Repository/TreatmentRepository.cs): `PMSBackend/Patient.Data/Repository/TreatmentRepository.cs`
- [Billing repository](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Repository/RecordRepository.cs): `PMSBackend/Patient.Data/Repository/RecordRepository.cs`
- [PMS database](https://github.com/ajinkyagadgil/patient-management-system/blob/main/PMSBackend/Patient.Data/Context/PMSDBContext.cs): `PMSBackend/Patient.Data/Context/PMSDBContext.cs`

### Other components

- **Clinic user**

## Connections

- Clinic user → Patient screens: uses
- Patient screens → Image viewer: views images
- Patient screens → Patient API client: requests data
- Patient API client → Patient endpoints: calls API
- Patient endpoints → Patient handler: dispatches (evidence: `PMSBackend/PMSBackend/Controllers/PatientController.cs`)
- Treatment endpoints → Treatment handler: dispatches (evidence: `PMSBackend/PMSBackend/Controllers/TreatmentController.cs`)
- Billing endpoints → Record handler: dispatches (evidence: `PMSBackend/PMSBackend/Controllers/RecordController.cs`)
- Patient handler → Patient service: calls (evidence: `PMSBackend/PMSBackend/Handler/Patient/PatientHandler.cs`)
- Treatment handler → Treatment service: calls (evidence: `PMSBackend/PMSBackend/Handler/Treatment/TreatmentHandler.cs`)
- Record handler → Billing service: calls
- Patient service → Patient query: queries (evidence: `PMSBackend/Patient.Core/Implementation/PatientService.cs`)
- Patient service → Treatment query: queries (evidence: `PMSBackend/Patient.Core/Implementation/PatientService.cs`)
- Patient service → Billing query: deletes records (evidence: `PMSBackend/Patient.Core/Implementation/PatientService.cs`)
- Patient service → File operations: uploads files (evidence: `PMSBackend/Patient.Core/Implementation/PatientService.cs`)
- Treatment service → Treatment query: queries (evidence: `PMSBackend/Patient.Core/Implementation/TreatmentService.cs`)
- Treatment service → File operations: handles files (evidence: `PMSBackend/Patient.Core/Implementation/TreatmentService.cs`)
- Patient query → Patient repository: delegates (evidence: `PMSBackend/Patient.Domain/Queries/PatientQuery.cs`)
- Treatment query → Treatment repository: delegates (evidence: `PMSBackend/Patient.Domain/Queries/TreatmentQuery.cs`)
- Billing query → Billing repository: delegates (evidence: `PMSBackend/Patient.Domain/Queries/RecordQuery.cs`)
- Patient repository → PMS database: reads and writes (evidence: `PMSBackend/Patient.Data/Repository/PatientRepository.cs`)
- Treatment repository → PMS database: reads and writes (evidence: `PMSBackend/Patient.Data/Repository/TreatmentRepository.cs`)
- Billing repository → PMS database: reads and writes (evidence: `PMSBackend/Patient.Data/Repository/RecordRepository.cs`)
