Skip to content

Booking Flow

Overview

Appointment booking is the process through which a patient reserves an available provider time slot.

This workflow coordinates multiple services.


Booking Workflow

sequenceDiagram

    participant Patient

    participant AppointmentService

    participant ScheduleService

    participant AppointmentDB

    Patient->>AppointmentService: Create Appointment

    AppointmentService->>ScheduleService: Validate Slot

    ScheduleService-->>AppointmentService: Slot Available

    AppointmentService->>AppointmentDB: Save Appointment

    AppointmentService-->>Patient: Appointment Created
Hold "Alt" / "Option" to enable pan & zoom

Slot Validation

Before an appointment can be created:

flowchart LR

    SLOT["Requested Slot"]

    AVAILABILITY["Effective Availability"]

    VALID["Slot Available"]

    SLOT --> AVAILABILITY

    AVAILABILITY --> VALID
Hold "Alt" / "Option" to enable pan & zoom

The slot must:

  • Exist
  • Be available
  • Not overlap existing appointments

Event Publication

flowchart LR

    APPT["Appointment Service"]

    OUTBOX["Outbox"]

    KAFKA["Apache Kafka"]

    APPT --> OUTBOX

    OUTBOX --> KAFKA
Hold "Alt" / "Option" to enable pan & zoom

Published Event:

appointment.created

Outcome

Successful booking results in:

  • Appointment creation
  • Slot reservation
  • Event publication