
🏥 Healthcare · C4 Architecture · Pro
A container-level view of a hospital management system: patient and staff apps, the core services behind them, and the external systems a hospital depends on, such as insurers and labs.
C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.
Drawing diagram…
A hospital management system with a patient mobile app and a staff web portal. Both call an API gateway that routes to appointment, EHR (electronic health records), billing and pharmacy services. EHR data is stored in PostgreSQL, documents and scans in object storage. Billing talks to an external insurance claims system, and the EHR service exchanges HL7/FHIR messages with an external lab system.
C4Container
title Hospital Management System
Person(patient, "Patient", "Books visits, views reports")
Person(staff, "Doctor / Nurse", "Treats patients, updates records")
System_Boundary(hms, "Hospital Management System") {
Container(mobile, "Patient App", "Flutter", "Appointments, reports, payments")
Container(portal, "Staff Portal", "Angular", "Clinical and admin work")
Container(gateway, "API Gateway", "Kong", "Auth, routing, rate limits")
Container(appt, "Appointment Service", "Node.js", "Slots and bookings")
Container(ehr, "EHR Service", "Java", "Medical records, HL7/FHIR")
Container(billing, "Billing Service", "Node.js", "Invoices and claims")
ContainerDb(db, "Clinical DB", "PostgreSQL", "Patients, visits, records")
}
System_Ext(lab, "Lab System", "Test orders and results")
System_Ext(insurer, "Insurance Provider", "Claims and approvals")
Rel(patient, mobile, "Uses")
Rel(staff, portal, "Uses")
Rel(mobile, gateway, "Calls", "HTTPS")
Rel(portal, gateway, "Calls", "HTTPS")
Rel(gateway, appt, "Routes")
Rel(gateway, ehr, "Routes")
Rel(gateway, billing, "Routes")
Rel(ehr, db, "Reads/writes")
Rel(ehr, lab, "Orders/results", "FHIR")
Rel(billing, insurer, "Submits claims")How a patient books a doctor's appointment online: checking free slots, holding one, paying the consultation fee and getting a confirmation.
How a hospital's EHR exchanges data with labs, radiology and insurers through an integration engine, translating between HL7 v2 and FHIR.
An online doctor consultation from booking to e-prescription: payment, a secure video room, consultation notes and the prescription sent to the patient.
How a cashless health insurance claim works at a hospital: pre-authorisation with the TPA, treatment, and final bill settlement directly with the insurer.
A core relational schema for a hospital: patients, doctors, departments, appointments, admissions, beds, prescriptions and bills.
The lifecycle of a lab test in a hospital, from the doctor's order to the result in the patient's record, including recollection and critical values.