06.12
Ordinacija i zakazivanje
Sažetak
Modul vodi dan ordinacije: stolci kao resursi, termini sa zahtjevima, ploča uživo, lista čekanja, opozivi i potvrde. Dvostruko zakazivanje onemogućeno je u samoj bazi podataka ograničenjem isključivanja.
Tehnička specifikacija vodi se na engleskom jeziku; naslovi i sažeci poglavlja prevedeni su na hrvatski.
Overview
- ProductionOperate · Operatory and schedulingSchedule people, chairs and requirements correctly, and connect each appointment to the encounter it becomes.
Pipeline
- Chairs are modelled as resources (ADR 0016) with opening hours and configuration audits.
- Appointments carry type requirements; availability is computed against resources, staff and requirements, with conflict alternatives offered.
- A GiST exclusion constraint rejects overlapping bookings for the same resource.
- The lifecycle moves appointments through confirmation, arrival and completion; changes publish on a change bus and stream to the board over server-sent events.
- Waitlist, recall and confirmation workflows (ADR 0018) fill gaps and bring patients back; each visit gets a structured briefing (ADR 0019).
Data owned
- Resources and configuration audits
- Holds
- Chairs, rooms and every change to their setup
- Appointments and type requirements
- Holds
- Bookings and what each type needs
- Waitlist, recall, confirmations
- Holds
- Gap-filling and return workflows
- Appointment–plan step links
- Holds
- Which plan steps an appointment delivers
| Store | Holds |
|---|---|
| Resources and configuration audits | Chairs, rooms and every change to their setup |
| Appointments and type requirements | Bookings and what each type needs |
| Waitlist, recall, confirmations | Gap-filling and return workflows |
| Appointment–plan step links | Which plan steps an appointment delivers |
Models and engines
This module makes no model calls. Everything it computes is deterministic code.
Guardrails
- Overlaps are rejected by the database, not detected after the fact.
- One state owner per row (ADR 0017); board mutations are enforced server-side (ADR 0023).
- Clinic opening hours and time zones are resolved by the clinic’s own clock, not the server’s.
Rollout and status
- ProductionScheduling, board, lifecycle, remindersLive board over server-sent events
- PilotOperatory programme featuresEnabled per clinic through rollout grants
Interfaces
- Consumes
- What
- Accepted treatment-plan steps
- Consumes
- What
- Clinic configuration
- Emits
- What
- Encounters at check-in
- Emits
- What
- Board change events
- Emits
- What
- Reminders and recall notifications
| Direction | What |
|---|---|
| Consumes | Accepted treatment-plan steps |
| Consumes | Clinic configuration |
| Emits | Encounters at check-in |
| Emits | Board change events |
| Emits | Reminders and recall notifications |
Invariants
- Operatory scheduling invariants
- ADRs 0016–0019, 0023
SOURCE OF TRUTH
server/services/scheduling/server/services/appointmentLifecycle.tsserver/db/schema/operatory-scheduling.tsdocs/clinical-invariants/operatory-scheduling.md