# kimmalapo/hospital-management-system-group-4 architecture

> Architecture diagram of the GitHub repository kimmalapo/hospital-management-system-group-4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kimmalapo/hospital-management-system-group-4
- Repository: https://github.com/kimmalapo/hospital-management-system-group-4

## Overview

This is a Windows Forms hospital-management application backed by SQL Server. Users enter through login, then navigate to patient maintenance/search, room management, and master-data screens; registration supports user creation. BusinessLogic services validate and execute operations through SQL access helpers. The unified patient-and-room search screen is present but its query is explicitly a TODO, so it is not shown as a working database workflow. The README gives no architectural detail; edges reflect the sampled source and SOURCE INDEX references.

Main entry points: [`HospitalManagementSystem/UI/UILandingPage.cs`](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/UILandingPage.cs) (App navigation), [`HospitalManagementSystem/BusinessLogic/PatientService.cs`](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/PatientService.cs) (Patient service), [`HospitalManagementSystem/UI/LoginForm.cs`](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/LoginForm.cs) (Login), [`HospitalManagementSystem/BusinessLogic/RoomService.cs`](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/RoomService.cs) (Room service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop UI"]
  node_program["App startup<br/>[Program.cs]"]
  node_login["Login<br/>[LoginForm.cs]"]
  node_landing["App navigation<br/>[UILandingPage.cs]"]
  node_home["Home screen<br/>[HomeUserControl.cs]"]
end

subgraph group_domain["Hospital workflows"]
  node_register["User registration<br/>[RegisterForm.cs]"]
  node_patientui["Patient maintenance"]
  node_patientsearch["Patient search"]
  node_roomui["Room management<br/>[RoomManagement.cs]"]
  node_roomsearch["Patient room search"]
  node_masterui["Master data"]
  node_unified["Unified search"]
end

subgraph group_logic["Business logic"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_users["User service<br/>[UserService.cs]"]
  node_patients["Patient service<br/>[PatientService.cs]"]
  node_rooms["Room service<br/>[RoomService.cs]"]
  node_lookups["Lookup service<br/>[LookupService.cs]"]
  node_lookuprepo["Lookup repository"]
  node_patientmodel["Patient model<br/>[Patient.cs]"]
  node_lookupmodel["Lookup model<br/>[LookupItem.cs]"]
end

subgraph group_data["Persistence"]
  node_dbexec["SQL executor<br/>[DbExecutor.cs]"]
  node_config["DB configuration<br/>[Config.cs]"]
  node_sql[("SQL Server data")]
end

node_user(("Staff user"))

node_user -->|"starts app"| node_program
node_program -->|"opens"| node_login
node_user -->|"signs in"| node_login
node_login -->|"authenticates"| node_auth
node_login -.->|"opens"| node_landing
node_landing -->|"shows"| node_home
node_landing -->|"navigates to"| node_patientui
node_landing -->|"navigates to"| node_masterui
node_landing -->|"navigates to"| node_roomui
node_landing -->|"navigates to"| node_unified
node_user -.->|"registers"| node_register
node_register -->|"creates account"| node_users
node_patientui -->|"maintains records"| node_patients
node_patientsearch -->|"searches records"| node_patients
node_roomui -->|"manages rooms"| node_rooms
node_roomui -->|"searches lookups"| node_lookups
node_roomsearch -->|"queries rooms"| node_rooms
node_unified -.->|"intended search"| node_patients
node_patients -->|"executes queries"| node_dbexec
node_rooms -->|"executes queries"| node_dbexec
node_rooms -->|"checks room types"| node_lookups
node_lookups -->|"delegates CRUD"| node_lookuprepo
node_lookups -->|"checks usage"| node_dbexec
node_lookuprepo -->|"reads and writes"| node_sql
node_dbexec -->|"executes SQL"| node_sql
node_config -.->|"provides connection"| node_sql
node_patients -->|"maps records"| node_patientmodel
node_lookuprepo -->|"maps records"| node_lookupmodel

click node_program "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/Program.cs"
click node_login "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/LoginForm.cs"
click node_landing "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/UILandingPage.cs"
click node_home "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/HomeUserControl.cs"
click node_register "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/RegisterForm.cs"
click node_patientui "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/PatientInformationMaintenance.cs"
click node_patientsearch "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/PatientInformationSearch.cs"
click node_roomui "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/RoomManagement.cs"
click node_roomsearch "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/PatientRoomSearch.cs"
click node_masterui "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/MasterDataUserControl.cs"
click node_unified "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/UnifiedSearchUserControl.cs"
click node_auth "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/AuthService.cs"
click node_users "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/UserService.cs"
click node_patients "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/PatientService.cs"
click node_rooms "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/RoomService.cs"
click node_lookups "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/LookupService.cs"
click node_lookuprepo "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/LookupRepository.cs"
click node_dbexec "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/DbExecutor.cs"
click node_config "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/Config.cs"
click node_sql "https://github.com/kimmalapo/hospital-management-system-group-4/tree/main/HospitalManagementSystem/DB"
click node_patientmodel "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/Model/Patient.cs"
click node_lookupmodel "https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/Model/LookupItem.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_program,node_login,node_landing,node_home,node_user toneBlue
class node_register,node_patientui,node_patientsearch,node_roomui,node_roomsearch,node_masterui,node_unified toneAmber
class node_auth,node_users,node_patients,node_rooms,node_lookups,node_lookuprepo,node_patientmodel,node_lookupmodel toneMint
class node_dbexec,node_config,node_sql toneRose
```

## Components

### Desktop UI

- [App startup](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/Program.cs): `HospitalManagementSystem/UI/Program.cs`
- [Login](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/LoginForm.cs): `HospitalManagementSystem/UI/LoginForm.cs`
- [App navigation](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/UILandingPage.cs): `HospitalManagementSystem/UI/UILandingPage.cs`
- [Home screen](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/HomeUserControl.cs): `HospitalManagementSystem/UI/HomeUserControl.cs`

### Hospital workflows

- [User registration](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/RegisterForm.cs): `HospitalManagementSystem/UI/RegisterForm.cs`
- [Patient maintenance](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/PatientInformationMaintenance.cs): `HospitalManagementSystem/UI/PatientInformationMaintenance.cs`
- [Patient search](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/PatientInformationSearch.cs): `HospitalManagementSystem/UI/PatientInformationSearch.cs`
- [Room management](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/RoomManagement.cs): `HospitalManagementSystem/UI/RoomManagement.cs`
- [Patient room search](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/PatientRoomSearch.cs): `HospitalManagementSystem/UI/PatientRoomSearch.cs`
- [Master data](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/MasterDataUserControl.cs): `HospitalManagementSystem/UI/MasterDataUserControl.cs`
- [Unified search](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/UnifiedSearchUserControl.cs): `HospitalManagementSystem/UI/UnifiedSearchUserControl.cs`

### Business logic

- [Authentication](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/AuthService.cs): `HospitalManagementSystem/BusinessLogic/AuthService.cs`
- [User service](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/UserService.cs): `HospitalManagementSystem/BusinessLogic/UserService.cs`
- [Patient service](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/PatientService.cs): `HospitalManagementSystem/BusinessLogic/PatientService.cs`
- [Room service](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/RoomService.cs): `HospitalManagementSystem/BusinessLogic/RoomService.cs`
- [Lookup service](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/LookupService.cs): `HospitalManagementSystem/BusinessLogic/LookupService.cs`
- [Lookup repository](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/LookupRepository.cs): `HospitalManagementSystem/BusinessLogic/LookupRepository.cs`
- [Patient model](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/Model/Patient.cs): `HospitalManagementSystem/Model/Patient.cs`
- [Lookup model](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/Model/LookupItem.cs): `HospitalManagementSystem/Model/LookupItem.cs`

### Persistence

- [SQL executor](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/BusinessLogic/DbExecutor.cs): `HospitalManagementSystem/BusinessLogic/DbExecutor.cs`
- [DB configuration](https://github.com/kimmalapo/hospital-management-system-group-4/blob/main/HospitalManagementSystem/UI/Config.cs): `HospitalManagementSystem/UI/Config.cs`
- [SQL Server data](https://github.com/kimmalapo/hospital-management-system-group-4/tree/main/HospitalManagementSystem/DB): `HospitalManagementSystem/DB`

### Other components

- **Staff user**

## Connections

- Staff user → App startup: starts app (evidence: `HospitalManagementSystem/UI/Program.cs`)
- App startup → Login: opens (evidence: `HospitalManagementSystem/UI/Program.cs`)
- Staff user → Login: signs in (evidence: `HospitalManagementSystem/UI/LoginForm.cs`)
- Login → Authentication: authenticates (evidence: `HospitalManagementSystem/UI/LoginForm.cs`)
- Login → App navigation: opens
- App navigation → Home screen: shows (evidence: `HospitalManagementSystem/UI/UILandingPage.cs`)
- App navigation → Patient maintenance: navigates to (evidence: `HospitalManagementSystem/UI/UILandingPage.cs`)
- App navigation → Master data: navigates to (evidence: `HospitalManagementSystem/UI/UILandingPage.cs`)
- App navigation → Room management: navigates to (evidence: `HospitalManagementSystem/UI/UILandingPage.cs`)
- App navigation → Unified search: navigates to (evidence: `HospitalManagementSystem/UI/UILandingPage.cs`)
- Staff user → User registration: registers
- User registration → User service: creates account (evidence: `HospitalManagementSystem/UI/RegisterForm.cs`)
- Patient maintenance → Patient service: maintains records (evidence: `HospitalManagementSystem/UI/PatientInformationMaintenance.cs`)
- Patient search → Patient service: searches records (evidence: `HospitalManagementSystem/UI/PatientInformationSearch.cs`)
- Room management → Room service: manages rooms (evidence: `HospitalManagementSystem/UI/RoomManagement.cs`)
- Room management → Lookup service: searches lookups (evidence: `HospitalManagementSystem/UI/RoomManagement.cs`)
- Patient room search → Room service: queries rooms (evidence: `HospitalManagementSystem/UI/PatientRoomSearch.cs`)
- Unified search → Patient service: intended search
- Patient service → SQL executor: executes queries (evidence: `HospitalManagementSystem/BusinessLogic/PatientService.cs`)
- Room service → SQL executor: executes queries (evidence: `HospitalManagementSystem/BusinessLogic/RoomService.cs`)
- Room service → Lookup service: checks room types (evidence: `HospitalManagementSystem/BusinessLogic/RoomService.cs`)
- Lookup service → Lookup repository: delegates CRUD (evidence: `HospitalManagementSystem/BusinessLogic/LookupService.cs`)
- Lookup service → SQL executor: checks usage (evidence: `HospitalManagementSystem/BusinessLogic/LookupService.cs`)
- Lookup repository → SQL Server data: reads and writes (evidence: `HospitalManagementSystem/BusinessLogic/LookupRepository.cs`)
- SQL executor → SQL Server data: executes SQL (evidence: `HospitalManagementSystem/BusinessLogic/DbExecutor.cs`)
- DB configuration → SQL Server data: provides connection
- Patient service → Patient model: maps records (evidence: `HospitalManagementSystem/BusinessLogic/PatientService.cs`)
- Lookup repository → Lookup model: maps records (evidence: `HospitalManagementSystem/BusinessLogic/LookupRepository.cs`)
