Skip to content

Agenda — events

Per-module slice of docs/events-catalog.md (auto-generated). Update both files when adding or removing events.

Published

Appointment lifecycle. The specific appointment.<status> event is dispatched from a status→EventType map in AppointmentService.transition_status (service.py), so the publish call passes a variable — the catalog resolves it from the constants referenced in that file.

EventWhenConsumers
appointment.scheduledAppointment creatednotifications, patient_timeline, recalls, schedules
appointment.updatedAppointment fields editedschedules
appointment.status_changedAny status transition (generic)
appointment.confirmed→ confirmedpatient_timeline
appointment.checked_in→ checked-inpatient_timeline
appointment.in_treatment→ in-treatmentpatient_timeline
appointment.completed→ completedpatient_timeline, recalls, treatment_plan
appointment.cancelled→ cancelledcopilot, notifications, patient_timeline, recalls, schedules
appointment.no_show→ no-showpatient_timeline
appointment.cabinet_changedCabinet reassigned
agenda.visit_note_updatedVisit note / completion flag edited on an appointment-treatmentpatient_timeline

Payloads carry clinic_id, appointment_id, and (where relevant) patient_id / professional_id / status fields. See the module CLAUDE.md for the per-event payload contract.

Subscribed

This module does not subscribe to any events.

Adding a new event

  1. Add the constant to backend/app/core/events/types.py (EventType).
  2. Publish from a service method, after the DB commit succeeds.
  3. Add the row to the table above.
  4. Run python backend/scripts/generate_catalogs.py to refresh the global catalog.