Functional contract

Patients and patient parents

Staff register an animal (the patient) with one or more patient parents (client contacts). Charts are Organization-scoped and visible from every Location. Required fields use in-form checks instead of the browser’s native validation bubble.

Admission + chart tabs shipped Intake magic link shipped Header search shipped Source: docs/functional/patients.md, search.md

Records

ModelWhat it isScope
PatientThe animalOrganization
ClientPatient parent contact (not a User)Organization
PatientParentJoin of a patient to a parentPatient
BreedShared dog / cat / other catalogPlatform
PatientTagHandling / temperament tagPlatform defaults + Organization custom
PatientNoteDated chart note with authorPatient
PatientVaccineVaccine + certificate filePatient
VeterinarianPatient’s vet (staff or external): name, business, phone, emailPatient
MedicalConditionCondition catalogPlatform
PatientMedicalConditionReported conditionPatient

One primary client per patient (the first parent) plus optional additional parents. A client may have many patients. Admission searches existing parents by name, email, or phone, or creates new ones in the same form.

Patient — required: name, species. Dog / Cat / Other shortcuts on admission. Optional: profile photo (S3; choose a file, or the Take photo menu: this device or a single-use QR code — see Architecture → Hands-off uploads), breed, hair type/color, DOB (or age in years → estimated DOB), sex, spayed (female only), neutered (male only), weight (kg stored; metric/imperial display), tags, notes, vaccines, veterinarian, and medical conditions. Soft-delete via disabled_at; deceased via deceased_at. Default directory and booking pickers are enabled and living (Patient.bookable); new bookings (or a patient newly set on a booking, e.g. a walk-in) reject disabled or deceased patients.

Client — required: first name, last name, and a phone number or email. Optional remaining contact fields, address (geocoded when possible), email/SMS/SMS-marketing toggles (on by default; off is opt-out), and disabled_at (stays on charts, omitted from the existing-parent picker).

Mobile lists, shows, creates, and edits patients and clients through /api/v1/patients, /api/v1/clients, and /api/v1/patient_catalog.

Workspace

Patients live at /app/patients, clients at /app/clients. Super admins manage breeds at /admin/breeds.

RouteWhoBehavior
GET /app/patientspatients.readTable: avatar, name + badges, species / breed, age + sex, parent + contact, attention. Status filters with counts (enabled living by default)
GET/POST /app/patients/newpatients.manageAdmission form with chart-matching sections (Overview, Vaccines, Medical conditions, Vets, Notes)
GET /app/patients/:idpatients.readIdentity card + tabs (?tab=): Overview (profile, tags, parents, change history), Appointments, Vitals, SOAP, Diagnostic orders, Vaccines, Treatment plans, Medical conditions, Vets, Notes, History
GET/PATCH /app/patients/:id/editpatients.manageSame tabbed sections as admission
POST /app/patients/:id/invitepatients.manageEmail or SMS the parent an intake magic link
GET/PATCH /intake/:tokenPublic (signed token, 48 h)Parent-facing intake form; /intake/:token/thanks confirms

Destroy is not offered. Disabled and deceased are timestamp flags. Cross-organization ids return 404. The History tab is the clinical timeline (visits, appointments, diagnostic orders and results); Overview and the client page end with a collapsed Change history (audits).

Patient intake link

Staff send a magic link (template patient_intake.invite, email or SMS) so the parent fills the patient form on their own device. The link is for one patient, signed, and valid 48 hours. Public intake pages do not offer the QR upload option.

Reading order

The chart is read in one pass. The identity card answers who is this animal (avatar, name, status badges, species). The vitals strip answers what is stable (age, sex, weight, primary parent with contact). The alert strip answers what needs attention now and only appears when there is something: expired vaccines (danger), vaccines expiring within 60 days (caution), caution tags, and recorded medical conditions. The list repeats those alerts in its attention column.

Colour carries meaning, never decoration: danger for expired, caution for due soon, success for verified or opted in, brand for identity, neutral for plain facts. This section defines the shared layout for the rest of the platform — see Architecture → Section design.

Appointments tab

Shown when the plan includes schedule and the Staff may read appointments at any granted Location. Upcoming: every stored booking not yet ended (all Locations) plus the next three dates of each active series; first 20 with Show all. Past: ended bookings, newest first. Rows at the current Location link to that day on the schedule.

The /app header typeahead (GET /app/search?q=, ClinicSearch) looks up patients and clients across the whole Organization, in Location or Organization workspace. It is not the roster ILIKE filter.

RBAC

Org admin, location admin, receptionist, and veterinarian may read and manage. Because charts are Organization-scoped, the action counts when held org-wide or at any granted Location, whichever workspace Location is selected.

Out of scope

Voice-to-text, two-way messaging, save draft, hard-deleting patients, customer portal.

Full acceptance: docs/functional/patients.md, search.md.