Functional contract
Visits and whiteboard
A visit is the on-floor encounter after arrival. An appointment is only the booking. Walk-ins create a visit with no appointment.
Domain
| Model | What it is |
|---|---|
Visit | Encounter after arrival. Optional appointment, attending staff, current room |
VisitStaff | Staff on the visit (may differ from the booking) |
Visit statuses: checked_in → in_room ⇄ waiting → ready_to_bill → completed.
| Status | Place | Meaning |
|---|---|---|
checked_in | Waiting room | Arrived, not seen |
in_room | A room | In any room (exam, treatment, surgery), first time or again |
waiting | Waiting room | Seen, waiting for the next step |
ready_to_bill | Off floor | Care done, waiting for checkout |
completed | Off floor | Closed |
Place is derived (waiting room / a room / off floor), not a column. Illegal place+status pairs are rejected. Room → waiting room sets waiting; waiting room → a room sets in_room. place_changed_at records the last move. There is no “in treatment” status; who is with the patient is the visit’s staff.
Whiteboard
GET /app/whiteboard (visits.read). Query view: floor (default), pipeline, or list. /app/flowboard redirects here.
- Floor — Waiting room (grouped into Arrived and Waiting) + rooms as columns. Ready-to-bill and completed are hidden.
- Pipeline — Status columns; room is a chip. Dropping a waiting-room card on In room asks for a room. Completed hidden by default.
- Timers — Each card shows two: the clock is the whole visit since arrival (warn 60 min, alert 120); the status icon is time in the current status (
status_changed_at; warn 15, alert 30 for Checked in and Waiting, no warning for other statuses). - List — All visits at the Location (any date, newest first) in the standard table, with search by code, patient, or client.
Check-in (from schedule), walk-in (New Visit), undo check-in (only while checked_in in the waiting room). Cards link to SOAP when the Staff may read patients.
RBAC
visits.read / visits.manage. Org admin, location admin, receptionist, and veterinarian may manage. Organization manager may read only. Veterinarian cannot book/cancel appointments.
Out of scope
Invoices (ready_to_bill is a board status only), reminders, mobile API, ActionCable. SOAP is separate — SOAP notes.
End-to-end billing flow: Appointment to invoice.
Full contract: docs/functional/visits.md.