HL7 SQM_S25 Schedule Query

HL7 message structure SQM_S25 groups and segments from HL7 v2.5.1 Hide structure

These are the generated groups and segments for the version selected at the top of the page. The article explains the workflow, and this panel follows the chosen HL7 version.

Message Structure

SegmentNameRequiredRepeatable
Message Header Yes No
Original-Style Query Definition Yes No
Original style query filter No No
SQM_S25.REQUEST
Request group No No
Appointment Request Yes No
Appointment Preferences No No
Patient Identification No No
SQM_S25.RESOURCES
Resources group Yes Yes
Resource Group Yes No
SQM_S25.SERVICE
Service group No Yes
Appointment Information Yes No
Appointment Preferences No No
SQM_S25.GENERAL_RESOURCE
General Resource group No Yes
Appointment Information - General Resource Yes No
Appointment Preferences No No
SQM_S25.PERSONNEL_RESOURCE
Personnel Resource group No Yes
Appointment Information - Personnel Resource Yes No
Appointment Preferences No No
SQM_S25.LOCATION_RESOURCE
Location Resource group No Yes
Appointment Information - Location Resource Yes No
Appointment Preferences No No
Continuation Pointer No No

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

MSH|^~\&|PORTAL|CITYHOSP|SCHED|CITYHOSP|20260720103000||SQM^S25^SQM_S25|SQM250001|P|2.5.1 QRD|20260720103000|R|I|SQM250001|||10^RD|SOP^Open slots^HL70048|CARD^Cardiology^L QRF|SCHED|20260722080000|20260722170000 ARQ|REQ-OPEN-CARD||||ROUTINE^Routine request^L||CARDREV^Cardiology review^L|30|min|^^^20260722080000^20260722170000 APR|||^^^20260722090000^20260722120000 PID|1||123456^^^CITYHOSP^MR||Smith^Jane^Anne^^Ms^^L RGS|1 AIS|1||CARDREV^Cardiology review^L AIL|1||CARD^^^CITYHOSP AIP|1|||CARD^Cardiologist^L

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.