Skip to content

Patient Timeline — events

Scaffolded stub — replace with proper documentation when this module is next touched.

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

Published

This module does not publish any events.

Subscribed

Every handler goes through events.py::_record and is deliberately own-session and payload-only (ADR 0019, issue #183): the timeline records what the payload carries, never re-reads the publisher's rows, and must never be able to fail the event it is logging.

EventHandlerEffect
agenda.visit_note_updatedHandler module path.What it does in response.
appointment.cancelledHandler module path.What it does in response.
appointment.checked_inHandler module path.What it does in response.
appointment.completedHandler module path.What it does in response.
appointment.confirmedHandler module path.What it does in response.
appointment.in_treatmentHandler module path.What it does in response.
appointment.no_showHandler module path.What it does in response.
appointment.scheduledHandler module path.What it does in response.
budget.acceptedHandler module path.What it does in response.
budget.expiredHandler module path.What it does in response.
budget.rejectedHandler module path.What it does in response.
budget.reminder_sentHandler module path.What it does in response.
budget.renegotiatedHandler module path.What it does in response.
budget.sentHandler module path.What it does in response.
budget.viewedHandler module path.What it does in response.
clinical_notes.administrative_createdHandler module path.What it does in response.
clinical_notes.diagnosis_createdHandler module path.What it does in response.
clinical_notes.plan_createdHandler module path.What it does in response.
clinical_notes.treatment_createdHandler module path.What it does in response.
document.uploadedHandler module path.What it does in response.
notification.failedevents.on_notification_failedTimeline row for a failed outbound send, any channel (#287 bug 12; replaces the legacy email.failed subscription).
notification.sentevents.on_notification_sentTimeline row for an outbound send, any channel (replaces the legacy email.sent subscription — the gateway dual-publishes both for email, so subscribing to both would double-record).
invoice.issuedHandler module path.What it does in response.
invoice.paidHandler module path.What it does in response.
media.pair_createdHandler module path.What it does in response.
media.photo_uploadedHandler module path.What it does in response.
odontogram.treatment.performedHandler module path.What it does in response.
patient.medical_updatedHandler module path.What it does in response.
treatment_plan.closedHandler module path.What it does in response.
treatment_plan.confirmedHandler module path.What it does in response.
treatment_plan.createdHandler module path.What it does in response.
treatment_plan.item_completed_without_noteHandler module path.What it does in response.
treatment_plan.reactivatedHandler module path.What it does in response.
treatment_plan.treatment_completedHandler module path.What it does in response.

Adding a new event

  1. Add the constant to backend/app/core/events/types.py (EventType).
  2. Publish from a service method after flush() — the bus runs handlers inline, before the request commits. Pass db=db so transactional subscribers can join the transaction (ADR 0019, issue #183).
  3. Add the row to the table(s) above.
  4. Run python backend/scripts/generate_catalogs.py to refresh the global catalog.