Doctor shifts and availability
You write one weekly rule per doctor, per branch — split shifts included — bounded by the branch's own opening hours; every date is worked out from it, date exceptions subtract from it, blackouts cut from what is left, and before a change to the rule is saved you see the names of every booked patient it no longer fits and choose whether to notify them.
2705
A rule, not a calendar
One weekly pattern per doctor, per branch. A split day is simply two ranges on the same weekday. A shift outside the branch's opening hours can't be saved at all, and the refusal names the conflict rather than quietly clamping it.
How a date is decided
The date starts empty. The branch hours bound it. The weekly rule fills it. A date exception (blocked hours on that date only) subtracts from it without redrawing the week. A blackout cuts from what is left. What survives is offered as slots — and a slot has to fit entirely inside one window, so a visit never ends after the doctor has gone.
Changing a rule that already has patients on it
Shorten Tuesdays and the new closing line drops on every future Tuesday the rule reaches, except dates governed by their own exception. Every appointment that no longer fits is listed by name, date and time before a row of the schedule has changed. Then you decide: cancel and keep the old hours, save and handle it yourself, or save and notify everyone — sent in batches, with a result against each name.
Where to look