Chapter 05: Query
This chapter covers questions asked to another system and the answers it sends back.
Most HL7 v2 messages push information to a receiver without a request. This chapter covers the messages that ask for information. One system sends a query, and the other system sends a response. The standard has several generations of query mechanism, and this chapter defines all of them. Queries are less common than pushed messages.
What is in this chapter
- 61 trigger eventsthe real-world things that cause one of these messages to be sent
- 16 segmentsthe lines these messages are built from, and the fields on each
- 17 code tablesthe value sets the fields in this chapter draw from
- 18 message typesDSR, EDR, EQQ, ERP, QBP, QCK, QCN, QSB, QSX, QVR, RDY, RQQ, RSP, RTB, SPQ, TBR, UDM, VQQ
Message types defined here
DSRDisplay responseNamed by the standard without a structure of its own.
EDREnhanced display responseNamed by the standard without a structure of its own.
EQQEmbedded query language queryNamed by the standard without a structure of its own.
ERPEvent replay responseNamed by the standard without a structure of its own.
QBPQuery by parameter6 structures, fired by 22 trigger events.
QCKDeferred queryNamed by the standard without a structure of its own.
QCNCancel query1 structure, fired by 2 trigger events.
QSBCreate subscription1 structure, fired by 2 trigger events.
QSXCancel subscription/acknowledge messageNamed by the standard without a structure of its own.
QVRQuery for previous events1 structure, fired by 1 trigger event.
RDYDisplay based response1 structure, fired by 2 trigger events.
RQQEvent replay queryNamed by the standard without a structure of its own.
RSPSegment pattern response10 structures, fired by 13 trigger events.
RTBTabular response3 structures, fired by 7 trigger events.
SPQStored procedure requestNamed by the standard without a structure of its own.
TBRTabular data responseNamed by the standard without a structure of its own.
UDMUnsolicited display update messageNamed by the standard without a structure of its own.
VQQVirtual table queryNamed by the standard without a structure of its own.
Segments defined here
These 16 segments are defined in chapter 05. Messages in other chapters may still carry them.
DSPdisplay data segmentEQLEmbedded Query LanguageERQEvent replay queryQAKquery acknowledgment segmentQIDquery identification segmentQPDquery parameter definitionQRDOriginal-Style Query DefinitionQRFOriginal style query filterQRIquery response instance segmentRCPresponse control parameter segmentRDFtable row definition segmentRDTtable row data segmentSPRStored Procedure Request DefinitionURDResults/update DefinitionURSUnsolicited SelectionVTQVirtual Table Query Request
Trigger events
A trigger event is the thing that happens in the hospital and causes a message to be sent. Chapter 05 defines 61 of them.
J01cancel query/acknowledge messageJ02cancel subscription/acknowledge messageK11Segment pattern response in response to QBP^Q11K13Tabular response in response to QBP^Q13K15Display response in response to QBP^Q15K21Get person demographics responseK22Find candidates responseK23Get corresponding identifiers responseK24Allocate identifiers responseK25Personnel Information by Segment ResponseK31RSP – Dispense HistoryQ01original mode display query - immediate responseQ02deferred queryQ03deferred response to a queryQ04embedded query language queryQ05unsolicited display update messageQ07Virtual Table queryQ08stored procedure requestQ09event replay queryQ11Query by parameter requesting an RSP segment pattern responseQ13Query by parameter requesting an RTB - tabular responseQ15Query by parameter requesting an RDY display responseQ16Create subscriptionQ17query for previous eventsQ21Get person demographicsQ22Find candidatesQ23Get corresponding identifiersQ24Allocate identifiersQ25Personnel Information by Segment QueryQ31QBP – Dispense HistoryR07Enhanced Display ResponseR08Tabular Data ResponseR09Event Replay ResponseR11Z73Z74Z75Z76Z77Z78Z79Z80Z81Z82Z83Z84Z85Z86Z87Z88Z89Z90Z91Z92Z93Z94Z95Z96Z97Z98Z99
