HomeDFD examples › Hospital Management System

DFD for Hospital Management System

Context diagram and Level 1 DFD for a hospital management system, explained step by step, and ready to edit in the browser.

A hospital management system (HMS) handles patient registration, appointments, consultations, lab tests and billing. The DFD shows how patient data moves between reception, doctors, the laboratory and the billing desk.

Below you'll find the context diagram (Level 0) and the Level 1 DFD, with every entity, process, data store and data flow explained. Open either one in the editor to change it for your own project.

Context diagram (Level 0)

Context diagram (Level 0 DFD) for Hospital Management System

Context diagram for the hospital management system: the whole system as process 0, with its external entities.

External entities

  • Patient: Gives personal details, requests appointments, pays bills and receives an ID, appointment slip and bill.
  • Doctor: Receives the day's patient schedule and records the diagnosis and prescription.
  • Laboratory: Receives test requests and sends back test reports.

Data flows in the context diagram

FromToData flow
Patient0 Hospital Management SystemPatient details, appointment request & payment
0 Hospital Management SystemPatientPatient ID, appointment slip & bill
Doctor0 Hospital Management SystemDiagnosis & prescription
0 Hospital Management SystemDoctorPatient schedule
0 Hospital Management SystemLaboratoryTest requests
Laboratory0 Hospital Management SystemTest reports

Level 1 DFD

Level 1 DFD for Hospital Management System

Level 1 DFD: process 0 broken into its main processes, with the data stores they use.

Processes

ProcessWhat it does
1.0 Register PatientCreates a patient record and gives the patient an ID.
2.0 Book AppointmentBooks an appointment slot and gives the patient an appointment slip.
3.0 ConsultationSends the schedule to the doctor, records the diagnosis and prescription, and handles lab tests.
4.0 Generate BillCalculates charges from the treatment record, collects the payment and records it.

Data stores

  • D1 Patients: Patient personal and contact details.
  • D2 Appointments: Booked appointments by date and doctor.
  • D3 Treatments: Diagnosis, prescriptions and test results.
  • D4 Payments: Bills, payments and pending dues.

All data flows in the Level 1 DFD

FromToData flow
Patient1.0 Register PatientPatient details
1.0 Register PatientD1 PatientsPatient record
1.0 Register PatientPatientPatient ID
Patient2.0 Book AppointmentAppointment request
D1 Patients2.0 Book AppointmentPatient info
2.0 Book AppointmentD2 AppointmentsAppointment
2.0 Book AppointmentPatientAppointment slip
D2 Appointments3.0 ConsultationToday's appointments
3.0 ConsultationDoctorPatient schedule
Doctor3.0 ConsultationDiagnosis & prescription
3.0 ConsultationLaboratoryTest requests
Laboratory3.0 ConsultationTest reports
3.0 ConsultationD3 TreatmentsTreatment record
D3 Treatments4.0 Generate BillTreatment charges
4.0 Generate BillPatientBill
Patient4.0 Generate BillPayment
4.0 Generate BillD4 PaymentsPayment record
D4 Payments4.0 Generate BillPending dues

Is it balanced?

Yes. Every external entity in the context diagram also appears in the Level 1 DFD, and the data going in and out matches. For example, the flows to and from Patient in the context diagram are split into more specific flows on Level 1. Both diagrams also pass DrawDFD's rule checker, with no black holes, miracles or unused data stores.

Tips for your project

  • Pharmacy and ward/bed management are common additions. Each can become a new process (for example 5.0 Dispense Medicine) with its own data store.
  • If the lab is a department inside the hospital rather than an outside lab, you can model it as a process instead of an external entity.
Level 2: pick the most complex Level 1 process and draw its steps on a new diagram, numbered like 2.1, 2.2, 2.3. Use a System boundary shape labelled with the parent process. How to draw a Level 2 DFD →

More DFD examples

Ready to draw your DFD?

Open the free editor. No sign-up, and you can start from any example.

Open DrawDFD