Lab Order Tools
Lifecycle: initialize, find a center, book, reschedule, cancel.
initializeLabOrder
Submits a "Paid" order to the lab. Profile must have gender, phone (with dial code), birth date, and complete home address.
| Parameter | Required |
|---|---|
labOrderExternalId | yes |
Before calling: getProfile() to verify required fields. Use updateProfile to fix anything missing.
searchLabServiceCenters
Patient Service Centers near a ZIP, sorted by distance. Use after order reaches "Requisition Created".
| Parameter | Required | Notes |
|---|---|---|
zipCode | yes | — |
labOrderExternalId | yes | Determines which lab network to search |
limit | no | Default 6 |
offset | no | Pagination, default 0 |
Returns: centers array (each with siteCode, name, phone, address, distanceMiles, hours) plus pagination fields.
getServiceCenterSlots
Available appointment time slots at a center. Ask the user for date / time preference first so you can set startDate and rangeDays.
| Parameter | Required |
|---|---|
siteCode | yes (from searchLabServiceCenters) |
labOrderExternalId | yes |
timezone | yes (IANA, e.g. America/New_York) |
startDate | no, defaults to today |
rangeDays | no, default 7 |
Always present slots and let the user choose. Don't pick automatically. If no slots are available, offer to search later dates by calling again with a later startDate.
bookLabAppointment
Books an appointment using a bookingKey from getServiceCenterSlots. Order must be in "Requisition Created" or "Appointment Cancelled" status.
Use this (not rescheduleLabAppointment) to book after a cancellation.
| Parameter | Required |
|---|---|
labOrderExternalId | yes |
bookingKey | yes |
timezone | yes |
Always confirm date, time, and location with the user before booking.
rescheduleLabAppointment
Reschedules an existing appointment. Only works when the order is in "Appointment Scheduled" status. The previous appointment auto-cancels.
If already cancelled, use bookLabAppointment instead.
| Parameter | Required |
|---|---|
labOrderExternalId | yes |
bookingKey | yes (new slot) |
timezone | yes |
cancelLabAppointment
Two-step: first call without reasonId to get available reasons, then call again with the chosen reason.
| Parameter | Required | Notes |
|---|---|---|
labOrderExternalId | yes | — |
reasonId | no | Omit to get reasons; pass to confirm cancellation |

