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:
QRY^A19^QRY_A19- MSH-9.1
QRYmessage code: what kind of message this is - MSH-9.2
A19trigger event: what happened in the real world: patient query - MSH-9.3
QRY_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.
QRY_PC4: Patient Care Problem Query
4 different trigger events send this structure:
- PC4Patient Care Problem Query
- PC9Patient Goal Query
- PCEPatient Pathway (Problem-Oriented) Query
- PCKPatient Pathway (Goal-Oriented) Query
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.
QRY_Q01: original mode display query - immediate response
5 different trigger events send this structure:
- Q26Pharmacy/Treatment Order Response
- Q27Pharmacy/Treatment Administration Information
- Q28Pharmacy/Treatment Dispense Information
- Q29Pharmacy/Treatment Encoded Order Information
- Q30Pharmacy/Treatment Dose Information
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.
| Segment | Name | OPT | Cardinality |
|---|---|---|---|
| MSH | Message Header | R | 1..1 |
| SFT | Software | O | 0..* |
| QRD | Query Definition | R | 1..1 |
| QRF | Query Filler | O | 0..1 |
| DSC | Continuation Pointer | O | 0..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.
Trigger events
The trigger event is the real-world thing that made the message get sent. QRY defines 14.
| Event | Name | Structure |
|---|---|---|
| A19 | Patient Query | QRY_A19 |
| PC4 | Patient Care Problem Query | QRY_PC4 |
| PC9 | Patient Goal Query | QRY_PC4 |
| PCE | Patient Pathway (Problem-Oriented) Query | QRY_PC4 |
| PCK | Patient Pathway (Goal-Oriented) Query | QRY_PC4 |
| Q01 | original mode display query - immediate response | |
| Q02 | deferred query | |
| Q26 | Pharmacy/Treatment Order Response | QRY_Q01 |
| Q27 | Pharmacy/Treatment Administration Information | QRY_Q01 |
| Q28 | Pharmacy/Treatment Dispense Information | QRY_Q01 |
| Q29 | Pharmacy/Treatment Encoded Order Information | QRY_Q01 |
| Q30 | Pharmacy/Treatment Dose Information | QRY_Q01 |
| R02 | R02 | QRY_R02 |
| T12 | Document Query |