HL7 SQR_S25 Schedule Query Response
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
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.