Schedule care and transfer prescriptions
Book, reschedule, or cancel appointments and transfer a prescription from the assistant
These tools act outside b.well. They book, reschedule, and cancel appointments with the user's health system, and transfer a prescription to a pharmacy store for pickup.
Before you start
These tools are optional; leave them out if users book care or transfer prescriptions in your web app. The health systems, providers, and pharmacy partners they reach are configured for your client. Contact b.well for what's available for your client and environment, and for your scheduling_client value. Booking also uses provider_search from Provider Search & Data Connections, so check your tools/list result for it before you build on these tools. Scheduling & Appointments and Pharmacy document each tool.
The server doesn't confirm register_patient, schedule_appointment, reschedule_appointment, cancel_appointment, or transfer_prescription, so configure your host to ask the user before each one runs, or ask in your application if your host has no approval setting.
Book an appointment
This sequence uses Direct Scheduling (is_direct_scheduling: true, the default), with a provider the user already sees through the health system's patient portal.
- Call
provider_searchto find the provider's NPI and the facility ID of their department. - Call
get_visit_typesand keep thecodeof the visit type the user chooses. If it fails because the user isn't registered with the health system, callregister_patientwith the facility ID asdepartment_id, then callget_visit_typesagain. - Call
search_scheduling_slotswith that code and the provider and facility IDs. - Call
schedule_appointmentwith the slot the user picks. Its section shows how each argument maps from the slot.
If schedule_appointment returns no appointment, the booking may still exist, so check get_appointments before you retry.
Reschedule or cancel
- Call
get_appointmentsand find the appointment the user means. Itsidis theappointment_idthe next step takes. - To reschedule, find a new slot with
search_scheduling_slots, then callreschedule_appointment. To cancel, callget_cancel_reasons, thencancel_appointmentwith the reason the user picks.
Transfer a prescription
- Call
check_transfer_eligibilitywith the bareidof the prescription'sMedicationRequest. - Call
find_pharmacy_storeswith the user's ZIP code, thenget_pharmacy_hoursfor the chosen store's pickup times. - Call
transfer_prescriptionwith the store and pickup time the user picks, the patient details fromget_user_profile, and the Rx number and current pharmacy's name and phone, which you ask the user for. No tool cancels or reverses a transfer, and a failed call can still have submitted it, so don't retry it automatically.
Guide the model
These points add to the base guidance. Use them if your host accepts your own instructions, and adapt them to your use case. They reinforce the tool descriptions and don't replace them. Your host's or your application's approval is what keeps the user in control of these writes; these points help the model ask at the right moment.
- Before booking, rescheduling, or cancelling an appointment, or transferring a prescription, restate the details (provider, location, date, time, and time zone, or pharmacy and pickup time) and wait for the user to confirm.
- Pass the
timezonefromsearch_scheduling_slotstoschedule_appointmentastimezone_title. Without it, a fixed fallback time zone applies. - Pass the user's location when searching for providers or pharmacies, and ask for it if you don't have it.
- If
schedule_appointmentreturns no appointment, checkget_appointmentsbefore trying again. - Never retry
transfer_prescriptionautomatically. If it fails, tell the user. - Ask the user for the Rx number and their current pharmacy's name and phone number rather than guessing.
Updated about 17 hours ago

