Patients — events
Per-module slice of docs/events-catalog.md (auto-generated). Update both files when adding or removing events.
Published
| Event | Source | When | Payload |
|---|---|---|---|
patient.created | service.py:PatientService.create | After insert + extended row commit. | patient_id (UUID), clinic_id (UUID) |
patient.updated | service.py:PatientService.update | After partial update commit. | patient_id (UUID), changes (dict of changed fields) |
patient.archived | service.py:PatientService.archive | After soft-delete (status → archived). | patient_id (UUID) |
Subscribers are listed in the auto-generated events catalog.
Subscribed
This module does not subscribe to any events.
Adding a new event
- Add the constant to
backend/app/core/events/types.py(EventType). - Publish from a service method, after the DB commit succeeds.
- Add a row to the table above.
- Run
python backend/scripts/generate_catalogs.pyto refresh the global catalog.