HL7 SQM_S25 Schedule Query
SQM_S25 is the original-mode record-oriented query for schedule information. A querying application sends it when it wants information from a filler application's schedule: open slots, booked slots, blocked time, or availability for a particular service, location, provider, or resource.
This is a legacy query style, and newer interfaces often use other patterns or APIs for scheduling availability. But when SQM is present in a v2 interface, it needs the same discipline as any other query: clear criteria, a clear response format, and a rule for what the requester should do with no matches, too many matches, or continuation.
A small SQM S25 example
What workflow it represents
The sender is usually a portal, call-center application, integration engine, or clinical system trying to find schedule information before presenting choices to a user or before sending an appointment request. The receiver is the filler application that owns the schedule. The usual response is SQR_S25.
Unlike SRM_S01, SQM_S25 does not ask the filler to book anything. It asks a question. A common workflow is query first with SQM, let a user choose from returned availability, then request the actual booking with SRM.
How to read the structure
QRD carries the original-mode query definition: timing, format, priority, query ID, quantity limits, and subject filter. QRF can narrow the scope, often by department, date range, or other schedule-owner filter.
The optional request group lets the query use scheduling vocabulary instead of only generic query fields. ARQ and APR describe the requested appointment shape or preferences. PID can identify the patient when availability depends on patient context. The resource group uses RGS, AIS, AIG, AIL, and AIP to say what service or resource the requester is asking about. DSC handles continuation.
Implementation traps
The easy mistake is building a vague query and expecting the filler to guess intent. If QRD asks for "open slots" but the ARQ/AIS/AIL/AIP detail is empty or locally ambiguous, the response may be useless even though the message parses.
The other trap is stale availability. Schedule data is only true when the filler generated the response. If users can hold a slot on screen for minutes before booking, the SRM request still needs a clean rejection path when that slot has already disappeared.
Reference notes
HL7 Chapter 10 describes SQM/SQR as the original-mode record-oriented query and response for schedule information. HL7 Terminology lists SQM and SQR as schedule query message types and marks the S25 event as deprecated in newer terminology, which is a useful clue that this is mainly a legacy pattern.