root = Card([header, kpiRow, chartsRow, staffTable, criticalPatients, dischargePatients, orBookings, lowSupplies, actionsRow], "card", "column", "l")
header = CardHeader("Hospital Operations Command View", "Real-time status — updated 2 min ago")
kpiRow = Card([bedOccupancy, erWait, datePicker], "clear", "row", "l", "stretch", "between")
bedOccupancy = Card([bedLabel, bedProgress], "sunk", "column", "m")
bedLabel = TextContent("Bed Occupancy", "small-heavy")
bedProgress = Progress(87, "87% — 348/400 beds occupied")
erWait = Card([erLabel, erValue], "sunk", "column", "m", "center")
erLabel = TextContent("Current ER Wait", "small-heavy")
erValue = TextContent("42 min", "large-heavy")
datePicker = Card([dateLabel, dateInput], "sunk", "column", "m")
dateLabel = TextContent("View Date", "small-heavy")
dateInput = DatePicker("view-date", "single", [], ["2025-01-15"])
chartsRow = Card([admissionsChart, deptChart], "clear", "row", "l", "stretch", "between")
admissionsChart = Card([admissionsHeader, admissionsArea], "sunk", "column", "m")
admissionsHeader = TextContent("Admissions — Past 14 Days", "small-heavy")
admissionsArea = AreaChart(admLabels, [admSeries], "natural", "Day", "Admissions")
admLabels = ["Jan 1", "Jan 2", "Jan 3", "Jan 4", "Jan 5", "Jan 6", "Jan 7", "Jan 8", "Jan 9", "Jan 10", "Jan 11", "Jan 12", "Jan 13", "Jan 14"]
admSeries = Series("Admissions", [24, 31, 28, 35, 42, 38, 33, 29, 26, 34, 41, 37, 30, 28])
deptChart = Card([deptHeader, deptBar], "sunk", "column", "m")
deptHeader = TextContent("Patients per Department", "small-heavy")
deptBar = HorizontalBarChart(deptLabels, [deptSeries], "grouped", "Patients", "Department")
deptLabels = ["ER", "ICU", "Cardiology", "Orthopedics", "Oncology", "Pediatrics", "Surgery", "Neurology"]
deptSeries = Series("Current", [28, 18, 22, 15, 19, 12, 24, 10])
staffTable = Card([staffHeader, staffTableComp], "sunk", "column", "m")
staffHeader = TextContent("Staff on Shift", "small-heavy")
staffTableComp = Table([staffRoleCol, staffNameCol, staffDeptCol, staffStatusCol])
staffRoleCol = Col("Role", ["Attending", "Resident", "Nurse", "Nurse", "Tech", "Pharmacist", "Respiratory", "Admin"])
staffNameCol = Col("Name", ["Dr. Chen", "Dr. Patel", "R. Martinez", "J. Kim", "T. Brooks", "M. Singh", "L. Davis", "K. Wilson"])
staffDeptCol = Col("Department", ["ER", "ICU", "ER", "Cardiology", "OR", "Pharmacy", "ICU", "Admin"])
staffStatusCol = Col("Status", ["Active", "Active", "Break", "Active", "Active", "Active", "Active", "Off"])
criticalPatients = Card([criticalHeader, criticalList], "sunk", "column", "m")
criticalHeader = TextContent("Critical Patients — Require Attention", "small-heavy")
criticalList = ListBlock([crit1, crit2, crit3], "number")
crit1 = ListItem("Patient #8472 — MRN 8821", "Septic shock, lactate 5.2, on vasopressors — ICU Bed 12", [], "View")
crit2 = ListItem("Patient #9103 — MRN 9045", "STEMI, door-to-balloon 82 min — Cath Lab", [], "View")
crit3 = ListItem("Patient #7721 — MRN 7710", "Status asthmaticus, intubated 4 hrs ago — ICU Bed 3", [], "View")
dischargePatients = Card([dischargeHeader, dischargeList], "sunk", "column", "m")
dischargeHeader = TextContent("Patients Ready for Discharge", "small-heavy")
dischargeList = ListBlock([disc1, disc2, disc3, disc4], "number")
disc1 = ListItem("Patient #8391 — MRN 8802", "Pneumonia — 48h afebrile, oral antibiotics ready — Med-Surg 4B", [], "Discharge")
disc2 = ListItem("Patient #8456 — MRN 8844", "Cholecystectomy post-op day 2 — Pain controlled, tolerating diet — Surgery 2A", [], "Discharge")
disc3 = ListItem("Patient #8502 — MRN 8877", "Heart failure exacerbation — Euvolemic, meds reconciled — Cardiology 3C", [], "Discharge")
disc4 = ListItem("Patient #8567 — MRN 8910", "COPD exacerbation — Stable on home inhalers — Pulmonary 1D", [], "Discharge")
orBookings = Card([orHeader, orTable], "sunk", "column", "m")
orHeader = TextContent("Today's Operating Room Bookings", "small-heavy")
orTable = Table([orRoomCol, orTimeCol, orProcedureCol, orSurgeonCol, orStatusCol])
orRoomCol = Col("OR", ["1", "2", "3", "4", "5", "6"])
orTimeCol = Col("Time", ["07:00-10:30", "07:30-11:00", "08:00-12:00", "09:00-13:30", "10:00-14:00", "13:00-16:00"])
orProcedureCol = Col("Procedure", ["CABG x3", "Total Hip Arthroplasty", "Whipple Procedure", "Craniotomy", "Laparoscopic Colectomy", "ACL Reconstruction"])
orSurgeonCol = Col("Surgeon", ["Dr. Ahmed", "Dr. Foster", "Dr. Kim", "Dr. Rossi", "Dr. Taylor", "Dr. Vega"])
orStatusCol = Col("Status", ["In Progress", "In Progress", "Pre-op", "Scheduled", "Scheduled", "Scheduled"])
lowSupplies = Card([supplyHeader, supplyTable], "sunk", "column", "m")
supplyHeader = TextContent("Supplies Running Low", "small-heavy")
supplyTable = Table([supplyItemCol, supplyCurrentCol, supplyParCol, supplyUrgencyCol])
supplyItemCol = Col("Item", ["O-negative Blood", "Platelets", "Propofol 1%", "Fentanyl 100mcg", "N95 Masks (L)", "Central Line Kits", "Chest Tube Trays", "Surgical Staplers"])
supplyCurrentCol = Col("On Hand", ["12 units", "8 units", "15 vials", "22 amps", "45 boxes", "6 kits", "3 trays", "8 units"])
supplyParCol = Col("Par Level", ["20 units", "15 units", "30 vials", "50 amps", "100 boxes", "12 kits", "8 trays", "15 units"])
supplyUrgencyCol = Col("Urgency", ["Critical", "Critical", "High", "High", "Medium", "High", "Medium", "Medium"])
actionsRow = Card([incidentBtn, transferBtn], "clear", "row", "l", "center", "center")
incidentBtn = Button("File Incident Report", null, "primary", "normal", "medium")
transferBtn = Button("Request Patient Transfer", null, "secondary", "normal", "medium")