HL7 SQR_S25 Schedule Query Response

HL7 message structure SQR_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
Message Acknowledgment Yes No
Error No Yes
Query Acknowledgment Yes No
SQR_S25.SCHEDULE
Schedule group No Yes
Scheduling Activity Information Yes No
Timing/Quantity No Yes
Notes and Comments No Yes
SQR_S25.PATIENT
Patient group No No
Patient Identification Yes No
Patient Visit No No
Patient Visit - Additional Information No No
Diagnosis No No
SQR_S25.RESOURCES
Resources group Yes Yes
Resource Group Yes No
SQR_S25.SERVICE
Service group No Yes
Appointment Information Yes No
Notes and Comments No Yes
SQR_S25.GENERAL_RESOURCE
General Resource group No Yes
Appointment Information - General Resource Yes No
Notes and Comments No Yes
SQR_S25.PERSONNEL_RESOURCE
Personnel Resource group No Yes
Appointment Information - Personnel Resource Yes No
Notes and Comments No Yes
SQR_S25.LOCATION_RESOURCE
Location Resource group No Yes
Appointment Information - Location Resource Yes No
Notes and Comments No Yes
Continuation Pointer No No

SQR_S25 is the response to an SQM_S25 schedule query. The filler application uses it to return matching schedule information, such as open slots, booked slots, blocked time, or availability for the requested service and resources. It can also signal that the query failed or could not be answered as requested.

In real interfaces, SQR is often a bridge between a calendar search and a booking request. The requester shows or processes the returned options, then sends a separate SRM_S01 if it wants the filler to actually reserve one of them.

A small SQR S25 example

MSH|^~\&|SCHED|CITYHOSP|PORTAL|CITYHOSP|20260720103002||SQR^S25^SQR_S25|SQR250001|P|2.5.1 MSA|AA|SQM250001 QAK|SQM250001|OK|SOP^Open slots^HL70048 SCH|REQ-OPEN-CARD|FILL-883500||ROUTINE^Routine request^L|OPEN|CARDREV^Cardiology review^L|30|min|^^^20260722090000^20260722093000|||||12345^Planner^Paula TQ1|1||||||20260722090000|20260722093000 PID|1||123456^^^CITYHOSP^MR||Smith^Jane^Anne^^Ms^^L RGS|1 AIS|1||CARDREV^Cardiology review^L|20260722090000|30|min AIL|1||CARD^ROOM2^^CITYHOSP|20260722090000|30|min AIP|1||12345^Careful^Clara|CARD^Cardiologist^L|20260722090000|30|min SCH|REQ-OPEN-CARD|FILL-883501||ROUTINE^Routine request^L|OPEN|CARDREV^Cardiology review^L|30|min|^^^20260722101500^20260722104500 RGS|2 AIS|1||CARDREV^Cardiology review^L|20260722101500|30|min AIL|1||CARD^ROOM3^^CITYHOSP|20260722101500|30|min

What workflow it represents

The sender is the filler application that owns the schedule. The receiver is the querying application that sent the SQM. The response may be immediate, or in deferred original-mode workflows it may arrive later as an unsolicited response that the original requester acknowledges.

A good receiver treats SQR as schedule information, not a booking promise. Open slots can disappear after the response is generated. If the user chooses one, the booking request still needs to succeed through SRM or whatever local booking workflow the two systems agreed to use.

How to read the structure

MSA acknowledges the query message, and ERR can report failures. QAK is the query acknowledgment, usually where the receiver tells the sender whether the query was OK, returned no data, or had a problem.

The schedule group repeats for each returned appointment or slot. SCH carries the schedule activity, TQ1 can describe timing, the optional patient group adds PID and visit or diagnosis context, and the resource group uses RGS, AIS, AIG, AIP, and AIL. DSC appears when the result set continues beyond this response.

Implementation traps

The first trap is losing the query identity. QAK should let the requester match the response to the original SQM, especially when a user searches several resources or date ranges at once.

The second trap is treating display order as meaning. If the response returns several slots, document the sorting rule and the fields the requester should use to display, compare, and select them. A slot is only useful if the receiver can tell which schedule, service, resource, and start time it belongs to.

Reference notes

HL7 Chapter 10 describes SQR_S25 as the filler application's response to an SQM schedule query, returning requested schedule information or signaling an interfacing error. The same section defines continuation and deferred-response behavior for original-mode schedule queries.