
🏥 Healthcare · State Machine
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.
Drawing diagram…
State machine for a hospital lab test: Ordered by the doctor, Sample Collected, Received in lab (or Rejected and back to Ordered for recollection), In Analysis, Result Entered, Verified by pathologist, Released to the EHR. A critical value triggers Critical Alert, the doctor is called, then it is Released.
stateDiagram-v2 [*] --> Ordered Ordered --> SampleCollected SampleCollected --> ReceivedInLab ReceivedInLab --> Rejected: Haemolysed or unlabelled Rejected --> Ordered: Recollect ReceivedInLab --> InAnalysis InAnalysis --> ResultEntered ResultEntered --> Verified: Pathologist checks Verified --> CriticalAlert: Critical value CriticalAlert --> Released: Doctor phoned Verified --> Released: Normal Released --> [*]
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.
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.