QSU^Q01 — Cancel Subscription / Acknowledge Message
Server-side, in continuous query / unsolicited update mode: QSU notifies the client that its subscription is cancelled by the server.
Purpose
QSU is emitted by an HL7 server when it unilaterally terminates a subscription previously registered by the client (typically via a QSB message). Typical cases:
- subscribed-event quota reached;
- security policy: the client is no longer authorised to receive this data;
- server maintenance or decommissioning;
- time-based subscription expiry.
The QSB → QSU pattern is the HL7 v2 ancestor of FHIR R5 Subscription: instead of a REST push, the server emits messages triggered by events.
Segment structure
QSU_Q01
MSH Message Header (mandatory)
[ SFT ] Software Segment (optional)
MSA Message Acknowledgment (mandatory)
[ { ERR } ] Error (optional, repeatable)
QID Query Identification (mandatory) MSH — MSA
- MSH-9:
QSU^Q01^QSU_Q01. - MSA-1: return code (table 0008).
- MSA-2: identifier of the original subscription.
QID — Query Identification
- QID-1: query identifier (same as the one in the originating QSB).
- QID-2: server-side logical query name.
Real-world example
The EHR server cancels subscription SUBSCRIB-001 of the cardiac monitor (the
session has reached its expiry):
MSH|^~\&|EHR|HOSP01|MONITOR|CLINIC02|20260515153000||QSU^Q01^QSU_Q01|MSG00015001|P|2.5.1
MSA|AA|SUBSCRIB-001
QID|SUBSCRIB-001|Subscribe-OBX-CARDIAC^Continuous query for cardiac OBX^L Full subscription lifecycle
QSB— client subscribes to an event type.ACK— server confirms subscription.- Server then emits unsolicited messages to the client on each event (for instance ORU for lab results).
QSU— server cancels the subscription when it chooses.QSX— client may also cancel unilaterally.
Acknowledgment (ACK)
MSH|^~\&|MONITOR|CLINIC02|EHR|HOSP01|20260515153001||ACK^Q01^ACK|ACK00015001|P|2.5.1
MSA|AA|MSG00015001 Common errors
- QSU without QID: the client does not know which subscription to cancel.
- MSA-2 does not match the originating QSB: ambiguous on the client side.
- Continuing to send messages after QSU: once cancelled, no further unsolicited message must be emitted for that QID.
See also: QRY^A19, ADR^A19, and FHIR Subscription.