Appointment Service¶
Overview¶
The Appointment Service manages the complete appointment lifecycle within VitalBridge.
The service acts as the authoritative source for appointment records and appointment state transitions.
Responsibilities¶
The Appointment Service is responsible for:
- Appointment booking
- Appointment confirmation
- Rescheduling
- Cancellation
- Appointment lifecycle management
The service does not manage:
- Provider profiles
- Provider schedules
- Video meetings
Service Architecture¶
flowchart TB
PATIENT["Patient"]
APPT["Appointment Service"]
DB[("Appointment DB")]
PATIENT --> APPT
APPT --> DB
Hold "Alt" / "Option" to enable pan & zoom
Appointment Aggregate¶
flowchart TB
APPT["Appointment"]
PROVIDER["Provider Reference"]
PATIENT["Patient Reference"]
SLOT["Reserved Time Slot"]
STATUS["Appointment Status"]
APPT --> PROVIDER
APPT --> PATIENT
APPT --> SLOT
APPT --> STATUS
Hold "Alt" / "Option" to enable pan & zoom
Appointment Lifecycle¶
stateDiagram-v2
[*] --> Pending
Pending --> Confirmed
Confirmed --> Completed
Confirmed --> Cancelled
Pending --> Cancelled
Completed --> [*]
Cancelled --> [*]
Hold "Alt" / "Option" to enable pan & zoom
Booking Flow¶
sequenceDiagram
participant Patient
participant AppointmentService
participant ScheduleService
Patient->>AppointmentService: Create Appointment
AppointmentService->>ScheduleService: Validate Slot
ScheduleService-->>AppointmentService: Slot Available
AppointmentService->>AppointmentService: Persist Appointment
AppointmentService-->>Patient: Appointment Confirmed
Hold "Alt" / "Option" to enable pan & zoom
Event Flow¶
flowchart LR
APPT["Appointment Service"]
OUTBOX["Transactional Outbox"]
KAFKA["Apache Kafka"]
APPT --> OUTBOX
OUTBOX --> KAFKA
Hold "Alt" / "Option" to enable pan & zoom
Events¶
Published Events:
- appointment.created
- appointment.confirmed
- appointment.cancelled
- appointment.completed
- appointment.rescheduled
Consumed Events:
- provider.availability.changed
- patient.created
- provider.created