HL7 v2.5.1 Specificationsv2.5.1

to moveEnter to openTry PID-5, ADT, 0004

QRY: Query, original mode

This page lists the structures and trigger events QRY defines, taken from the standard. The written commentary that theADT page carries has not been written for QRY.

Recognising QRY messages

QRY announces itself in MSH-9 like this:

MSH-9QRY^A19^QRY_A19
  1. MSH-9.1QRYmessage code: what kind of message this is
  2. MSH-9.2A19trigger event: what happened in the real world: patient query
  3. MSH-9.3QRY_A19message structure: which segments to expect, and in what order

How to use these specifications explains MSH-9 in full, with a worked example.

Message structures

QRY takes 4 structures.

QRY_A19: Patient Query

Sent when one thing happens: A19: Patient Query.

You must always send: MSH, QRD. Everything else is optional, or required only inside a group you chose to send.

SegmentNameOPTCardinality
MSHR1..1
SFTO0..*
QRDR1..1
QRFO0..1

QRY_PC4: Patient Care Problem Query

4 different trigger events send this structure:

The segments below are the same for all 4. HL7 varies the meaning, not the shape: there is no separate QRY_PC9 layout. What changes is MSH-9, which tells the receiver which of the 4 happened and therefore what to do with the message.

SegmentNameOPTCardinality
MSHR1..1
SFTO0..*
QRDR1..1
QRFO0..1

QRY_Q01: original mode display query - immediate response

5 different trigger events send this structure:

The segments below are the same for all 5. HL7 varies the meaning, not the shape: there is no separate QRY_Q27 layout. What changes is MSH-9, which tells the receiver which of the 5 happened and therefore what to do with the message.

SegmentNameOPTCardinality
MSHMessage HeaderR1..1
SFTSoftwareO0..*
QRDQuery DefinitionR1..1
QRFQuery FillerO0..1
DSCContinuation PointerO0..1

QRY_R02

Sent when one thing happens: R02: R02.

You must always send: MSH, QRD, QRF. Everything else is optional, or required only inside a group you chose to send.

SegmentNameOPTCardinality
MSHR1..1
SFTO0..*
QRDR1..1
QRFR1..1

Trigger events

The trigger event is the real-world thing that made the message get sent. QRY defines 14.

EventNameStructure
A19Patient QueryQRY_A19
PC4Patient Care Problem QueryQRY_PC4
PC9Patient Goal QueryQRY_PC4
PCEPatient Pathway (Problem-Oriented) QueryQRY_PC4
PCKPatient Pathway (Goal-Oriented) QueryQRY_PC4
Q01original mode display query - immediate response
Q02deferred query
Q26Pharmacy/Treatment Order ResponseQRY_Q01
Q27Pharmacy/Treatment Administration InformationQRY_Q01
Q28Pharmacy/Treatment Dispense InformationQRY_Q01
Q29Pharmacy/Treatment Encoded Order InformationQRY_Q01
Q30Pharmacy/Treatment Dose InformationQRY_Q01
R02R02QRY_R02
T12Document Query