Authors: (including presenting author): :
Sin CK(1), Kung SW (1)
Affiliation: :
(1) Department of Accident & Emergency, Tseung Kwan O Hospital
Keyword 1: :
AI‐assisted rostering
Keyword 2: :
Constraint programming
Keyword 3: :
Clinician-led innovation
Keyword 4: :
Emergency department
Keyword 5: :
Service implementation
Keyword 6: :
Workflow automation
Introduction: :
Emergency Department (ED) duty rostering in Hong Kong Hospital Authority (HA) hospitals is operationally complex, requiring continuous service coverage, appropriate senior–junior mix, statutory holiday handling, fatigue-mitigation rules, and equitable workload distribution. Many of these requirements are highly local, nuanced, and tacit, and are best understood by frontline clinicians directly involved in roster coordination. Traditional manual, Excel-based rostering is time-consuming, error-prone, and increasingly unsustainable as the number and complexity of constraints continue to grow.
Objectives: :
1. To develop a clinician-led ED rostering system that accurately reflects real-world HA departmental rules and operational practices. 2. To demonstrate the feasibility of building a complex operational tool by a frontline clinician without formal programming background, using ChatGPT-assisted Python development. 3. To design a semi-automated, configurable rostering workflow that preserves human oversight and clinical judgment. 4. To reduce roster preparation time and minimise unfavourable duty patterns related to staff fatigue and fairness
Methodology: :
The system was designed and developed by a frontline Emergency Medicine clinician with in-depth familiarity with departmental rostering rules but no prior formal training in computer programming. Development was facilitated by ChatGPT-assisted Python coding, enabling rapid and iterative translation of clinical, administrative, and operational rules into executable constraint logic. An Excel-integrated workflow was adopted to maintain compatibility with existing departmental practices. Roster coordinators input staff details, ranks, quotas, duty requests, and daily manpower requirements via Excel. Hard constraints were modelled using constraint programming (OR-Tools CP-SAT), including exact daily coverage, one-duty-per-day rules, seniority mix requirements, night-duty spacing, post-night rest rules, weekend and statutory holiday handling, and cross-month adjacency constraints. Soft constraints were incorporated to discourage unfavourable patterns such as P→A transitions, P→A→Night sequences, and prolonged consecutive P duties. The solver generates a first-draft roster, which is subsequently reviewed and refined by the coordinator before finalisation. Outputs are written directly back into the master Excel roster, preserving existing formatting and departmental conventions.
Result & Outcome: :
The semi-automated system was used in routine clinical operation for six months and consistently generated feasible first-draft rosters that satisfied complex departmental constraints. Compared with fully manual rostering, the time required to produce a first draft was reduced by over 90%. The system also led to a noticeable reduction in unfavourable duty patterns associated with fatigue risk. The Excel-native, clinician-reviewed workflow facilitated rapid adoption without disruption to established processes. This project demonstrates that frontline clinicians, even without formal programming backgrounds, can leverage AI-assisted development to create practical, high-impact operational tools. A semi-automated, clinician-controlled approach offers a scalable and transferable model for ED duty rostering within the HA system.