Write the daily elective booking policy for a district hospital's surgical bed base over a winter quarter with a ward closure and a new long-wait sanction; it is scored by simulation over hidden quarters.
harbor run -t reactive-labs/elective-surgery-admissionsharbor download reactive-labs/elective-surgery-admissionsYou are Rhian Pellow, Surgical Bed Manager at Brackenmoor District Hospital in Halsey. At 16:00 every working day you book the theatre lists for the second working day ahead for Trauma & Orthopaedics, General Surgery, Urology and Gynaecology, from the admitted waiting list (PTL), knowing that emergencies take the surgical beds first and that an inpatient with no bed at the 08:00 bed meeting is cancelled on the day. Today is Thursday 31 December 2026. Martin Okonedo, Divisional Director of Operations, wrote this evening:
I need the booking rule for the winter quarter, the 16:00 review from Monday 4 January to the 31 March position, written as a policy in Ifan's BedPlan format so we can run it against the model before it goes in front of the Divisional Board, and so the theatre scheduling team can use it at the review. Judge it on the SOP section 8 cost for the quarter, and it must never breach the P2 or 28-day rules.
In /app/inputs:
RE_Winter_booking_rule_BedPlan_go-live_4_January.eml: the thread with Martin, Finance, the matron and IfanCVHA-ASA-2026-014_Schedule4_Quality_Requirements.docx and
CVHA-ASA-2026-014_Variation_CV-07_Elective_Long_Waits.pdf: the health authority contract's quality schedule
and its variationBDH_Surgical_Safe_Staffing_Agreement_2026-28.docx: the nursing agreement for the surgical wardsBDH_BM-SOP-03_Surgical_Bed_Management_RevD.docx: the bed management SOP, with the theatre timetable and the
procedure listMemo_Ward6_refurbishment_Ward3B_escalation_14Dec2026.docx: the winter-pressures memoPAS_surgical_admissions_...csv, TheatreMan_list_bookings_...csv,
PAS_midnight_surgical_bed_state_...csv, PAS_waiting_list_additions_...csv, and the PTL as at 31 December,
PTL_admitted_waiting_list_31Dec2026.csvIn /app/sim: BedPlan, the model the information team uses to test booking rules (README.md explains it and
the policy interface), with starter_policy.py (current practice), the autumn 2026 baseline config and seeds
1-20. Run it from /app with python -m sim.run --policy <file> --seeds 1-20.
/app/output/policy.py, defining a class Policy exactly as in /app/sim/README.md:
Policy() is constructed once per quarter with no arguments; it may load data files that you put in
/app/output next to it (find them relative to __file__).decide(obs) is called once a day at the 16:00 review with the observation described in the README: the
date, the list it books (list_date, or null when there is none) and its session minutes by specialty, the
surgical beds occupied and the patients in them, this morning's admissions, cancellations and DNAs, the lists
already booked, and every patient on the PTL. It returns {"book": [patient ids]}: patients on the PTL
without a date, in list order, within each specialty's session minutes on list_date (an empty list when
list_date is null).Your policy will be run, call by call, over many simulated quarters like the one Martin describes, 4 January to 31 March 2027, with the contract, the staffing agreement, the SOP and the bed base as they apply to that quarter. Each quarter is scored on its BM-SOP-03 section 8 cost as the share of the possible saving you capture: zero at what current practice (the rev C booking rule) costs on the same quarter, full marks at what a plan costs that knew that quarter's every emergency admission, length of stay, addition to the list and booking outcome in advance. No rule that has to book ahead of the facts can reach full marks; every pound saved counts. A quarter in which any P2 patient is not treated within 28 days of the decision to admit, or any patient cancelled on the day is not treated within 28 days of the cancellation, or in which the policy fails, returns an invalid booking or breaks the time limits, scores zero.