root = Card([header, statusStrip, occupancySection, erSection, admissionsSection, deptSection, staffSection, criticalSection, dischargeSection, orSection, supplySection, incidentForm, dayPicker, transferForm])
header = CardHeader("Hospital Operations Command", "Live overview — updated 2 min ago")
statusStrip = Card([statusLive, statusBeds, statusER], "sunk", "row", "m")
statusLive = Tag("● LIVE", null, "md", "success")
statusBeds = Tag("Beds 82%", null, "md", "info")
statusER = Tag("ER wait 38 min", null, "md", "warning")
occupancySection = Card([occupancyTitle, occupancyChart], "card", "column", "m")
occupancyTitle = Heading("Bed Occupancy", "h3")
occupancyChart = SingleStackedBarChart(["Occupied", "Available"], [82, 18])
erSection = Card([erTitle, erStat], "sunk", "column", "m")
erTitle = Heading("Current ER Wait", "h3")
erStat = TextContent("**38 minutes** average wait — 12 patients in queue", "large")
admissionsSection = Card([admissionsTitle, admissionsChart], "card", "column", "m")
admissionsTitle = Heading("Admissions — Last 14 Days", "h3")
admissionsChart = LineChart(["D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11", "D12", "D13", "D14"], [admissionsSeries], "natural", "Day", "Admissions")
admissionsSeries = Series("Admissions", [42, 38, 51, 47, 55, 44, 39, 48, 52, 46, 50, 43, 41, 49])
deptSection = Card([deptTitle, deptChart], "card", "column", "m")
deptTitle = Heading("Patients per Department", "h3")
deptChart = HorizontalBarChart(["Cardiology", "Oncology", "Orthopedics", "Neurology", "Pediatrics", "Emergency", "ICU"], [deptSeries])
deptSeries = Series("Patients", [34, 28, 22, 18, 16, 12, 9])
staffSection = Card([staffTitle, staffTable], "card", "column", "m")
staffTitle = Heading("Staff on Shift", "h3")
staffTable = Table([staffName, staffRole, staffDept])
staffName = Col("Name", ["Dr. A. Patel", "Dr. M. Chen", "Nurse R. Gomez", "Nurse S. Okafor", "Dr. L. Novak", "Tech J. Reyes"])
staffRole = Col("Role", ["Attending Physician", "Resident", "Charge Nurse", "Staff Nurse", "Surgeon", "Lab Tech"])
staffDept = Col("Department", ["ICU", "Emergency", "Cardiology", "Oncology", "Surgery", "Pathology"])
criticalSection = Card([criticalTitle, criticalCallout], "card", "column", "m")
criticalTitle = Heading("Critical Patients", "h3")
criticalCallout = Callout("error", "Code Blue — Room 214", "Patient J. Miller, cardiac arrest. Team responding. ICU bed held.")
dischargeSection = Card([dischargeTitle, dischargeList], "card", "column", "m")
dischargeTitle = Heading("Ready for Discharge", "h3")
dischargeList = ListBlock([discharge1, discharge2, discharge3], "number")
discharge1 = ListItem("Room 107 — T. Brooks", "Discharge summary pending pharmacy")
discharge2 = ListItem("Room 203 — H. Singh", "Transport arranged for 2:00 PM")
discharge3 = ListItem("Room 312 — E. Ward", "Awaiting family pickup")
orSection = Card([orTitle, orTable], "card", "column", "m")
orTitle = Heading("Today's Operating Room Bookings", "h3")
orTable = Table([orTime, orRoom, orProc, orSurgeon])
orTime = Col("Time", ["7:30", "8:00", "10:00", "11:30", "13:00", "15:00"])
orRoom = Col("OR", ["OR-1", "OR-2", "OR-3", "OR-1", "OR-4", "OR-2"])
orProc = Col("Procedure", ["Knee Replacement", "Appendectomy", "C-Section", "Spinal Fusion", "Hernia Repair", "Gallbladder Removal"])
orSurgeon = Col("Surgeon", ["Dr. Novak", "Dr. Reyes", "Dr. Chen", "Dr. Patel", "Dr. Iyer", "Dr. Gomez"])
supplySection = Card([supplyTitle, supplyCallout], "card", "column", "m")
supplyTitle = Heading("Supplies Running Low", "h3")
supplyCallout = TextCallout("warning", "Reorder needed", "Saline bags (below 15%), surgical gloves (below 10%), insulin vials (below 20%)")
incidentForm = Card([incidentTitle, incidentFormInner], "card", "column", "m")
incidentTitle = Heading("File an Incident", "h3")
incidentFormInner = Form("incident-report", incidentButtons, [incidentType, incidentDesc])
incidentType = FormControl("Incident type", incidentSelect)
incidentSelect = Select("incident_type", [typeMed, typeFall, typeEquip, typeOther], "Select type")
typeMed = SelectItem("medication", "Medication error")
typeFall = SelectItem("fall", "Patient fall")
typeEquip = SelectItem("equipment", "Equipment failure")
typeOther = SelectItem("other", "Other")
incidentDesc = FormControl("Description", incidentArea)
incidentArea = TextArea("incident_desc", "Describe the incident", 4)
incidentButtons = Buttons([incidentSubmit])
incidentSubmit = Button("Submit incident", null, "primary")
dayPicker = Card([dayTitle, dayButtons], "sunk", "column", "m")
dayTitle = Heading("View Another Day", "h3")
dayButtons = Buttons([prevDay, nextDay])
prevDay = Button("← Previous day", null, "secondary")
nextDay = Button("Next day →", null, "secondary")
transferForm = Card([transferTitle, transferFormInner], "card", "column", "m")
transferTitle = Heading("Request Patient Transfer", "h3")
transferFormInner = Form("transfer-request", transferButtons, [transferPatient, transferDept])
transferPatient = FormControl("Patient", transferSelect)
transferSelect = Select("patient", [pat1, pat2, pat3], "Select patient")
pat1 = SelectItem("p101", "J. Miller (Room 214)")
pat2 = SelectItem("p102", "T. Brooks (Room 107)")
pat3 = SelectItem("p103", "H. Singh (Room 203)")
transferDept = FormControl("Destination department", transferDeptSelect)
transferDeptSelect = Select("dest_dept", [destCardio, destOrtho, destNeuro], "Select department")
destCardio = SelectItem("cardiology", "Cardiology")
destOrtho = SelectItem("orthopedics", "Orthopedics")
destNeuro = SelectItem("neurology", "Neurology")
transferButtons = Buttons([transferSubmit])
transferSubmit = Button("Request transfer", null, "primary")