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.
| Event | Handler | Effect |
|---|---|---|
agenda.visit_note_updated | Handler module path. | What it does in response. |
appointment.cancelled | Handler module path. | What it does in response. |
appointment.checked_in | Handler module path. | What it does in response. |
appointment.completed | Handler module path. | What it does in response. |
appointment.confirmed | Handler module path. | What it does in response. |
appointment.in_treatment | Handler module path. | What it does in response. |
appointment.no_show | Handler module path. | What it does in response. |
appointment.scheduled | Handler module path. | What it does in response. |
budget.accepted | Handler module path. | What it does in response. |
budget.expired | Handler module path. | What it does in response. |
budget.rejected | Handler module path. | What it does in response. |
budget.reminder_sent | Handler module path. | What it does in response. |
budget.renegotiated | Handler module path. | What it does in response. |
budget.sent | Handler module path. | What it does in response. |
budget.viewed | Handler module path. | What it does in response. |
clinical_notes.administrative_created | Handler module path. | What it does in response. |
clinical_notes.diagnosis_created | Handler module path. | What it does in response. |
clinical_notes.plan_created | Handler module path. | What it does in response. |
clinical_notes.treatment_created | Handler module path. | What it does in response. |
document.uploaded | Handler module path. | What it does in response. |
notification.failed | events.on_notification_failed | Timeline row for a failed outbound send, any channel (#287 bug 12; replaces the legacy email.failed subscription). |
notification.sent | events.on_notification_sent | Timeline 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.issued | Handler module path. | What it does in response. |
invoice.paid | Handler module path. | What it does in response. |
media.pair_created | Handler module path. | What it does in response. |
media.photo_uploaded | Handler module path. | What it does in response. |
odontogram.treatment.performed | Handler module path. | What it does in response. |
patient.medical_updated | Handler module path. | What it does in response. |
treatment_plan.closed | Handler module path. | What it does in response. |
treatment_plan.confirmed | Handler module path. | What it does in response. |
treatment_plan.created | Handler module path. | What it does in response. |
treatment_plan.item_completed_without_note | Handler module path. | What it does in response. |
treatment_plan.reactivated | Handler module path. | What it does in response. |
treatment_plan.treatment_completed | Handler module path. | What it does in response. |
Adding a new event
- Add the constant to
backend/app/core/events/types.py(EventType). - Publish from a service method after
flush()— the bus runs handlers inline, before the request commits. Passdb=dbso transactional subscribers can join the transaction (ADR 0019, issue #183). - Add the row to the table(s) above.
- Run
python backend/scripts/generate_catalogs.pyto refresh the global catalog.