Auto-Fill reads the week's surgical timetable, checks availability, and fills every session. It never touches anything you've already entered manually.
Unavailability
A doctor is skipped if they have any leave code that session. If any doctor has a public holiday on a given day, the whole day is skipped for everyone.
Filling clinical sessions
Sessions are filled in priority order: Critical → Essential → Medium → Low (nice-to-have). Unfilled Critical/Essential/Medium sessions are flagged at the end and must be actioned; Low sessions may stay empty if there aren't enough people.
Rules that always apply:
- A doctor is only placed in a location they're trained and approved for — no exceptions
- Hardest-to-cover sessions are filled first
- OR2, OR3, OR4, OR5, ACHD, CARD-C, OR1-T, and OR1-LE are locked to the same doctor all day — morning and afternoon are always assigned together
- OR6, OR7, OR1, and PRE-O prefer the same doctor all day but can be split if needed
- In B/D weeks, OR1-T (Tuesday) and OR1-LE (Friday) are preferentially given to different doctors
- If a session can't be filled directly, the computer tries rearranging existing auto-filled assignments to open up a slot
Filling remaining empty sessions
Once clinical sessions are covered, empty slots are filled in this order:
- Wednesday cardiac rule (hard) — any doctor on OR2–OR5 Wednesday afternoon gets MTG or NCD on Wednesday morning, no exceptions
- MTG — one eligible doctor is assigned where the template requires a meeting
- S2 — assigned only where the template requires it; S-capable doctors with >2 available sessions, no NCD yet this week, and no S2 already assigned
- NCD — S-capable doctors first, then ORL doctors (capped at 1 NCD each), then everyone else
- ICU doctors — used to cover any still-unfilled clinical slots; the displaced non-ICU doctor receives an NCD
- Final sweep — any slot still empty gets an NCD; no blank cells are ever left
A minimum NCD guarantee applies: doctors with 5+ working sessions this week get at least 1 NCD; those with 7+ sessions get at least 2. NCD is never placed over an unfilled clinical requirement.
Fairness
This week: clinical load is spread as evenly as possible; NCD is distributed proportionally (fewer NCD sessions relative to available time = higher priority).
Year to date: OR1-T, OR1-LE, and cardiac lists (OR2–OR5/ACHD) are given to whoever has done the fewest over the year; cardiac fairness uses a ratio of cardiac sessions to total working sessions, not a raw count.
Daily patterns: same location AM and PM is preferred; CARD + OR6/OR7 on the same doctor in one day is avoided; OR6/OR7 split on the same doctor is avoided.
Finding the best result
The computer runs 700 versions with different random choices and keeps the best-scoring one. It then runs 500 random swap tests on the winner (swapping two doctors in the same session, keeping the result only if it scores better). A final deterministic pass tries full-day swaps between doctors holding cardiac-list sessions to improve distribution further.
The result
Every session is filled. Clinical priorities are respected. Specialist sessions are fairly distributed. And nothing you entered manually is changed.