A patient asks a clinic chatbot for a follow-up next Thursday after work. The chatbot finds a late opening and sends a confirmation. By the time the front desk reads the conversation, another patient has booked the opening and the clinic has no appointment for the first patient. In this illustrative scenario, the bug is in the order of operations. The chat sends the confirmation before the scheduler records a booking.
Start with one clinic, one appointment type and one intake channel. Write down which system decides that a visit is booked, which patient message each state permits, and who picks up the request when the schedule or the patient’s intent is unclear.
Give the scheduler authority over the confirmation
Keep the intake request and the scheduler’s appointment linked by reference. The intake record can hold the requested service, preferred site, date window, details the patient has verified, and the person or queue responsible for the next action. A request can exist before the scheduler issues an appointment ID. Once the scheduler returns an appointment reference, link it to the request and retain the scheduler’s status and confirmed details separately from the patient’s preferences.
Use the model to extract preferences and identify missing details. A booking service can validate those fields against the clinic’s booking rules or route a case to staff. Give the confirmation template a single trigger in the workflow, a booking recorded as confirmed by the scheduling system. Staff can book through that system and use the same confirmation path. A patient choosing a suggested time gives the clinic permission to try that time under its booking rules. The scheduler still has to accept it.
HL7 FHIR R5 describes a request starting as proposed and treats availability checking as optional, since the booking system can apply further checks. Its appointment status value set distinguishes proposed and pending from booked, and gives cancellation and check-in their own codes. Use the FHIR labels where the integration supports them. For a scheduler with its own statuses, document the equivalent conditions and test the mapping against that scheduler. HL7 FHIR R5 Appointment and HL7 FHIR R5 Appointment Status
Map each patient message to what the clinic knows
The sample messages below are illustrative templates. Keep status wording under workflow control across chat, email and SMS. Populate a confirmation’s date, local time and site or visit mode from the confirmed record. Put check-in instructions in the confirmation only when they come from the clinic’s approved instructions for that booking.
| State or condition | Evidence the workflow needs | Example patient message |
|---|---|---|
Request received, or appointment proposed |
The intake request was saved. Any suggested time is still subject to booking. | We received your request for Thursday evening. We’ll send a separate message if the clinic confirms a time. |
Appointment pending or local review open |
The request has an owner and a required decision is outstanding. | The scheduling team is reviewing your request. We’ll contact you with the next step. |
Appointment booked |
The scheduler confirms the appointment reference and visit details. | Your appointment is confirmed for Thursday, 3 December, at 5:30 pm at the clinic’s main site. |
| Cancellation requested | The request to cancel was saved and the scheduler’s outcome is still unresolved. | We received your cancellation request. We’ll send a separate message when the clinic confirms the cancellation. |
Appointment cancelled |
The scheduler confirms cancellation of the identified booking. | Your appointment on Thursday, 3 December, at 5:30 pm has been cancelled. |
A patient can ask how to check in before arriving. Send instructions for the verified booking when appropriate. Mark the patient as checked in only after the clinic’s check-in workflow records that action. In FHIR R5, checked-in indicates that pre-visit administrative work is complete, while arrived represents a patient who has arrived and is waiting. Map each state according to what the clinic actually records. HL7 FHIR R5 Appointment Status
Send unclear requests and slot conflicts to a dispatcher
In the illustrative scenario, suppose the patient’s message leaves the site unclear. The chatbot saves Thursday after work as a preference and asks which site the patient can attend. If the answer still leaves more than one plausible interpretation, assign the request to a dispatcher. The queue item shows the request reference, the confirmed preferences, the question still open, and any offered slot with the time it was last checked. When intake begins on the phone, the same handoff can carry forward answers the caller already confirmed. Design a Phone Handoff for Repeated Recognition Failures
Now suppose the patient confirms the site and picks the late opening. The booking service submits the request through the scheduler’s normal booking operation, where availability must hold when the scheduler accepts the write. A fresh lookup on its own still leaves time for a competing booking. If the scheduler rejects the write because the slot was taken, attach the rejection to the request and give the dispatcher the current schedule. The dispatcher can offer alternatives, verify the patient’s selection and book through the scheduler. If no option fits, record the disposition and tell the patient what happened to their request. Keep the original preference visible so staff can offer a relevant alternative.
If the scheduler times out after submission, the booking may already exist. Keep the request open while the integration looks for the attempt in the scheduler using a reference the scheduler accepts. Reuse the same operation key for a retry only where the scheduler documents that behavior. Otherwise have staff reconcile the appointment before another write. The same rule applies to an uncertain cancellation. Write Error Responses an AI Workflow Can Route Safely
Check what leaves the message queue
Record the scheduler event and create its outbound message in one transaction in the integration’s own store. Reconcile missing events against the scheduler where the integration supports a read-back. Key each outbound message by appointment, scheduler revision or equivalent transition identifier, and message type. A repeated update should reuse the same outbound record. Where the messaging provider supports deduplication, give it a stable send key too. Keep the current scheduling status separate from delivery status so a failed SMS can be retried or assigned to staff while the appointment remains booked.
Before sending an unsent confirmation, recheck the latest relevant scheduling state so a newer cancellation or reschedule can suppress stale details. If a confirmation has already gone out, send the appropriate update once the new state is recorded. When a patient reschedules, keep the original booking’s status visible until the scheduler establishes what happened to it and to the replacement. The patient should be able to tell which appointment remains in effect.
Test the full path with a slot taken between lookup and submission, a successful booking with a lost reply, and a cancellation arriving while a confirmation is waiting to send. Include an ambiguous site and an existing appointment the patient asks to move. For each test, inspect the appointment record, the dispatcher’s queue and every message the patient would receive. A rejected slot should leave one owned request and zero confirmations. A lost reply followed by a verified booking should leave one booking and one eligible confirmation. A cancellation recorded before the confirmation is sent should make the queued confirmation ineligible. During a pilot, review any confirmation without a matching confirmed booking at send time and any open request with no assigned owner. These checks can expose a broken flow while the chatbot’s responses still read fluently.
Sources
- Appointment request workflow, availability checks and participant responses. HL7 FHIR R5 Appointment
- Definitions for proposed, pending, booked, cancelled, arrived and checked-in. HL7 FHIR R5 Appointment Status
Audit one booking workflow
Bring a redacted scheduling conversation, the clinic’s patient message templates and a list of scheduler statuses. Insonl can map where the request becomes a booking, which messages that change permits, and which cases need a dispatcher. The audit is free. Insonl charges for follow-on work you commission. Request a free AI workflow audit