SQM^S25 — Schedule Query Message
Schedule query: the EHR or patient portal asks the scheduling system what is booked for a patient, a resource (bed, room) or a provider.
Purpose
SQM^S25 asks the scheduling system for the list of slots matching given criteria (patient, resource, date range, procedure type). The receiver replies with an SQR^S25 containing the found appointments (SCH + AIS/AIL/AIP segments). The S25 event is the symmetric query/response round-trip.
Segment structure
Structure SQM_S25: MSH, QRD, [QRF], [ARQ], RGS, [AIS], [AIG], [AIL], [AIP], [APR].
| Segment | Role |
|---|---|
QRD | Query Definition — general criteria, response format. |
QRF | Query Filter — facility, dates, diagnosis codes. |
ARQ | Appointment Request — queried appointment details. |
RGS | Resource Group Segment — resource group. |
AIS / AIG / AIL / AIP | Appointment Information — Services / General Resources / Location / Personnel. |
Real-world example
EHR query to SchedulingSystem for a patient's June 2026 colonoscopies:
MSH|^~\&|EHR|HOSP01|SCHED|HOSP01|20260518140000||SQM^S25^SQM_S25|SQM25001|P|2.5.1|||AL|NE
QRD|20260518140000|R|I|SQM25001|||50^RD|MR300999^^^HOSP^MR|APT|SCH|^
QRF|HOSP01||20260601000000|20260630235959|||||
ARQ|REQID20260518001|||SCREEN^Screening Colonoscopy|||N|||30^MIN|||||||||DR_MERCIER^Mercier^Anne||||||||
RGS|1|A
AIS|1|A|COLO45^Full Colonoscopy^L|20260615090000|||30^MIN
AIL|1|A|ENDO01^Endoscopy Room 1^HOSP01|||20260615090000|||30^MIN
AIP|1|A|DR_MERCIER^Mercier^Anne||GASTRO^Gastroenterology^HL70184|||20260615090000|||30^MIN Response (SQR^S25)
MSH|^~\&|SCHED|HOSP01|EHR|HOSP01|20260518140003||SQR^S25^SQR_S25|SQR25001|P|2.5.1
MSA|AA|SQM25001
QAK|SQM25001|OK
QRD|20260518140000|R|I|SQM25001|||50^RD|MR300999^^^HOSP^MR|APT|SCH|^
SCH|APT202606150900|REQID20260518001|||REQID20260518001|COLO45^Full Colonoscopy^L|SCREEN^Screening Colonoscopy|R|30^MIN|||^^^20260615090000^20260615093000^A^N|||DR_MERCIER^Mercier^Anne
PID|1||MR300999^^^HOSP^MR||COLIN^EVE^^^MS.||19790922|F
RGS|1|A
AIS|1|A|COLO45^Full Colonoscopy^L|20260615090000|||30^MIN Common errors
- Empty QRD-9: without a Who Subject Filter (patient ID, resource, provider) the query is ambiguous.
- Bad QRF-3 / QRF-4 bounds: inverted time bounds yield silent empty replies.
- Response without QAK: some stacks need QAK-2 (OK/AE/AR/NF) to qualify the result.
- Confusion with SIU: SIU emits a scheduling event, SQM queries it.