Functional contract

Appointments and schedule

Location appointment book at /app/schedule. An appointment is booking intent only: one patient (or none yet for a walk-in), one Location, start/end, optional appointment type, staff, and rooms/equipment. The on-floor encounter is a Visit.

Calendar + recurrence shipped Types, walk-ins, undo check-in shipped Mobile Schedule shipped Source: docs/functional/appointments.md

Records

ModelWhat it isScope
AppointmentBooked slot or series override (RECURRENCE-ID). Status: scheduled, canceled, no-show, checked-inLocation
AppointmentSeriesRecurring master (RFC 5545 DTSTART + RRULE + duration + EXDATEs)Location
AppointmentTypeKind of visit (name, duration, color) linked to a catalog item for billingOrganization
LocationAppointmentTypeOverrideSparse Location override for enabled onlyLocation
LocationGroupAppointmentTypeOverrideSparse Location group override for enabled, optionally locking it for the group's LocationsLocation group
AppointmentStaff / AppointmentLocationResourceOptional staff and rooms/equipmentAppointment or series

Required: location_id, starts_at, ends_at (after start). Optional patient_id (blank = walk-in) and appointment_type_id. Times are stored in UTC and shown in the Location time zone. Occurrences are expanded for the visible range, not pre-created as rows. Booking pickers omit disabled or deceased patients. Overlaps are allowed; staff/resource conflicts, closed hours, and staff off-hours ask for confirmation and still save, then show a warning icon.

Statuses and check-in

Calendar-only statuses: scheduled, canceled, no-show, checked-in. Virtual series slots count as scheduled. Canceled and no-show are terminal and never create a visit.

Appointment types

Organization master list at /app/appointment_types (appointmenttypes.read / appointmenttypes.manage). Each type has duration, color, linked catalog item, optional deposit, and a clinical flag (default true; service-forward types like grooming or boarding set false).

Walk-ins

A walk-in is an appointment with no patient yet. Pick Walk-In (no patient yet) in the popover Patient select (header Add → Appointment opens the same popover); mobile offers the same blank option. Calendar blocks, the day list, and the whiteboard Upcoming column label it “Walk-In”.

Recurrence and delete

Repeat presets: Daily, Weekly, Monthly (same weekday-in-month), Yearly, Every weekday, Custom (interval, weekdays, end never / on date / after N). Editing or canceling an occurrence asks for scope: This only (EXDATE + override), All in series, or This and following (end old rule with UNTIL, start a new series). Checked-in, canceled, and no-show overrides are never changed by a scoped cancel.

Delete is for booking mistakes: only scheduled rows without a Visit, by appointments.manage, audited. Appointments with a live deposit can’t be deleted — cancel or mark no-show so the deposit is invoiced as a fee, kept as credit, refunded, or voided.

Workspace

Views: Staff / Resource (swimlanes) · Day / Week / Month / Year. Query view (default month), date, and slot (15/30/60) on Staff, Resource, Day. Organization scope shows a pick-a-Location placeholder.

RouteWhoBehavior
GET /app/scheduleappointments.readCalendar for the workspace Location
POST /app/appointmentsappointments.manageCreate a single appointment or a series
PATCH /app/appointments/:id, /series_occurrenceappointments.manageUpdate; series takes scope this / all / following. Optional status_action
DELETE /app/appointments/:id, /series_occurrenceappointments.manageDelete scheduled rows with no Visit
PATCH /app/appointments/:id/check_in, /check_in_series_occurrencevisits.manageCheck in; redirects to the whiteboard
PATCH /app/appointments/:id/cancel, /mark_no_show (+ series)appointments.manageTerminal status, with deposit retention choice when linked

Popover status choices (status_action): Check in and Undo check-in (visits.manage), Mark scheduled, Cancel, No-show (appointments.manage). Popover fields: Location, date, times, type, deposit, patient (or Walk-In), staff, repeat. Rooms/equipment are set only through the staff API.

Schedule and Whiteboard refresh live over Action Cable (ClinicBoardChannel). The mobile Schedule reloads over HTTP (pull to refresh) and does not subscribe yet.

Staff API

The mobile Schedule uses the same rules through AppointmentWriter, at the request’s current Location (X-Location-Id or default), behind the schedule plan feature.

RouteWhoBehavior
GET /api/v1/scheduleappointments.readOccurrences with conflicts, patients, staffs, resources, enabled appointment_types, can_manage; Year returns day counts
POST /api/v1/appointmentsappointments.manageSingle (patient optional = walk-in) or series (recurrence), with staff_ids and location_resource_ids
PATCH /api/v1/appointments/:idappointments.managestatus: "checked_in" checks in; "scheduled" on a checked-in row undoes check-in
PATCH /api/v1/appointments/series_occurrenceappointments.manageSame with series_edit_scope; status changes are this-only
DELETE /api/v1/appointments/:id, /series_occurrenceappointments.manageDelete; 422 appointment_has_visit when a Visit blocks it

RBAC

RoleMay
Org / location admin, receptionistRead and manage
VeterinarianRead (cannot book, cancel, or mark no-show)

Location-scoped appointments.read / appointments.manage. Check-in and undo check-in use visits.manage on the web (API: appointments.manage). Types use appointmenttypes.read / .manage / .override.

Out of scope

Reason, buffers, .ics export, room picking in the web popover, rejecting conflicts or off-hours bookings, auto no-show job. Reminders run from notification settings (AppointmentReminderJob).

Full contract: docs/functional/appointments.md.