Skip to main content

Scheduling Service — Event Schemas

Status: populated Owner: TBD Last updated: 2026-04-17 Companion: Service Template · 04 event-driven · NAMING

1. Transport Configuration

PropertyValue
StreamSCHEDULING
Subject prefixSCHEDULING.
CloudEvents sourceghasi/scheduling
EnvelopeCloudEvents 1.0
StorageFile (persistent)
RetentionWorkQueue

2. Events Produced

Minimum envelope (all events)

{
"specversion": "1.0",
"type": "ghasi.scheduling.appointment.created",
"source": "ghasi/scheduling",
"id": "<uuid>",
"time": "2026-04-17T10:00:00Z",
"data": {
"tenantId": "<uuid>",
"actorId": "<uuid>",
"correlationId": "<uuid>",
"appointmentId": "<uuid>",
"patientId": "<uuid>"
}
}

2.1 SCHEDULING.appointment.created v1

Trigger: Appointment booked (direct or portal bridge proposed).

Additional data fields: slotId, scheduleId, appointmentType, status (booked or proposed), startAt, endAt.

Consumers: orders-service (referral link), patient-chart-service (visit context), audit-service.


2.2 SCHEDULING.appointment.updated v1

Trigger: Status update or reschedule.

Additional data fields: previousStatus, newStatus, newSlotId?, reason?.


2.3 SCHEDULING.appointment.cancelled v1

Trigger: Appointment cancelled.

Additional data fields: reason, cancelledAt.

Consumers: orders-service (cancel related tasks), waitlist auto-fill trigger.


2.4 SCHEDULING.appointment.noshow v1

Trigger: Status set to noshow.

Additional data fields: noshowAt.


2.5 SCHEDULING.appointment.fulfilled v1

Trigger: Status set to fulfilled.

Additional data fields: fulfilledAt.

Consumers: patient-chart-service, billing-service (future).


2.6 SCHEDULING.checkin.completed v1

Trigger: Status set to arrived.

Additional data fields: arrivedAt.

Consumers: patient-chart-service, registration-service (encounter auto-trigger if configured).


2.7 SCHEDULING.schedule.published v1

Trigger: Schedule created.

Additional data fields: scheduleId, actorId, actorType, timezone.


2.8 SCHEDULING.slot.opened v1

Trigger: Slot created.

Additional data fields: slotId, scheduleId, startAt, endAt, status: free.


2.9 SCHEDULING.waitlist.slot-available v1

Trigger: Cancellation frees a slot and a matching waitlist entry exists.

Additional data fields: slotId, scheduleId, startAt, waitlistEntryId, waitlistPatientId.

Consumers: communication-service (notify waitlisted patient), patient-portal-service.


2.10 SCHEDULING.appointment.reminder.sent v1

Trigger: Reminder dispatched by async ReminderDispatchService.

Additional data fields: appointmentId, channel (sms|email|portal), locale, sentAt.

3. Events Consumed

EventSourcePurpose
portal.appointment.requestedpatient-portal-serviceCreate proposed appointment via portal bridge
REGISTRATION.patient.vital-status-changedregistration-serviceCancel future appointments for deceased patients (guard logic)
REGISTRATION.patient.mergedregistration-serviceUpdate patientId references on appointments for merged source

4. Delivery Semantics

PropertyValue
At-least-onceOutbox relay with retry
DeduplicationConsumers use CloudEvents id + appointmentId
Reminder retriesAsync dispatcher retries up to 3× before dead-letter