Scheduling
FHIR Scheduling Overview
Introduction to scheduling resources in FHIR R4
What is FHIR Scheduling?
FHIR scheduling resources let you manage appointments, time slots, and healthcare-provider availability. In Esus, the scheduling surface is:
| Resource | Endpoint | Purpose |
|---|---|---|
| Schedule | /fhir/Schedule | A container of slots for a specific actor (practitioner, room, equipment) |
| Slot | /fhir/Slot | An individual time period that can be booked |
| Appointment | /fhir/Appointment | A booking linking a patient to one or more slots and participants |
| AppointmentResponse | /fhir/AppointmentResponse | A participant’s response (accepted, declined, tentative) to an appointment |
All four support the standard CRUD interactions (create 201, read, search, PUT, PATCH, DELETE 204) plus _history. Appointment also has the $book operation.
Typical Flow
Create Schedule → Create Slots (status=free) → POST /Appointment/$book (slotId) → Appointment booked + Slot flips to busy → arrived → fulfilled
What Esus does automatically (and what it doesn’t)
| Behavior | Automatic? |
|---|---|
Flip the Slot free → busy when booking | Only with $book (atomic). A plain POST /fhir/Appointment with slot[] does not touch the Slot. |
| Reject double booking of a participant | Yes, in $book, and in POST /fhir/Appointment when the body has start + end. Appointments in cancelled, noshow or entered-in-error don’t count. |
| Enforce the status state machine | Yes, on PUT/PATCH (not on create). |
Free the Slot when an appointment is cancelled, marked noshow or deleted | No. Update the Slot back to free yourself. |
Create AppointmentResponse resources | No. Always created explicitly. |
| Send reminders or availability notifications | No. See “Appointment Reminders” and “Real-Time Availability”. |
Appointment Status Lifecycle
proposed → pending → booked → arrived → fulfilled
↘ cancelled
↘ noshow
The valid transitions are exactly: proposed → {pending, cancelled}, pending → {booked, cancelled}, booked → {arrived, cancelled, noshow}, arrived → {fulfilled, cancelled}. Any other change returns HTTP 400. Re-sending the status the appointment already has is not a transition: it is accepted as a no-op.
fulfilled, cancelled and noshow are terminal. The values checked-in, waitlist and entered-in-error are accepted by the schema but no transition leads to them; they can only be set when the appointment is created (create does not check transitions). See “Waitlist Management”.
Who can do what
For user tokens, access to the four scheduling resources is decided by role:
| Role | Access |
|---|---|
admin, doctor, receptionist | Full access (read, search, create, update, delete) |
nurse | Read, search and update |
patient | Read/search their own data and create AppointmentResponse; cannot create appointments (including $book) |
API keys are governed by their scopes instead (e.g. Appointment.create, Slot.*).
Use Cases
- Online self-scheduling — your patient portal’s backend (with an API key) books a free slot with
$bookon the patient’s behalf. - Call-center scheduling — staff schedules appointments on behalf of patients.
- Walk-in management — register patients without prior appointments.
- Resource scheduling — book rooms, equipment, or other resources.