MSA-1-Acknowledgement code in the above sentence. The dialogue is
ended.
Situation 2: Malformed Query
The query message got to the Server and is legitimate, but the Server cannot
process the query for some reason, i.e., the query is malformed.
The Response message indicates a negative acknowledgement and shows the problem
in the ERR. The response message contains the MSH, MSA, ERR, QAK and the query
defining segment if available. That is, the Server creates an ACK message with
AE in MSA-1-Acknowledgement code in the above sentence. The rest of the
message is absent.
Note that the continuation (DSC) segment is not sent or, if it is, its
continuation pointer field (DSC-1-Continuation pointer) is null.
Note: The use of AE (application error) and AR (application reject)
codes in QAK-2-Query response status has been deprecated in favor of the
ERR segment.
Situation 3: No data found
The query is well formed, but there is no data to be returned by the query.
This is not strictly an error condition. This example clarifies the protocol to
be followed.
The Response message contains MSH, MSA, QAK, and query defining segment. The
QAK would indicate "no records found". The rest of the message is absent, i.e.,
no blank rows or segments are sent.
Note: If the responding application successfully processes the query,
but is unable to find any qualifying data, this is not an error condition. The
responding application returns an Application Accept (AA) in the MSA segment of
the query response message, but does not return any data segments (DSP, RDT, or
iterations of the items that are counted in hit counts). The continuation
(DSC) segment is not sent or, if it is, its continuation pointer field
(DSC-1- Continuation pointer) is null. If the QAK segment is being
used, the field QAK-2-Query response status is valued with NF (no data
found, no errors).
This section outlines the framework/process of the publish and subscribe machinery.
"Publish
and subscribe" refers to the ability of one system, the ´Publisher', to
offer a data stream that can be sent to recipient systems upon subscription.
In one sense, the entire HL7 unsolicited update paradigm, in which the sender
sends out a stream of messages to recipients, is a kind of publish and
subscribe mechanism. Subscriptions to unsolicited updates are established at
interface set-up time when analysts on both sides agree to start sending a
stream of data.
This section describes a mechanism by which the Publisher defines a stream of
data, but also agrees to selectively subset the message stream based on
query-like data constraints. In the normal case, the right of the Subscriber to
subscribe is decided at interface setup time. At runtime, the Subscriber
controls the data rules under which it sends messages.
Runtime subscription has existed in earlier versions of HL7, but little
attention has been drawn to it. Original mode queries could define an open
ended time interval in QRF-9-When quantity/timing qualifier. The
unexplained semantics of this field had been interpreted to mean: If the QRF-9
specified an end time in the future, then the source system would keep sending
results using the query continuation protocol.
This section elaborates on such a mechanism, and more cleanly ties the
selective filtering into the whole query facility.
Subscription
is a process/protocol that allows one system to request that prospective data
be sent for a specified period of time, or for an open-ended period of time
until further notice.  Specific messages have been defined for subscription
and the canceling of a subscription.
A Publisher is one who possesses and transmits streams of data. The Publisher
might be a mediator or a broker, such as an interface engine. The Publisher is
not necessarily the system that collected the data, but it is the system
willing to transmit it
With traditional "unsolicited update subscriptions", a Publisher sends the
entire data stream to the recipients. A Publisher normally transmits
unfiltered data. However, the Publisher may agree to selectively filter the
stream of data within parameters as defined by analysts. For each filterable
stream, the Publisher defines a Conformance Statement that lists the data
values that may be used in the filter expression, and defines the segment
pattern for the messages that are selected.
If supported in the Conformance Statement, a subscription may be modified at a
later date. RCP-6-Modify indicator is set to "M", and the Action Code
parameter is set to "A" or "D" as appropriate. If modification is allowed, the
Server bears responsibility for maintaining the filter list. If, as is usually
the case, the onus of retaining the filters is on the Client, modification is
not allowed and would not be part of the Conformance statement.
A
lab system normally sends all reports to the central archive. To provide better
service to other departments, the Lab decides to offer a filtered stream in
addition to the full stream going to the archive.
The lab decides that it will allow recipients to select based on the MRN of the
patient, on the type of study (OBR-4), and on the ordering provider (OBR-16).
It names this filtered stream "ORU-Subscription", and writes a conformance
specification.
At interface setup time, permission is given for four systems, CommunityNorth,
CommunitySouth, CommunityEast and CommunityWest to receive this filtered
stream.
The Conformance Statement for this published filtered stream might be:
Publication ID (Query ID=Z83): |
Z83 |
Type: |
Publish |
Publication Name: |
ORU Subscription |
Query Trigger (= MSH-9): |
QSB^Z83^QSB_Q16 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
ORU^R01^ORU_R01 |
Query Characteristics: |
Returns lab results reports for the patient(s) as constrained in the input parameters. |
Purpose: |
Sends Lab Results, either filtered or unfiltered, as specified in the input parameters. |
Response Characteristics: |
A
standard query response is not received from the server. Instead, actual ORU
messages are returned corresponding to the constraints expressed in the input
parameters. |
Based on Segment Pattern: |
R01 |
QSB^Z83^QSB_Q16 |
Query Grammar: QSB Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
5.5.3 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
ORU^R01^ORU_R01 |
Response Grammar: ORU Message |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
{ |
Begin Patient Result |
||||
[ |
PIDG |
Begin PID Group |
|||
PID |
Patient Identification |
3.4.2 |
|||
[ PD1 ] |
Additional Demographics |
3.4.10 |
|||
[ { NK1 } ] |
Next of Kin/Associated Parties |
3.3.5 |
|||
[ { NTE } ] |
Notes and comments |
2.16.10 |
|||
[ PV1 |
Patient Visit |
PV1G |
Begin PV1 Group |
3.4.3 |
|
[ PV2 ] ] |
Patient Visit - Additional Info. |
Close PV1 Group |
3.4.4 |
||
] |
Close PID Group |
||||
{ |
OBRG |
Begin OBR Group |
|||
[ ORC ] |
Order Common |
4.5.1 |
|||
OBR |
Observations Report ID |
7.4.1 |
|||
[ { NTE } ] |
Notes and Comments |
2.16.10 |
|||
{ |
OBXG |
Begin OBX Group |
|||
[ OBX ] |
Observation/Result |
7.4.2 |
|||
[ { NTE } ] |
Notes and Comments |
||||
} |
Close OBX Group |
||||
{ [ CTI ] } |
Clinical Trial Identification |
7.8.4 |
|||
} |
Close OBR Group |
||||
} |
Close Patient Result |
||||
[ DSC ] |
Continuation Pointer |
2.16.4 |
QPD
Input Parameter Specification
Field Seq (Query ID=Z83) |
ColName |
Key/ |
Sort |
LEN |
DT |
Opt |
RP/# |
Match Op |
TBL # |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
Message Query Name |
|||||||
2 |
QueryTag |
32 |
ST |
R |
Query Tag |
|||||||
3 |
MRN |
CX |
O |
Y |
PID.3 |
|||||||
4 |
ActionCode |
ID |
O |
0323 |
||||||||
5 |
PatientLocation |
PL |
O |
Y |
PV1.3 |
|||||||
6 |
HospitalService |
IS |
O |
Y |
PV1.10 |
|||||||
7 |
SRVC |
CE |
O |
Y |
OBR.4 |
|||||||
8 |
PVDR |
CN |
O |
Y |
OBR.16 |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z83) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z83^ORU Subscription^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
MRN |
CX |
One or more patient identifiers may be sent. When a list is provided, results will be sent if any parameter matches any ID known for a patient. Sending no value matches all patients |
|
ActionCode |
ID |
If the subscription is being modified, the desired action e.g., Add or Delete is carried in this field. |
|
PatientLocation |
PL |
When a list is provided, results will be sent if any parameter matches PV1.3 for any result. Sending no value matches all results. |
|
HospitalService |
IS |
When a list is provided, results will be sent if any parameter matches PV1.10 for any result. Sending no value matches all results. |
|
SRVC |
CE |
When a list is provided, results will be sent if any parameter matches OBR.4 for any result.. Sending no value matches all results. |
|
PVDR |
CN |
When a list is provided, results will be sent if any parameter matches OBR.16 for any result.. Sending no value matches all results. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z99) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
7 |
Segment group inclusion |
256 |
ID |
What segment group(s) are to be included. If this field is not valued, all segment groups will be included. |
To
establish the subscription to see lab results for two patients, an authorized
Subscriber (e.g. CommunityWest) would send a query message with event code
Q99
MSH||CPR|COMWEST|PS^LAB||||QSB^Q99^QSB_Q16|8888|P|2.4|
QPD|Q99^ORU_Subscription^HL7nnnn|Q0044|1234^^^MPI^MR~4567^^^MPI^MR|
RCP||||||N|
As results are generated by the Lab, they are all sent to the archive. In
addition, the Lab has a list of all subscription requests (such as the message,
above). For each message, it checks the query filters associated with the
subscription against the message being considered. If the message matches the
query, it is sent to the recipient.
For example, a hit on patient 4567 would result in the message:
MSH||PS^LAB||CPR|COMWEST||||ORU^R01^ORU_R01|4409|P|2.4|
PID|||4567^^^MPI^MR|....
OBR|....
OBX|...
Note: The result message has message type ORU^R01^ORU_R01 (as
specified by the Conformance Statement).
Canceling
a subscription is analogous to canceling a query. See sections 5.4.6 and 0.
The template would be as follows.
MSH||||||||QSX^Jnn^QSX_J01|
QID
To cancel the subscription cited in the previous section, CommunityWest would
send a query cancel message with event code J99.
MSH||CPR|COMWEST|PS^LAB||||QSX^J99^QSX_J01|
QID|Q0044|Q99^ORU_Subscription^HL70003|
Implementation issues are discussed in section 5.1.
The
following is the structure of the Pharmacy Dispense Information (RDR) message,
an original-mode query that was defined in Chapter 4.
RDR^RDR |
Pharmacy/treatment Dispense Information |
|
|---|---|---|
MSH |
Message Header |
|
MSA |
Message Acknowledgment |
|
[ERR] |
Error |
|
{ |
||
QRD |
Query Definition |
|
[QRF] |
Query Filter |
|
[PID |
Patient Identification |
|
{[NTE]}] |
Notes and Comments (for PID) |
|
{ |
||
ORC |
Common Order |
|
[ |
||
RXE |
Pharmacy/Treatment Encoded Order |
|
{RXR} |
Pharmacy/Treatment Route |
|
{[RXC]} |
Pharmacy/Treatment Component |
|
] |
||
{RXD |
Pharmacy/Treatment Dispense |
|
{RXR} |
Pharmacy/Treatment Route |
|
[{RXC}] |
Pharmacy/Treatment Component |
|
} |
||
} |
||
} |
||
[DSC] |
Continuation Pointer |
The
function served by that query can be more clearly defined within the new query
functionality. In the RDR message, the full meaning of the filter elements in
the QRD and QRF segments could be discerned only by inference. By contrast,
needed parameters can be explicitly defined in the Conformance Statement for
the new Dispense History query, as shown in the following example.
Example: The user wishes to know all the medications dispensed for the patient
whose medical record number is "555444222111" for the period beginning 5/31/98
and ending 5/31/99. The following QBP message is generated.
MSH|^&~\|PCR|Gen
Hosp|PIMS||199811201400-0800||QBP^Z81^QBP_Q11|ACK9901|P|2.4||||||||
QPD|Z81^Dispense
History^HL7nnnn|Q001|555444222111^^^MPI^MR||19980531|19990531|
RCP|I|999^RD|
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 4 prescription dispenses for the period
beginning 5/31/98 and ending 5/31/99and returns the following RSP message:
MSH|^&~\|PIMS|Gen
hosp|PCR||199811201400-0800||RSP^Z82^RSP_Z82|8858|P|2.4||||||||
MSA|AA|ACK9901|
QAK|Q001|OK|Z81^Dispense History^HL7nnnn|4|
QPD|Z81^Dispense
History^HL7nnnn|Q001|555444222111^^^MPI^MR||19980531|19990531|
PID|||555444222111^^^MPI^MR||Everyman^Adam||19600614|M||C|2101 Webster #
106^^Oakland^CA^94612||^^^^^510^6271111|^^^^^510^6277654|||||343132266|||N|||||||||
ORC|RE||89968665||||||199805121345-0700|||77^Hippocrates^Harold^H^III^DR^MD||^^^^^510^
2673600||||||
RXE|1^BID^^19980529|00378112001^Verapamil Hydrochloride 120 mg TAB^NDC
|120||mgm||||||||||||||||||||||||||
RXD|1|00378112001^Verapamil Hydrochloride 120 mg TAB^NDC
|199805291115-0700|100|||1331665|3|||||||||||||||||
RXR|PO||||
ORC|RE||89968665||||||199805291030-0700|||77^Hippocrates^Harold^H^III^DR^MD||^^^^^510^
2673600||||||
RXE|1^^D100^^20020731^^^TAKE 1 TABLET DAILY --GENERIC FOR CALAN
SR|00182196901^VERAPAMIL HCL ER TAB 180MG ER^NDC |100||180MG|TABLET
SA|||G|||0|BC3126631^CHU^Y^L||213220929|0|0|19980821|||
RXD|1|00182196901^VERAPAMIL HCL ER TAB 180MG ER^NDC
|19980821|100|||213220929|0|TAKE 1 TABLET DAILY --GENERIC FOR CALAN
SR||||||||||||
RXR|PO||||
ORC|RE||235134037||||||199809221330-0700|||88^Semmelweis^Samuel^^^DR^MD||^^^^^510^
2673900||||||
RXD|1|00172409660^BACLOFEN 10MG TABS^NDC|199809221415-0700|10|||235134037|5|AS
DIRECTED||||||||||||
RXR|PO||||
ORC|RE||235134030||||||199810121030-0700|||99^Lister^Lenora^^^DR^MD||^^^^^510^
2673700||||||
RXD|1|00054384163^THEOPHYLLINE 80MG/15ML
SOLN^NDC|199810121145-0700|10|||235134030|5|AS DIRECTED||||||||||||
RXR|PO
Query Statement ID (Query ID=Z81): |
Z81 |
Type: |
Query |
Query Name: |
Dispense History |
Query Trigger (= MSH-9): |
QBP^Z81^QBP_Q11 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RSP^Z82^RSP_Z82 |
Query Characteristics: |
May specify patient, medication, a date range, and how the response is to be sorted. |
Purpose: |
To retrieve patient pharmacy dispense history information from the Server. |
Response Characteristics: |
Sorted by Medication Dispensed unless otherwise specified in SortControl. |
Based on Segment Pattern: |
RDS_O01 |
QBP^Z81^QBP_Q11 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
5.5.3 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RSP^Z82^RSP_Z82 |
Response Grammar: Pharmacy Dispense Message |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
5.5.3 |
|||
RCP |
Response Control Parameter |
5.5.5 |
|||
{ |
Query Result Cluster |
||||
[ |
PIDG |
Begin PID Group |
|||
PID |
Patient Identification |
3.4.2 |
|||
[PD1] |
Additional Demographics |
3.4.9 |
|||
[{NTE}] |
Notes and Comments (for PID) |
2.16.10 |
|||
[{AL1} |
Allergy Information |
3.4.6 |
|||
[PV1 |
Patient Visit |
3.4.3 |
|||
[PV2]] |
Patient Visit - Additional Info |
3.4.4 |
|||
] |
End PID Group |
||||
{ |
ORCG |
Begin ORC Group |
|||
ORC |
Common Order |
Each ORC/RXD combination constitutes a "hit." |
|||
[ |
RXOG |
Begin RXO Group |
|||
RXO |
Pharmacy/Treatment Order |
||||
[{NTE}] |
Notes and Comments (for RXO) |
We changed the syntax because we believe there is an error. The RXR should not be optional. |
2.16.10 |
||
{RXR} |
Pharmacy/Treatment Route |
||||
[ |
RXCG |
Begin RXC Group |
|||
{RXC} |
Pharmacy/Treatment Component |
||||
[{NTE}] |
Notes and Comments (for RXC) |
2.16.10 |
|||
] |
End RXC Group |
||||
] |
End RXO Group |
||||
[ |
RXEG |
Begin RXE Group |
|||
RXE |
Pharmacy/Treatment Encoded Order |
||||
{RXR} |
Pharmacy/Treatment Route |
||||
[{RXC}] |
Pharmacy/Treatment Component |
||||
] |
End RXE Group |
||||
RXD |
Pharmacy/Treatment Dispense |
RXDG |
Begin RXD Group |
||
{RXR} |
Pharmacy/Treatment Route |
||||
[{RXC}] |
Pharmacy/Treatment Component |
End RXD Group |
|||
{ |
OBXG |
Begin OBX Group |
|||
[OBX] |
Results |
||||
[{NTE}] |
Notes and Comments (for OBX) |
2.16.10 |
|||
} |
End OBX Group |
||||
} |
End ORC Group |
||||
} |
End Query Results |
||||
[ DSC ] |
Continuation Pointer |
2.16.4 |
Field Seq (Query ID=Z81) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
|||||
MedicationDispensed |
S |
Y |
100 |
CE |
O |
= |
RXD.2 |
RXD-2: Dispense/Give Code |
||||
DispenseDate.LL |
S |
Y |
26 |
TS |
O |
> |
RXD.3 |
RXD-3: Date/Time Dispensed |
||||
DispenseDate.UL |
S |
Y |
26 |
TS |
O |
< |
RXD.3 |
RXD-3: Date/Time Dispensed |
Input
Parameter Field Description and Commentary
Input Parameter (Query ID=Z81) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z81^Dispense History^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) This PATIENT_MASTER entry will be
searched against on the PHARMACY_DISPENSE_TRANSACTION table to retrieve the
rows fulfilling the query conditions. |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
MedicationDispensed |
CE |
If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.LL |
TS |
This is the earliest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.UL |
TS |
This is the latest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
The
user wishes to know all the medications dispensed for the patient whose medical
record number is "555444222111" for the period beginning 5/31/98 and ending
5/31/99. The following QBP message is generated.
MSH|^&~\|PCR|Gen
Hosp|PIMS||199811201400-0800||QBP^Z85^QBP_Q11|8332|P|2.4||||||||
QPD|Z85^Pharmacy Information Comprehensive^HL7nnnn|Q002|555444222111^^^MPI^MR
||||19980531|19990531||RXO~RXG~RXA|
RCP|I|999^RD|
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 4 prescription dispenses and an
electrolytes panel for the period beginning 5/31/98 and ending 5/31/99and
returns the following RSP message:
MSH|^&~\|PIMS|Gen
hosp|PCR||199811201400-0800||RSP^Z86^RSP_Z86|8858|P|2.4||||||||
MSA|AA|8332|
QAK|Q002|OK|Z85^Pharmacy Information Comprehensive^HL70003|4|
QPD|Z85^Pharmacy Information Comprehensive^HL7nnnn|Q002|555444222111^^^MPI^MR
||||19980531|19990531||RXO~RXG~RXA|
PID|||555444222111^^^MPI^MR||Everyman^Adam||19600614|M||C|2101 Webster #
106^^Oakland^CA^94612||^^^^^510^6271111|^^^^^510^6277654|||||343132266|||N|||||||||
ORC|RE||89968665||||||199805121345-0700|||77^Hippocrates^Harold^H^III^DR^MD||^^^^^510^
2673600||||||
RXE|1^BID^^19980529|00378112001^Verapamil Hydrochloride 120 mg TAB^NDC
|120||mgm||||||||||||||||||||||||||
RXD|1|00378112001^Verapamil Hydrochloride 120 mg TAB^NDC
|199805291115-0700|100|||1331665|3|||||||||||||||||
RXR|PO||||
ORC|RE||89968665||||||199805291030-0700|||77^Hippocrates^Harold^H^III^DR^MD||^^^^^510^
2673600||||||
RXE|1^^D100^^20020731^^^TAKE 1 TABLET DAILY --GENERIC FOR CALAN
SR|00182196901^VERAPAMIL HCL ER TAB 180MG ER^NDC |100||180MG|TABLET
SA|||G|||0|BC3126631^CHU^Y^L||213220929|0|0|19980821|||
RXD|1|00182196901^VERAPAMIL HCL ER TAB 180MG ER^NDC
|19980821|100|||213220929|0|TAKE 1 TABLET DAILY --GENERIC FOR CALAN
SR||||||||||||
RXR|PO||||
ORC|RE||235134037||||||199809221330-0700|||88^Semmelweis^Samuel^^^DR^MD||^^^^^510^
2673900||||||
RXD|1|00172409660^BACLOFEN 10MG TABS^NDC|199809221415-0700|10|||235134037|5|AS
DIRECTED||||||||||||
RXR|PO||||
ORC|RE||235134030||||||199810121030-0700|||99^Lister^Lenora^^^DR^MD||^^^^^510^
2673700||||||
RXD|1|00054384163^THEOPHYLLINE 80MG/15ML
SOLN^NDC|199810121145-0700|10|||235134030|5|AS DIRECTED||||||||||||
RXR|PO
OBX|1|ST|2951-2^SODIUM^LN||150|mmol/l|136-148|H||A|F|19850301||199811180700-0800
OBX|2|ST|2823-3^POTASSIUM^LN||4.5|mmol/l|3.5-5|N||N|F|19850301||199811180700-0800
OBX|3|ST|2075-0^CHLORIDE^LN||102|mmol/l|94-105|N||N|F|19850301||199811180700-0800
OBX|4|ST|2028-9^CARBON
DIOXIDE^LN||27|mmol/l|24-31|N||N|F|19850301||199811180700-0800
...
Note the use of OBX-14-Date/time of the observation to time the
laboratory observations.
The
following is a highly experimental approach to establishing a super segment
pattern response to a general purpose query structure. It contains all of the
pharmacy information segments as possible inclusions in the response. It
differs from previously defined segment pattern queries in that it cuts across
multiple related standard HL7 messages although there is a logical hierarchy
that can be determined.
Query Statement ID (Query ID=Z85): |
Z85 |
Type: |
Query |
Query Name: |
Pharmacy Information Comprehensive |
Query Trigger (= MSH-9): |
QBP^Z85^QBP_Q11 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RSP^Z86^RSP_Z86 |
Query Characteristics: |
May specify patient, medication, a date range, how the response is to be sorted, and what segment groups are to be returned. |
Purpose: |
To retrieve patient pharmacy history information from the Server. |
Response Characteristics: |
Sorted by Medication Dispensed unless otherwise specified in SortControl. |
Based on Segment Pattern: |
QBP^Z85^QBP_Q11 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
5.5.3 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RSP^Z86^RSP_Z86 |
Response Grammar: Pharmacy Information Comprehensive |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
5.5.3 |
|||
{ |
RESG |
Begin Results Group |
|||
[ |
PIDG |
Begin PID Group [PIDG] |
|||
PID |
Patient Identification |
3.4.2 |
|||
[PD1] |
Additional Demographics |
3.4.9 |
|||
[{NTE}] |
Notes and Comments (for PID) |
2.16.10 |
|||
[{AL1} |
Allergy Information |
3.4.6 |
|||
] |
End PID Group [PIDG] |
||||
{ |
ORCG |
Begin ORC Group [ORCG...***fill in all these ...] |
|||
ORC |
Common Order |
Each ORC/RXD combination constitutes a "hit." |
4.5.3 |
||
[ |
RXOG |
Begin RXO Group |
|||
RXO |
Pharmacy/Treatment Order |
4.14.1 |
|||
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[{RXC}] |
Pharmacy/Treatment Component |
[PTC1].... |
4.14.3 |
||
] |
End RXO Group |
||||
[ |
RXEG |
Begin RXE Group |
|||
RXE |
Pharmacy/Treatment Encoded Order |
4.14.4 |
|||
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[{RXC}] |
Pharmacy/Treatment Component |
[PTC2]... |
4.14.3 |
||
] |
End RXE Group |
||||
[ |
RXDG |
Begin RXD Group |
|||
RXD |
Pharmacy/Treatment Dispense |
4.14.5 |
|||
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[{RXC}] |
Pharmacy/Treatment Component |
4.14.3 |
|||
] |
End RXD Group |
||||
[ |
Begin RXG Group |
||||
RXG |
Pharmacy/Treatment Give |
RXGG |
4.14.6 |
||
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[{RXC}] |
Pharmacy/Treatment Component |
4.14.3 |
|||
] |
End RXG Group |
||||
[ |
RXAG |
Begin RXA Group |
|||
RXA |
Pharmacy/Treatment Administration |
4.14.7 |
|||
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[{RXC}] |
Pharmacy/Treatment Component |
Was this intentionally omitted? |
4.14.3 |
||
] |
End RXA Group |
||||
{ |
OBXG |
Begin OBX Group |
|||
[OBX] |
Results |
7.4.2 |
|||
[{NTE}] |
Notes and Comments (for OBX) |
2.16.10 |
|||
} |
End OBX Group |
||||
} |
End ORC Group |
||||
} |
End Results Group |
||||
[DSC] |
Continuation Pointer |
2.16.4 |
QPD
Input Parameter Specification
Field Seq (Query ID=Z85) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
4 |
OrderControlCode |
S |
2 |
ID |
Y |
0119 |
ORC.1 |
ORC-1: Order Control |
||||
5 |
OrderingProvider |
S |
120 |
XCN |
ORC.12 |
ORC-12: Ordering Provider |
||||||
6 |
MedicationDispensed |
S |
Y |
100 |
CE |
O |
= |
RXD.2 |
RXD-2: Dispense/Give Code |
|||
7 |
DispenseDate.LL |
S |
Y |
26 |
TS |
O |
> |
RXD.3 |
RXD-3: Date/Time Dispensed |
|||
8 |
DispenseDate.UL |
S |
Y |
26 |
TS |
O |
< |
RXD.3 |
RXD-3: Date/Time Dispensed |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z85) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z85^Pharmacy Information Comprehensive^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) This PATIENT_MASTER entry will be
searched against on the PHARMACY_DISPENSE_TRANSACTION table to retrieve the
rows fulfilling the query conditions. |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
OrderControlCode |
ID |
If this field, ORC.1, is not valued, all values for this field are considered to be a match. |
|
OrderingProvider |
XCN |
If this field, ORC.12, is not valued, all values for this field are considered to be a match. |
|
MedicationDispensed |
CE |
If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.LL |
TS |
This is the earliest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.UL |
TS |
This is the latest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z85) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
7 |
Segment group inclusion |
256 |
ID |
What segment group(s) are to be included. If this field is not valued, all segment groups will be included. |
The
following example demonstrates that the same results, as shown in the example
in <IP_ADDRESS>, can be obtained using the QSC variant. The difference is how the
input parameters are expressed.
The user wishes to know all the medications dispensed for the patient whose
medical record number is "555444222111" for the period beginning 5/31/98 and
ending 5/31/99. The following message is generated.
MSH|^&~\|PCR|Gen
Hosp|PIMS||199811201300-0800||QBP^Z87^QBP_Q11|8698|P|2.4||||||||
QPD|Z87^Dispense
Information^HL7nnnn|Q001|<EMAIL_ADDRESS>AND~<EMAIL_ADDRESS>RCP|I|999^RD|
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 4 prescription dispenses for the period
beginning 5/31/98 and ending 5/31/99 and returns the following RSP message:
MSH|^&~\|PIMS|Gen
Hosp|PCR||199811201300-0800||RSP^Z88^RSP_Z88|8857|P|2.4||||||||
MSA|AA|8698|
QAK|Q001|OK|Z87^Dispense Information^HL7nnnn|4
QPD|Z87^Dispense
<EMAIL_ADDRESS>AND~<EMAIL_ADDRESS>PID|||555444222111^^^MPI^MR||Everyman^Adam||19600614|M||C|2101 Webster #
106^^Oakland^CA^94612||^^^^^510^6271111|^^^^^510^6277654|||||343132266|||N|||||||||
ORC|RE||89968665||||||199905121345-0700|||77^Hippocrates^Harold^H^III^DR^MD||^^^^^510^
2673600||||||
RXE|1^BID^^19990529|00378112001^Verapamil Hydrochloride 120 mg TAB^NDC
|120||mgm||||||||||||||||||||||||||
RXD|1|00378112001^Verapamil Hydrochloride 120 mg
TAB^NDC|199905291115-0700|100|||1331665|3|||||||||||||||||
RXR|PO||||
ORC|RE||89968665||||||199905291030-0700|||77^Hippocrates^Harold^H^III^DR^MD||^^^^^510^
2673600||||||
RXE|1^^D100^^20020731^^^TAKE 1 TABLET DAILY --GENERIC FOR CALAN
SR|00182196901^VERAPAMIL HCL ER TAB 180MG ER^NDC|100||180MG|TABLET
SA|||G|||0|BC3126631^CHU^Y^L||213220929|0|0|19990821|||
RXD|1|00182196901^VERAPAMIL HCL ER TAB 180MG
ER^NDC|19990821|100|||213220929|0|TAKE 1 TABLET DAILY --GENERIC FOR CALAN
SR||||||||||||
RXR|PO||||
ORC|RE||235134037||||||199809221330-0700|||88^Semmelweis^Samuel^^^DR^MD||^^^^^510^
2673900||||||
RXD|1|00172409660^BACLOFEN 10MG TABS^NDC|199809221415-0700|10|||235134037|5|AS
DIRECTED||||||||||||
RXR|PO||||
ORC|RE||235134030||||||199810121030-0700|||99^Lister^Lenora^^^DR^MD||^^^^^510^
2673700||||||
RXD|1|00054384163^THEOPHYLLINE 80MG/15ML
SOLN^NDC|199810121145-0700|10|||235134030|5|AS DIRECTED||||||||||||
RXR|PO
Note
that the following Conformance Statement contains many more input parameters.
The user is allowed to populate as many of these as desired.
Query Statement ID (Query ID=Z87): |
Z87 |
Type: |
Query |
Query Name: |
Dispense Information |
Query Trigger (= MSH-9): |
QBP^Z87^QBP_Q11 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RSP^Z88^RSP_Z88 |
Query Characteristics: |
Selection criteria are chosen from a Virtual Table. May specify patient, medication, and a date range. |
Purpose: |
To retrieve patient pharmacy dispense history information from the Server. |
Response Characteristics: |
Sorted by Medication Dispensed unless otherwise specified in SortControl. |
Based on Segment Pattern: |
RDS_O01 |
QBP^Z87^QBP_Q11 |
Query Grammar: QBS Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
5.5.3 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RSP^Z88^RSP_Z88 |
Response Grammar: Pharmacy Information Comprehensive |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
5.5.3 |
|||
RCP |
Response Control Parameter |
5.5.5 |
|||
{ |
Query Result Cluster |
||||
[ |
PIDG |
Begin PID Group |
|||
PID |
Patient Identification |
3.4.2 |
|||
[PD1] |
Additional Demographics |
3.4.10 |
|||
[{NTE}] |
Notes and Comments (for PID) |
2.16.10 |
|||
[{AL1} |
Allergy Information |
3.4.5 |
|||
[PV1 |
Patient Visit |
3.4.3 |
|||
[PV2]] |
Patient Visit - Additional Info |
3.4.4 |
|||
] |
End PID Group |
||||
{ |
ORCG |
Begin ORC Group |
|||
ORC |
Common Order |
Each ORC/RXD combination constitutes a "hit." |
4.5.1 |
||
[ |
Begin RXO Group |
||||
RXO |
Pharmacy/Treatment Order |
4.8.2 |
|||
[{NTE}] |
Notes and Comments (for RXO) |
We changed the syntax because we believe there is an error. The RXR should not be optional. |
2.16.10 |
||
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[ |
RXCG |
Begin RXC Group |
|||
{RXC} |
Pharmacy/Treatment Component |
4.14.3 |
|||
[{NTE}] |
Notes and Comments (for RXC) |
2.16.10 |
|||
] |
End RXC Group |
||||
] |
End RXO Group |
||||
[ |
RXEG |
Begin RXE Group |
|||
RXE |
Pharmacy/Treatment Encoded Order |
4.8.7 |
|||
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[{RXC}] |
Pharmacy/Treatment Component |
4.14.3 |
|||
] |
End RXE Group |
||||
RXD |
Pharmacy/Treatment Dispense |
RXDG |
Begin RXD Group |
4.8.10 |
|
{RXR} |
Pharmacy/Treatment Route |
4.14.2 |
|||
[{RXC}] |
Pharmacy/Treatment Component |
End RXD Group |
4.14.3 |
||
{ |
OBXG |
Begin OBX Group |
|||
[OBX] |
Results |
7.4.2 |
|||
[{NTE}] |
Notes and Comments (for OBX) |
2.16.10 |
|||
} |
End OBX Group |
||||
} |
End ORC Group |
||||
} |
End Query Results |
||||
DSC |
Continuation Pointer |
2.16.4 |
QPD
Input Parameter Specification
Field Seq (Query ID=Z87) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
SelectionCriteria |
255 |
ST |
R |
Y |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z87) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z87^Dispense Information^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
SelectionCriteria |
ST |
A query expression whose operands are derived from the "ColName" column in the "Input Specification: Virtual Table" given below. |
Input
Specification: Virtual Table
ColName (Query ID=Z87) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
PatientName |
48 |
XPN |
PID.5 |
PID-5 Patient Name |
|||||||
OrderControlCode |
S |
2 |
ID |
0119 |
ORC.1 |
ORC-1 Order Control |
|||||
MedicationDispensed |
S |
Y |
100 |
CE |
RXD.2 |
RXD-2 Dispense/Give Code |
|||||
DispenseDate |
S |
26 |
TS |
RXD.3 |
RXD-2 Date/Time Dispensed |
||||||
QuantityDispensed |
L |
20 |
NM |
RXD.4 |
RXD-4 Actual Dispense Amount |
||||||
OrderingProvider |
S |
120 |
XCN |
ORC.12 |
ORC-12 Ordering Provider |
Virtual
Table Field Description and Commentary
ColName (Query ID=Z87) |
Comp. Name |
DT |
Description |
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) This PATIENT_MASTER entry will be
searched against on the PHARMACY_DISPENSE_TRANSACTION table to retrieve the
rows fulfilling the query conditions. |
|
If
this field is not valued, all values for this field are considered to be a
match. |
|||
If one PID.3 is specified, only 1 segment pattern will be returned |
|||
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
OrderControlCode |
ID |
If this field, ORC.1, is not valued, all values for this field are considered to be a match. |
|
MedicationDispensed |
CE |
If this field, RXD.2, is not valued, all values for this field are considered to be a match. |
|
DispenseDate |
TS |
If this field, RXD.3, is not valued, all values for this field are considered to be a match. |
|
QuantityDispensed |
NM |
If this field, RXD.4, is not valued, all values for this field are considered to be a match. |
|
OrderingProvider |
XCN |
If this field, ORC.12, is not valued, all values for this field are considered to be a match. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z87) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
7 |
Segment group inclusion |
256 |
ID |
What segment group(s) are to be included. If this field is not valued, all segment groups will be included. |
The
following example shows how the same QSC style query can be invoked in a very
different way producing very different results.
The user wishes to know all the medications ever dispensed for the patient
whose medical record number is "555444222111" prescribed by Dr Lister (provider
number 99). The following message is generated. Note that the same Query has
been used, but different input specifications were used.
MSH|^&~\|PCR|Gen
Hosp|PIMS||199811201300-0800||QBP^Z87^QBP_Q11|8698|P|2.4||||||||
QPD|Q33^Dispense Information^HL7nnnn|Q005|
@PID.3^EQ^55544422211^AND~<EMAIL_ADDRESS>RCP|I|999^RD|
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 2 prescription dispenses as prescribed
by Dr. Lister. The response is clearly different than the response to the first
query.
MSH|^&~\|PIMS|Gen
Hosp|PCR||199811201300-0800||RSP^Z88^RSP_Z88|8857|P|2.4||||||||
MSA|AA|8698|
QAK|Q005|OK|Q33^Dispense Information^HL7nnnn|2|
QPD|Q33^Dispense Information^HL7nnnn|Q005|
@PID.3^EQ^55544422211^AND~<EMAIL_ADDRESS>PID|||555444222111^^^MPI^MR||Everyman^Adam||19600614|M||C|2101 Webster #
106^^Oakland^CA^94612||^^^^^510^6271111|^^^^^510^6277654|||||343132266|||N|||||||||
ORC|RE||89968665||||||199603121345-0700|||99^Lister^Lenora^^^DR^MD ||^^^^^510^
2673600||||||
RXE|1^BID^^19980529|00182196901^VERAPAMIL HCL ER TAB 180MG ER^NDC
|120||mgm||||||||||||||||||||||||||
RXD|1|00182196901^VERAPAMIL HCL ER TAB 180MG
ER^NDC|199603122000-0700|100|||1331665|3|||||||||||||||||
RXR|PO||||
ORC|RE||235134030||||||199810121030-0700|||99^Lister^Lenora^^^DR^MD||^^^^^510^
2673700||||||
RXD|1|00054384163^THEOPHYLLINE 80MG/15ML
SOLN^NDC|199810121145-0700|10|||235134030|5|AS DIRECTED||||||||||||
RXR|PO
The
user wishes to know all the lab results for the patient whose medical record is
80302641876 and where the result report date/time is between March 21, 1999 and
June 24, 1999 and the Lab department is chemistry. This Query Name might be
invoked once with a query tag of 123 in the following manner:
MSH|^&~\| PCR|Gen
Hosp|LIS.RMS||199907131030-0800||QBP^Z89^QBP_Q11|4460|D|2.4|
QPD|Z89^Lab Results<EMAIL_ADDRESS>@OBR.22^GE^19990321^AND~<EMAIL_ADDRESS>RCP|I||R|
The
"Lab Results History" query returns laboratory results information in the form
of the Segment Pattern Response corresponding to the ORU^R01 - unsolicited
transmission of an observation message. It returns all of the results which
meet the criteria defined in the QPD - Query Parameter Definition Segment of
the RSP^R11 - Segment Pattern Response message.
Query Statement ID (Query ID=Z89): |
Z89 |
Type: |
Query |
Query Name: |
Lab Results History |
Query Trigger (= MSH-9): |
QBP^Z89^QBP_Q11 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RSP^Z90^RSP_Z90 |
Query Characteristics: |
May specify patient, report time, laboratory department, and LOINC code of result to be returned. |
Purpose: |
To retrieve patient laboratory results information from the Server. |
Response Characteristics: |
|
Based on Segment Pattern: |
ORU_O01 |
QBP^Z89^QBP_Q11 |
Query Grammar: QBS Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
5.5.3 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RSP^Z90^RSP_Z90 |
Response Grammar: Pharmacy Information Comprehensive |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
5.5.3 |
|||
RCP |
Response Control Parameter |
5.5.5 |
|||
{ |
Query Result Cluster |
||||
[ |
PIDG |
Begin PID Group |
|||
PID |
Patient Identification |
3.4.2 |
|||
[PD1] |
Additional Demographics |
3.4.10 |
|||
[{NK1}] |
Next of Kin/Associated Parties |
3.4.5 |
|||
[{NTE}] |
Notes and Comments (for PID) |
2.16.10 |
|||
[PV1 |
Patient Visit |
3.4.3 |
|||
[PV2]] |
Patient Visit - Additional Info |
3.4.4 |
|||
] |
End PID Group |
||||
{ |
ORCG |
Begin ORC Group |
|||
ORC |
Common Order |
Each ORC/OBR combination constitutes a "hit." |
4.5.1 |
||
OBR |
Observations Report ID |
4.5.3 |
|||
[{NTE}] |
Notes and Comments (for ORC/OBR) |
2.16.10 |
|||
[CTD] |
Contact Data |
11.6.4 |
|||
{ |
OBXG |
Begin OBX Group |
|||
[OBX] |
Observation/Result |
7.4.2 |
|||
[{NTE}] |
Notes and Comments (for OBX) |
2.16.10 |
|||
} |
End OBX Group |
||||
} |
End ORC Group |
||||
} |
End Query Results |
||||
DSC |
Continuation Pointer |
2.16.4 |
QPD
Input Parameter Specification
Field Seq (Query ID=Z89) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
SelectionCriteria |
255 |
ST |
R |
Y |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z89) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z89^Lab Results History^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
SelectionCriteria |
ST |
A query expression whose operands are derived from the "ColName" column in the "Input Specification: Virtual Table" given below. |
Input
Specification: Virtual Table
ColName (Query ID=Z89) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
ResultReportTime.LL |
26 |
TS |
O |
OBR.22 |
OBR-22: Results rpt/status chng - date/time - lower limit |
||||||
ResultReportTime.UL |
26 |
TS |
O |
OBR.22 |
OBR-22: Results rpt/status chng - date/time - upper limit |
||||||
LabDept |
80 |
CE |
O |
Y |
0074 |
OBR.24 |
OBR-24: Diagnostic Serv Sect ID |
||||
LOINCCode |
80 |
CE |
O |
Y |
OBX.3.4 |
OBX-3-4: Observation identifier - alternate identifier |
Input
Parameter Field Description and Commentary
Input Parameter (Query ID=Z89) |
Comp. Name |
DT |
Description |
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
Result Report Time.LL |
TS |
The earliest date and time for which results are to be returned. If this field is not valued, the earliest results that conform to the other query parameters will be returned. |
|
Result Report Time.UL |
TS |
The latest date and time for which results are to be returned. If this field is not valued, the latest results that conform to the other query parameters will be returned. |
|
LabDept |
CE |
The section(s) or department(s) of the laboratory reporting the results. As many LabDept values may be specified as desired. If this field is not valued, results that conform to the other query parameters from all sections or departments will be returned. |
|
LOINCCode |
CE |
The LOINC identifier for the results to be reported. As many LOINCCode values may be specified as desired. If this field is not valued, results that conform to the other query parameters for all LOINC codes will be returned. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z89) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
7 |
Segment group inclusion |
256 |
ID |
What segment group(s) are to be included. If this field is not valued, all segment groups will be included. |
If a LOINC code is used as one of the operands of the input specification expression, all of the other OBX segments which are part of the same OBR as the selected OBX will be returned along with the selected OBX. In other words, if an OBX segment that is part of a panel is selected by the query, the entire panel will be returned.
The
same Query Name might be invoked with a different query tag (456) as
follows:
The user wishes to know all the lab results reported having a LOINC code of
6777-7 between March 21, 1999 and March 23, 1999.
MSH|^&~\|PCR|GenHosp|LIS||199907131040-0800||QBP^Z89^QBP_Z89|4495|D|2.4|
QPD
|Z89^LabResultsHistory^HL7nnnn||@OBX.3.4^EQ^6777-7^AND~<EMAIL_ADDRESS>RCP|I||R|
The second instance of the "Lab Results for Specified Criteria" query would
clearly return quite different results than the first even though both are
invocations of the same query.
The
user wishes to know the identity of the patient whose medical record number is
"555444222111".
MSH|^&~\|PCR|GenHosp|MPI||199811201400-0800||QBP^Z91^QBP_Q13|8699|P|2.4||||||||
QPD|Z91^WhoAmI^HL7nnnn|Q0009|555444222111^^^MPI^MR
RCP|I|999^RD|
RDF|PatientList^CX^20~PatientName^XPN^48~Mother'sMaidenName^XPN^48~DOB^TS^26~Sex^IS^1~Race^CE^80|
The MPI system returns the following RTB message:
MSH|^&~\|MPI|GenHosp|PCR||199811201400-0800||RTB^Z92^RTB_K13|8699|P|2.4||||||||
MSA|AA|8699|
QAK|Q0009|OK|Z91^WhoAmI^HL7nnnn|1^1|
QPD|Z91^WhoAmI^HL7nnnn|Q0009|555444222111^^MPI^MR
RDF|PatientList^CX^20~PatientName^XPN^48~Mother'sMaidenName^XPN^48~DOB^TS^26~Sex^IS^1~Race^CE^80|
RDT|555444222111^^^MPI^MR|Everyman^Adam||19600614|M||
Query Statement ID (Query ID=Z89): |
Z91 |
Type: |
Query |
Query Name: |
Who Am I |
Query Trigger (= MSH-9): |
QBP^Z91^QBP_Q13 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RTB^Z92^RTB_K13 |
Query Characteristics: |
|
Purpose: |
Find the identity of the patient for specified medical record number(s) |
Response Characteristics: |
|
Based on Segment Pattern: |
QBP^Z91^QBP_Q13 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
0 |
[ RDF ] |
Table Row Definition Segment |
5.5.6 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RTB^Z94^RTB_K13 |
Response
Grammar: |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
5.5.3 |
|||
[ RDF |
Table Row Definition Segment |
5.5.6 |
|||
[{ RDT }]] |
Table Row Data Segment |
5.5.7 |
|||
[ DSC ] |
Continuation Pointer |
2.16.4 |
QPD Input Parameter Specification
Field Seq (Query ID=Z91) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z91) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z91^Who Am I^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z91) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
6 |
Sort-by Field |
256 |
SRT |
||
Sort-by Field |
ST |
Segment field name of an output column by which the response may be sorted. Must contain a Y in the Sort column of the output specification table. |
|||
Sequencing |
ID |
As specified in HL7 Table 0397- Sequencing. Default is Ascending. |
Output
Specification and Commentary: Virtual Table
ColName (Query ID=Z91) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
PatientName |
48 |
XPN |
PID.5 |
PID-5 Patient Name |
|||||||
Mother'sMaidenName |
48 |
XPN |
PID.6 |
PID-6 Mother's Maiden Name |
|||||||
DOB |
26 |
TS |
PID.7 |
PID-7 Date/Time of Birth |
|||||||
Sex |
1 |
IS |
PID.8 |
PID-8 Sex |
|||||||
Race |
80 |
CE |
PID.10 |
PID-10 Race |
The
user wishes to know all the medications dispensed for the patient whose medical
record number is "555444222111" for the period beginning 5/31/98 and ending
5/31/99. The following QBP message is generated.
MSH|^&~\|PCR|Gen
Hosp|PIMS||199811201400-0800||QBP^Q42^QBP_Q13|8699|P|2.4||||||||
QPD|Q42^Tabular Dispense History^HL7nnn|Q0010|555444222111^^^MPI^MR|
|19980531|19990531|
RCP|I|999^RD|
RDF|3|PatientList^ST^20~PatientName^XPN^48~MedicationDispensed^ST^40~RXD.3^TS^26
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 4 prescription dispenses meeting the
criteria and returns the following RTB message:
MSH|^&~\|PIMS|Gen
Hosp|PCR||199811201400-0800||RTB^K42^RTB_K13|8858|P|2.4||||||||
MSA|AA|8699|
QAK|Q010|OK|Q42^Tabular Dispense History^HL7nnn|4
QPD|Q42^Tabular Dispense
History^HL7nnn|Q0010|555444222111^^^MPI^MR||19980531|19990531|
RDF|7|PatientId^CX^20~PatientName^XPN^48~OrderControlCode^ID^2~
MedicationDispensed^CE^100~DispenseDate^TS^26~QuantityDispensed^NM^20~
OrderingProvider^XCN^120
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|525440345^Verapamil Hydrochloride
120 mg TAB^NDC |199805291115-0700|100|77^Hippocrates^Harold^H^III^DR^MD
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|00182196901^VERAPAMIL HCL ER TAB
180MG ER^NDC |19980821-0700|100|77^Hippocrates^Harold^H^III^DR^MD
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|00172409660^BACLOFEN 10MG TABS^NDC
|199809221415-0700|10|88^Semmelweis^Samuel^^^DR^MD
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|00054384163^THEOPHYLLINE 80MG/15ML
SOLN^NDC|199810121145-0700|10|99^Lister^Lenora^^^DR^MD
Query Statement ID (Query ID=Z89): |
Z93 |
Type: |
Query |
Query Name: |
Tabular Dispense History |
Query Trigger (= MSH-9): |
QBP^Z93^QBP_Q13 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RTB^Z94^RTB_K13 |
Query Characteristics: |
Returns response sorted by Date Dispensed unless otherwise specified. |
Purpose: |
Find medications dispensed between specified date range for specified medical record numbers. |
Response Characteristics: |
|
Based on Segment Pattern: |
QBP^Z93^QBP_Q13 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
0 |
[ RDF ] |
Table Row Definition Segment |
5.5.6 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RTB^Z94^RTB_K13 |
Response
Grammar: |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
5.5.3 |
|||
[ RDF |
Table Row Definition Segment |
5.5.6 |
|||
[{ RDT }]] |
Table Row Data Segment |
5.5.7 |
|||
[ DSC ] |
Continuation Pointer |
2.16.4 |
QPD
Input Parameter Specification
Field Seq (Query ID=Z93) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
4 |
MedicationDispensed |
S |
Y |
100 |
CE |
O |
= |
RXD.2 |
RXD-2: Dispense/Give Code |
|||
5 |
DispenseDate.LL |
S |
Y |
26 |
TS |
O |
> |
RXD.3 |
RXD-3: Date/Time Dispensed |
|||
6 |
DispenseDate.UL |
S |
Y |
26 |
TS |
O |
< |
RXD.3 |
RXD-3: Date/Time Dispensed |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z93) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z93^Tabular Dispense History^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) This PATIENT_MASTER entry will be
searched against on the PHARMACY_DISPENSE_TRANSACTION table to retrieve the
rows fulfilling the query conditions. |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
MedicationDispensed |
CE |
If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.LL |
TS |
This is the earliest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.UL |
TS |
This is the latest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z93) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
6 |
Sort-by Field |
256 |
SRT |
||
Sort-by Field |
ST |
Segment field name of an output column by which the response may be sorted. Must contain a Y in the Sort column of the output specification table. |
|||
Sequencing |
ID |
As specified in HL7 Table 0397- Sequencing. Default is Ascending. |
Output
Specification and Commentary: Virtual Table
ColName (Query ID=Z93) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
PatientName |
48 |
XPN |
PID.5 |
PID-5 Patient Name |
|||||||
MedicationDispensed |
S |
Y |
100 |
CE |
O |
= |
RXD.2 |
RXD-2 Dispense/Give Code |
|||
DispenseDate.LL |
S |
Y |
26 |
TS |
O |
>= |
RXD.3 |
RXD-3 Date/Time Dispensed |
|||
DispenseDate.UL |
S |
Y |
26 |
TS |
O |
<= |
RXD.3 |
RXD-3 Date/Time Dispensed |
The
user wishes to know all the medications dispensed for the patient whose medical
record number is "555444222111" for the period beginning 5/31/98 and ending
5/31/99. The following message is generated.
MSH|^&~\|PCR|Gen
Hosp|PIMS||199811201400-0800||QBP^Z95^QBP_Q13|8699|P|2.4||||||||
QPD|Z95^Dispense Information^HL7nnnn|Q504
|PID.3^EQ^55544422211^AND~RXD.3^GE^19980531^AND~RXD.3^LE^19990531
RCP|Q001|I|999^RD|
RDF|3|PatientList^ST^20~PatientName^XPN^48~OrderControlCode^ID^2~OrderingProvider^XCN^120~MedicationDispensed^ST^40~DispenseDate^TS^26~QuantityDispensed^NM^20|
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 4 prescription dispenses meeting the
criteria and returns the following RTB message:
MSH|^&~\|PIMS|Gen
Hosp|PCR||199811201400-0800||RTB^Z96^RTB_K13|8858|P|2.4||||||||
MSA|AA|8699|
QAK|Q001|OK|Z95^Dispense Information^HL7nnnn|4
QPD|Z95^Dispense Information^HL7nnnn|Q504
|PID.3^EQ^55544422211^AND~RXD.3^GE^19980531^AND~RXD.3^LE^19990531
RDF|3|PatientList^ST^20~PatientName^XPN^48~OrderControlCode^ID^2~OrderingProvider^XCN^120~MedicationDispensed^ST^40~DispenseDate^TS^26~QuantityDispensed^NM^20|
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|77^Hippocrates^Harold^H^III^DR^MD
|525440345^Verapamil Hydrochloride 120 mg TAB^NDC |199805291115-0700|100
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|77^Hippocrates^Harold^H^III^DR^MD
|00182196901^VERAPAMIL HCL ER TAB 180MG ER^NDC |19980821-0700|100
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|88^Semmelweis^Samuel^^^DR^MD
|00172409660^BACLOFEN 10MG TABS^NDC |199809221415-0700|10
RDT|555444222111^^^MPI^MR|Everyman^Adam|RE|99^Lister^Lenora^^^DR^MD
|00054384163^THEOPHYLLINE 80MG/15ML SOLN^NDC|199810121145-0700|10
Note
that this Conformance Statement includes no separate Output Description and
Commentary. In the QBP/RTB combination using the QSC variant, the selection
criteria in QPD-3-user parameters and the desired return data in
RDF-2-column description are constructed from the same Virtual Table,
which appears in the Input Specification.
Query Statement ID (Query ID=Z95): |
Z95 |
Type: |
Query |
Query Name: |
Tabular Dispense History |
Query Trigger (= MSH-9): |
QBP^Z95^QBP_Q13 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RTB^Z96^RTB_Q13 |
Query Characteristics: |
Selection criteria are chosen from a Virtual Table. May specify patient, medication, and a date range. |
Purpose: |
To retrieve patient pharmacy dispense history information from the Server. |
Response Characteristics: |
Columns
from the Virtual Table listed in the Input/Output Specification are
specified for output in the RDF segment. |
Based on Segment Pattern: |
QBP^Z95^QBP_Q13 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
0 |
[ RDF ] |
Table Row Definition Segment |
5.5.6 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RTB^Z96^RTB_Q13 |
Response
Grammar: |
Group Control |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
5.5.3 |
|||
[ RDF |
Table Row Definition Segment |
5.5.6 |
|||
[{ RDT }]] |
Table Row Data Segment |
5.5.7 |
|||
[ DSC ] |
Continuation Pointer |
2.16.4 |
QPD Input Parameter Specification
Field Seq (Query ID=Z95) |
Field Description |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
SelectionCriteria |
255 |
ST |
R |
Y |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z95) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z95^Tabular Dispense History^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
SelectionCriteria |
ST |
A query expression whose operands are derived from the "ColName" column in the "Input/Output Specification: Virtual Table" given below. |
Input/Output
Specification: Virtual Table
ColName (Query ID=Z95) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
PatientName |
48 |
XPN |
PID.5 |
PID-5 Patient Name |
|||||||
OrderControlCode |
S |
2 |
ID |
0119 |
ORC.1 |
ORC-1 Order Control |
|||||
MedicationDispensed |
S |
Y |
100 |
CE |
RXD.2 |
RXD-2 Dispense/Give Code |
|||||
DispenseDate |
S |
26 |
TS |
RXD.3 |
RXD-2 Date/Time Dispensed |
||||||
QuantityDispensed |
L |
20 |
NM |
RXD.4 |
RXD-4 Actual Dispense Amount |
||||||
OrderingProvider |
S |
120 |
XCN |
ORC.12 |
ORC-12 Ordering Provider |
Virtual
Table Field Description and Commentary
ColName (Query ID=Z95) |
Comp. Name |
DT |
Description |
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) This PATIENT_MASTER entry will be
searched against on the PHARMACY_DISPENSE_TRANSACTION table to retrieve the
rows fulfilling the query conditions. |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
PatientName |
XPN |
If this field, PID.5, is not valued, all values for this field are considered to be a match. |
|
OrderControlCode |
ID |
If this field, ORC.1, is not valued, all values for this field are considered to be a match. |
|
MedicationDispensed |
CE |
If this field, RXD.2, is not valued, all values for this field are considered to be a match. |
|
DispenseDate |
TS |
If this field, RXD.3, is not valued, all values for this field are considered to be a match. |
|
QuantityDispensed |
NM |
If this field, RXD.4, is not valued, all values for this field are considered to be a match. |
|
OrderingProvider |
XCN |
If this field, ORC.12, is not valued, all values for this field are considered to be a match. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z95) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
6 |
Sort-by Field |
256 |
SRT |
||
Sort-by Field |
ST |
Segment field name of an output column by which the response may be sorted. Must contain a Y in the Sort column of the output specification table. |
|||
Sequencing |
ID |
As specified in HL7 Table 0397- Sequencing. Default is Ascending. |
The
user wishes to know all the medications dispensed for the patient whose medical
record number is "555444222111" for the period beginning 5/31/98 and ending
5/31/99. The following QBP message is generated.
MSH|^&~\|PCR|Gen
Hosp|PIMS||199909171400-0800||QBP^Z97^QBP_Q15|8699|P|2.4||||||||
QPD|Z97^DispenseHistoryDisplay^HL7nnnn|Q005|555444222111^^^MPI^MR||19980531|19990531|
RCP|I|999^RD|
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 4 prescription dispenses meeting the
criteria and returns the following RDY message:
MSH|^&~\|PIMS|Gen
Hosp|PCR||199909171401-0800||RDY^Z98^RDY_K15|8858|P|2.3||||||||
MSA|AA|8699|
QAK|Q005|OK|Z97^DispenseHistoryDisplay|4
QPD|Z97^DispenseHistoryDisplay^HL7nnnn|Q005|555444222111^^^MPI^MR||19980531|19990531|
DSP|| GENERAL HOSPITAL - PHARMACY DEPARTMENT DATE:09-17-99
DSP|| DISPENSE HISTORY REPORT PAGE 1
DSP||MRN Patient Name MEDICATION DISPENSED DISP-DATE
DSP||555444222111 Everyman,Adam VERAPAMIL HCL 120 mg TAB 05/29/1998
DSP||555444222111 Everyman,Adam VERAPAMIL HCL ER TAB 180MG 08/21/1998
DSP||555444222111 Everyman,Adam BACLOFEN 10MG TABS 09/22/1998
DSP||555444222111 Everyman,Adam THEOPHYLLINE 80MG/15ML SOL 10/12/1998
DSP|| << END OF REPORT >>
Note
that this Conformance Statement includes no separate Output Description and
Commentary. In conformance statements that specify an RDY response message,
the display format follows the response grammar.
Query Statement ID (Query ID=Z97): |
Z97 |
Type: |
Query |
Query Name: |
Dispense History |
Query Trigger (= MSH-9): |
QBP^Z97^QBP_Q15 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RDY^Z98^RDY_K15 |
Query Characteristics: |
May specify patient, medication, a date range, and how the response is to be sorted. |
Purpose: |
To retrieve patient pharmacy dispense history information from the Server. |
Response Characteristics: |
Returns data formatted for screen display. Data are sorted by Medication Dispensed unless otherwise specified in SortControl. |
Based on Segment Pattern: |
QBP^Z97^QBP_Q15 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
5.5.3 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RDY^Z98^RDY_K15 |
Response Grammar: Dispense History |
Group Control |
Comment |
Support Indicator |
Sec Ref |
|---|---|---|---|---|---|
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
0 |
|||
[{ DSP }] |
Display Data |
5.5.1 |
|||
[ DSC ] |
Continuation Pointer |
2.16.4 |
The data will display as follows: (Query ID=Z97) |
DSP|| GENERAL HOSPITAL - PHARMACY DEPARTMENT DATE:mm-dd-yy |
DSP|| DISPENSE HISTORY REPORT PAGE n |
DSP||MRN Patient Name MEDICATION DISPENSED DISP-DATE |
DSP||XXXXX XXXXXx, XXXXX XXXXXXXXXXXXXXXX mm/dd/ccyy |
... |
DSP|| << END OF REPORT >> |
QPD
Input Parameter Specification
Field Seq (Query ID=Z97) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
4 |
MedicationDispensed |
S |
Y |
100 |
CE |
O |
= |
RXD.2 |
RXD-2: Dispense/Give Code |
|||
5 |
DispenseDate.LL |
S |
Y |
26 |
TS |
O |
> |
RXD.3 |
RXD-3: Date/Time Dispensed |
|||
6 |
DispenseDate.UL |
S |
Y |
26 |
TS |
O |
< |
RXD.3 |
RXD-3: Date/Time Dispensed |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z97) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z97^Dispense History^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) This PATIENT_MASTER entry will be
searched against on the PHARMACY_DISPENSE_TRANSACTION table to retrieve the
rows fulfilling the query conditions. |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
MedicationDispensed |
CE |
If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.LL |
TS |
This is the earliest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
|
DispenseDate.UL |
TS |
This is the latest value to be returned for Date/Time Dispensed. If this field is not valued, all values for this field are considered to be a match. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z97) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
The
user wishes to know all the medications ever dispensed for the patient whose
medical record number is "555444222111" prescribed by Dr Lister (provider
number 99). The following message is generated. (Note the similarity between
the QPD segment here and that used in the query in Section 5.8.4.)
MSH|^&~\|PCR|Gen
Hosp|PIMS||199811201300-0800||QBP^Z79^QBP_Q15|8698|P|2.4||||||||
QPD|Z79^Dispense Information^HL7nnnn|Q503
|PID.3^EQ^55544422211^AND~ORC.1^EQ^RE^AND~ORC.12.1^EQ^99
RCP|I|999^RD|
The pharmacy system identifies medical record number "555444222111" as
belonging to Adam Everyman and locates 2 prescription dispenses as prescribed
by Dr. Lister. The response is clearly different than the response to the first
query.
MSH|^&~\|PIMS|Gen
Hosp|PCR||199811201300-0800||RDY^Z80^RDY_K15|8857|P|2.3||||||||
MSA|AA|8698|
QAK|Q003|OK|Z79^Dispense Information^HL7nnnn|2
QPD|Z79^Dispense Information^HL7nnnn|Q503
|@PID.3^EQ^55544422211^AND~ORC.1^EQ^RE^AND~<EMAIL_ADDRESS>DSP|| GENERAL HOSPITAL - PHARMACY DEPARTMENT DATE:09-17-99
DSP|| DISPENSE HISTORY REPORT PAGE 1
DSP||MRN Patient Name MEDICATION DISPENSED DISP-DATE
DSP||555444222111 Everyman,Adam VERAPAMIL HCL 120 mg TAB 05/29/1998
DSP||555444222111 Everyman,Adam THEOPHYLLINE 80MG/15ML SOL 10/12/1998
DSP|| << END OF REPORT >>
Note
that this Conformance Statement includes no separate Output Description and
Commentary. In conformance statements that specify an RDY response message,
the display format follows the response grammar.
Query Statement ID (Query ID=Z79): |
Z79 |
Type: |
Query |
Query Name: |
Dispense Information |
Query Trigger (= MSH-9): |
QBP^Z79^QBP_Q15 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RDY^Z80^RSP_K15 |
Query Characteristics: |
Selection criteria are chosen from a Virtual Table. May specify patient, order control code, medication, a date range, quantity dispensed, and ordering provider. |
Purpose: |
To retrieve patient pharmacy dispense history information from the Server. |
Response Characteristics: |
Returns data formatted for screen display. Data are sorted by Medication Dispensed unless otherwise specified in SortControl. |
Based on Segment Pattern: |
QBP^Z79^QBP_Q15 |
Query Grammar: QBS Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
5.5.3 |
RCP |
Response Control Parameter |
5.5.5 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RDY^Z80^RSP_K15 |
Response Grammar: Dispense History |
Group Control |
Comment |
Support Indicator |
Sec Ref |
|---|---|---|---|---|---|
MSH |
Message Header |
2.16.9 |
|||
MSA |
Message Acknowledgement |
2.16.8 |
|||
[ERR] |
Error |
2.16.5 |
|||
QAK |
Query Acknowledgement |
5.5.2 |
|||
QPD |
Query Parameter Definition |
0 |
|||
[{ DSP }] |
Display Data |
5.5.1 |
|||
[ DSC ] |
Continuation Pointer |
2.16.4 |
The data will display as follows: (Query ID=Z79) |
DSP|| GENERAL HOSPITAL - PHARMACY DEPARTMENT DATE:mm-dd-yy |
DSP|| DISPENSE HISTORY REPORT PAGE n |
DSP||MRN Patient Name MEDICATION DISPENSED DISP-DATE |
DSP||XXXXX XXXXXx, XXXXX XXXXXXXXXXXXXXXX mm/dd/ccyy |
... |
DSP|| << END OF REPORT >> |
QPD
Input Parameter Specification
Field Seq (Query ID=Z79) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
||||||||
2 |
QueryTag |
32 |
ST |
R |
||||||||
3 |
SelectionCriteria |
255 |
ST |
R |
Y |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z79) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z79^Dispense Information^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
SelectionCriteria |
ST |
A query expression whose operands are derived from the "ColName" column in the "Input/Output Specification: Virtual Table" given below. |
Input
Specification: Virtual Table
ColName (Query ID=Z79) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3: Patient Identifier List |
||||
OrderControlCode |
S |
2 |
ID |
0119 |
ORC.1 |
ORC-1 Order Control |
|||||
MedicationDispensed |
S |
Y |
100 |
CE |
RXD.2 |
RXD-2 Dispense/Give Code |
|||||
DispenseDate |
S |
26 |
TS |
RXD.3 |
RXD-2 Date/Time Dispensed |
||||||
QuantityDispensed |
L |
20 |
NM |
RXD.4 |
RXD-4 Actual Dispense Amount |
||||||
OrderingProvider |
S |
120 |
XCN |
ORC.12 |
ORC-12 Ordering Provider |
Virtual
Table Field Description and Commentary
ColName (Query ID=Z79) |
Comp. Name |
DT |
Description |
PatientList |
CX |
The
combination of values for PatientList.ID, and
PatientList.AssigningAuthority, are intended to identify a unique entry on
the PATIENT_MASTER table. The PatientList.IdentifierTypeCode is useful
for further filtering or to supply uniqueness in the event that the assigning
authority may have more than one coding system. (The PATIENT_MASTER table
contains a constraint that prevents multiple patients from being identified by
the same combination of field values.) This PATIENT_MASTER entry will be
searched against on the PHARMACY_DISPENSE_TRANSACTION table to retrieve the
rows fulfilling the query conditions. |
|
ID |
ID |
If this field, PID.3.1, is not valued, all values for this field are considered to be a match. |
|
Assigning Authority |
HD |
If this field, PID.3.4, is not valued, all values for this field are considered to be a match. |
|
Identifier type code |
IS |
If this field, PID.3.5, is not valued, all values for this field are considered to be a match. |
|
OrderControlCode |
ID |
If this field, ORC.1, is not valued, all values for this field are considered to be a match. |
|
MedicationDispensed |
CE |
If this field, RXD.2, is not valued, all values for this field are considered to be a match. |
|
DispenseDate |
TS |
If this field, RXD.3, is not valued, all values for this field are considered to be a match. |
|
QuantityDispensed |
NM |
If this field, RXD.4, is not valued, all values for this field are considered to be a match. |
|
OrderingProvider |
XCN |
If this field, ORC.12, is not valued, all values for this field are considered to be a match. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z79) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
6 |
Sort-by Field |
256 |
SRT |
||
Sort-by Field |
ST |
Segment field name of an output column by which the response may be sorted. Must contain a Y in the Sort column of the output specification table. |
|||
Sequencing |
ID |
As specified in HL7 Table 0397- Sequencing. Default is Ascending. |
This
section demonstrates how to use a different syntax for passing query parameters
to the query server. This syntactic variant is called "query by example"
because, instead of passing query parameter as fields of the QBP segment, they
are passed as fields of existing HL7 segments. Nevertheless, the query
conformance statement will clearly specify which fields of the HL7 segment can
carry useful values. Note that both the QBP syntax and the "query by example"
syntax have the same expressive power. Also note that when segments are used
in the "query by example" variant, the required/optional characteristics of
each field should be defined in the conformance statement, and that field
optionality in queries may be different from the usual optionality of the
segment when used in other HL7 messages.
This sample shows how the "query by example" might be used to find a list of
candidates matching a set of demographics. Because demographic data is
naturally carried by the existing PID segment, the message designer may, for
stylistic or practical reasons, decide to pass the demographic parameters such
as patient name or patient age in a PID segment.
The Client wishes to see a list of patients whose demographics are as
follows:
Last Name: Thomas
First Name: Gregory
Sex: Male
DOB: 12/11/48
The Client wishes to do this using the peekaboo algorithm with an 80%
confidence level.
MSH|^&~\|PCR|GenHosp|MPI||199811201400-0800||QBP^Z77^QBP_Q13|8699|P|2.4||||||||
QPD|Z77^find_candidates^HL7nnnn|Q0001|peekaboo|80|
PID|||||Thomas&Gregory||19481211|M
RCP|I|25^RD|
RDF|PatientList^CX^20~PatientName^XPN^48~Mother'sMaidenName^XPN^48~DOB^TS^26~Sex^IS^1~Race^CE^80|
The MPI system returns the following RTB message
MSH|^&~\|MPI|GenHosp|PCR||199811201400-0800||RTB^Z78^RTB_R13|8699|P|2.4||||||||
MSA|AA|8699|
QAK|
QPD|Z77^find_candidates^HL7nnnn|Q0001|peekaboo|80|
RDF|PatientList^CX^20~PatientName^XPN^48~Mother'sMaidenName^XPN^48~DOB^TS^26~Sex^IS^1~Race^CE^80|
RDT|555444222111^^^MPI&KP.NCA&L^MR|Thomas^Gregory||19481211|M||
Query Statement ID (Query ID=Z77): |
Z77 |
Type: |
Query |
Query Name: |
Tabular Patient List |
Query Trigger (= MSH-9): |
QBP^Z77^QBP_Q13 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RTB^Z78^RTB_K13 |
Query Characteristics: |
Query
By Example: passes algorithm data via QBP segment and patient match
information via PID segment. |
Purpose: |
To find patient records that closely (as specified by the Client) match a set of input criteria using a specified algorithm. |
Response Characteristics: |
Response returns requested columns from the Virtual Table. If no columns were requested, all columns are returned. |
Based on Segment Pattern: |
QBP^Z77^QBP_Q13 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
0 |
PID |
Patient Identification Segment |
3.4.2 |
RCP |
Response Control Parameter |
5.5.5 |
[ RDF ] |
Table Row Definition Segment |
5.5.6 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RTB^Z78^RTB_K13 |
Response
Grammar: |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
||
MSA |
Message Acknowledgement |
2.16.8 |
||
[ERR] |
Error |
2.16.5 |
||
QAK |
Query Acknowledgement |
5.5.2 |
||
QPD |
Query Parameter Definition |
5.5.3 |
||
[ RDF |
Table Row Definition Segment |
5.5.6 |
||
[{ RDT }]] |
Table Row Data Segment |
5.5.7 |
||
[ DSC ] |
Continuation Pointer |
2.16.4 |
QPD
Input Parameter Specification
Field Seq (Query ID=Z77) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
Message Query Name |
|||||||
2 |
QueryTag |
32 |
ST |
R |
Query Tag |
|||||||
3 |
Algorithm |
48 |
ST |
Algorithm |
||||||||
4 |
ConfidenceLevel |
8 |
NM |
Confidence Level |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z77) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z77^Tabular Patient List^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
Algorithm |
ST |
The name of the search algorithm that is used to look up the parameter values specified in the PID segment. |
|
ConfidenceLevel |
NM |
The degree of accuracy that the search algorithm must achieve in order to score a "hit." |
QBE
Input Parameter Specification
Segment Field Name (Query ID=Z77) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Service Identifier Code |
ElementName |
PID.5 |
PatientName |
S |
48 |
XPN |
PID-5-Patient Name |
||||||
PID.7 |
DOB |
S |
26 |
TS |
PID-7-Date/time of Birth |
||||||
PID.8 |
Sex |
S |
1 |
IS |
PID-8-Sex |
QBE
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z77) |
Comp. Name |
DT |
Description |
PatientName |
XPN |
Name of the patient. May be specified in full or in part. |
|
DOB |
TS |
Date and time of the patient's birth. Year, month, and day must be specified; time is optional. |
|
Sex |
IS |
Administrative gender of the patient. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z77) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
6 |
Sort-by Field |
256 |
SRT |
||
Sort-by Field |
ST |
Segment field name of an output column by which the response may be sorted. Must contain a Y in the Sort column of the output specification table. |
|||
Sequencing |
ID |
As specified in HL7 Table 0397- Sequencing. Default is Ascending. |
Output
Specification and Commentary: Virtual Table
ColName (Query ID=Z77) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3 Patient Identifier List |
||||
PatientName |
48 |
XPN |
PID.5 |
PID-5 Patient Name |
|||||||
MothersMaidenName |
48 |
XPN |
PID.6 |
PID-6 Mother's Maiden Name |
|||||||
DOB |
26 |
TS |
PID.7 |
PID-7 Date/Time of Birth |
|||||||
Sex |
1 |
IS |
PID.8 |
PID-8 Sex |
|||||||
Race |
80 |
CE |
PID.10 |
PID-10 Race |
The
same query as described above could be sent as a pure Query By Parameter query,
without the "query by example" variant, as follows.
Notice that the query uses only a single QPD segment to carry all the
parameters. The response to the query is the same as for the "query by
example" variant above.
Example: the Client wishes to do this using the peekaboo algorithm with an 80%
confidence level.
MSH|^&~\|PCR|GenHosp|MPI||199811201400-0800||QBP^Z75^QBP_Q13|8699|P|2.4||||||||
QPD|Z75^find_candidates^HL7nnnn|Q0001|peekaboo|80|Thomas^Gregory|19481211|M
RDF|PatientList^CX^20~PatientName^XPN^48~Mother'sMaidenName^XPN^48~DOB^TS^26~Sex^IS^1~Race^CE^80|
The MPI system returns the following RTB message
MSH|^&~\|MPI|GenHosp|PCR||199811201400-0800||RTB^Z76^RTB_R13|8699|P|2.4||||||||
MSA|AA|8699|
QAK|
QPD|Z75^find_candidates^HL7nnnn|Q0001|peekaboo|80|Thomas^Gregory|19481211|M
RDF|PatientList^CX^20~PatientName^XPN^48~Mother'sMaidenName^XPN^48~DOB^TS^26~Sex^IS^1~Race^CE^80|
RDT|555444222111^^^MPI&KP.NCA&L^MR|
Thomas^Gregory|19481211|M||
Query Statement ID (Query ID=Z75): |
Z75 |
Type: |
Query |
Query Name: |
Tabular Patient List |
Query Trigger (= MSH-9): |
QBP^Z75^QBP_Q13 |
Query Mode: |
Both |
Response Trigger (= MSH-9): |
RTB^Z76^RTB_K13 |
Query Characteristics: |
Patient identifier and matching algorithm requirements are passed via the input parameters. Output columns are chosen from a Virtual Table. |
Purpose: |
To find patient records that closely (as specified by the Client) match a set of input criteria using a specified algorithm. |
Response Characteristics: |
Response returns requested columns from the Virtual Table. If no columns were requested, all columns are returned. |
Based on Segment Pattern: |
QBP^Z75^QBP_Q13 |
Query Grammar: QBP Message |
Section Reference |
MSH |
Message Header Segment |
2.16.9 |
QPD |
Query Parameter Definition |
0 |
RCP |
Response Control Parameter |
5.5.5 |
[ RDF ] |
Table Row Definition Segment |
5.5.6 |
[ DSC ] |
Continuation Pointer |
2.16.4 |
RTB^Z76^RTB_K13 |
Response
Grammar: |
Comment |
Support Indicator |
Sec Ref |
MSH |
Message Header |
2.16.9 |
||
MSA |
Message Acknowledgement |
2.16.8 |
||
[ERR] |
Error |
2.16.5 |
||
QAK |
Query Acknowledgement |
5.5.2 |
||
QPD |
Query Parameter Definition |
5.5.3 |
||
[ RDF |
Table Row Definition Segment |
5.5.6 |
||
[{ RDT }]] |
Table Row Data Segment |
5.5.7 |
||
[ DSC ] |
Continuation Pointer |
2.16.4 |
QPD
Input Parameter Specification
Field Seq (Query ID=Z75) |
Name |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
1 |
MessageQueryName |
60 |
CE |
R |
Message Query Name |
|||||||
2 |
QueryTag |
32 |
ST |
R |
Query Tag |
|||||||
3 |
Algorithm |
48 |
ST |
Algorithm |
||||||||
4 |
ConfidenceLevel |
8 |
NM |
Confidence Level |
||||||||
5 |
PatientName |
S |
48 |
XPN |
PID.5 |
PID-5-Patient Name |
||||||
6 |
DOB |
S |
26 |
TS |
PID.7 |
PID-7-Date/Time of Birth |
||||||
7 |
Sex |
S |
1 |
IS |
PID.8 |
PID-8-Sex |
QPD
Input Parameter Field Description and Commentary
Input Parameter (Query ID=Z75) |
Comp. Name |
DT |
Description |
MessageQueryName |
CE |
Must be valued Z75^Tabular Patient List^HL7nnnn. |
|
QueryTag |
ST |
Unique to each query message instance. |
|
Algorithm |
ST |
The name of the search algorithm that is used to look up the parameter values specified in the PID segment. |
|
ConfidenceLevel |
NM |
The degree of accuracy that the search algorithm must achieve in order to score a "hit." |
|
PatientName |
XPN |
Name of the patient. May be specified in full or in part. |
|
DOB |
TS |
Date and time of the patient's birth. Year, month, and day must be specified; time is optional. |
|
Sex |
IS |
Administrative gender of the patient. |
RCP
Response Control Parameter Field Description and Commentary
Field Seq (Query ID=Z75) |
Name |
Component Name |
LEN |
DT |
Description |
1 |
Query Priority |
1 |
ID |
(D)eferred or (I)mmediate. Default is I. |
|
2 |
Quantity Limited Request |
10 |
CQ |
||
Quantity |
NM |
Number of units (specified by the following component) that will be returned in each increment of the response. If no value is given, the entire response will be returned in a single increment. |
|||
Units |
CE |
CHaracters, LInes, PaGes, or RecorDs. Default is LI. |
|||
3 |
Response Modality |
60 |
CE |
Real time or Batch. Default is R. |
|
6 |
Sort-by Field |
256 |
SRT |
||
Sort-by Field |
ST |
Segment field name of an output column by which the response may be sorted. Must contain a Y in the Sort column of the output specification table. |
|||
Sequencing |
ID |
As specified in HL7 Table 0397- Sequencing. Default is Ascending. |
Output
Specification and Commentary: Virtual Table
ColName (Query ID=Z75) |
Key/ |
Sort |
LEN |
TYPE |
Opt |
Rep |
Match Op |
TBL |
Segment Field Name |
Service Identifier Code |
ElementName |
PatientList |
S |
Y |
20 |
CX |
O |
PID.3 |
PID-3 Patient Identifier List |
||||
PatientName |
48 |
XPN |
PID.5 |
PID-5 Patient Name |
|||||||
MothersMaidenName |
48 |
XPN |
PID.6 |
PID-6 Mother's Maiden Name |
|||||||
DOB |
26 |
TS |
PID.7 |
PID-7 Date/Time of Birth |
|||||||
Sex |
1 |
IS |
PID.8 |
PID-8 Sex |
|||||||
Race |
80 |
CE |
PID.10 |
PID-10 Race |
If the reader is defining a new query, please refer to the new recommended query/response pairs defined in section 5.3. This section is retained for backward compatibility and the framework for the existing functional queries.
The UDM message does not have a direct replacement in the new methodology. It is not clear how extensively this message is used.
There
is a simple HL7 message that allows for unsolicited display update messages to
be sent in HL7 format from one system to another.
Trigger events for the unsolicited update are generally the completion of a
particular action (concerning a given patient). For example, a lab test might
be completed, generating a STAT unsolicited display message to be sent to the
appropriate location
UDM^Q05 |
Unsolicited Display Message |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
URD |
Results/Update Definition |
5 |
[ URS ] |
Results/Update Selection Criteria |
5 |
{ DSP } |
Display Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
ACK^Q05 |
General Acknowledgment |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ ERR ] |
Error |
2 |
Like
other types of HL7 messages, the UDM message can be continued by use of the DSC
segment and MSH-14-Continuation pointer. Thus if a UDM needs to be
continued as three separate UDM messages, the first message would contain:
MSH |
(no continuation pointer) |
|
URD |
||
[URS] |
||
{DSP} |
||
DSC |
The
second message would contain:
MSH |
(continuation pointer (to first message)) |
|
{DSP} |
||
DSC |
(with continuation pointer) |
The
last message would then contain:
MSH |
(cont8inuation pointer (to second message)) |
|
{DSP} |
Note: This scheme works equally well with non-display messages, such as
the Unsolicited Update ORU message (see Chapter 7).
Since these are unsolicited messages, intervening messages (from other systems)
may be sent to the receiving application while the sections of the particular
message are being continued. MSH-14-Continuation pointer enables the
receiving system to keep track of extraneous intervening messages.
If
the reader is defining a new query, please refer to the new recommended
query/response pairs defined in section <IP_ADDRESS>. This section is retained for
backward compatibility and the framework for the existing functional
queries.
Original mode implementation considerations
e) The particular allowable values for the filters in the QRD and QRF segments
are determined among cooperating applications during implementation.
f) The format chosen for the query segments is very general. This might be
read by prospective implementers to imply that the requirement for using the
Standard is the ability to respond to a wide variety of inquiries. This is not
the intent. The format here can be used with specific restrictions in any
interface.
QRY^Q01 |
Query Message |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
QRD |
Query Definition |
5 |
[ QRF ] |
Query Filter |
5 |
[ DSC ] |
Continuation Pointer |
2 |
DSR^Q01 |
Display Response Message |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ ERR ] |
Error |
2 |
[ QAK ] |
Query Acknowledgment |
5 |
QRD |
Query Definition |
5 |
[ QRF ] |
Query Filter |
5 |
{ DSP } |
Display Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
The QRF and QRD segments from the QRY are echoed back in the response. The DSC segment contains the continuation pointer, if it is not null (DSC-1-Continuation pointer).
If a display query has more than a single type of response (i.e., a DSR message with a different meaning, requiring different processing on the querying system), the second component of the Message Type field of the MSH segment may be used to indicate the response event type. For example, an ancillary name search display query may be defined using the query event code of DNM. The display response to such a query may be either a list of name matches (response event type is DNM) or the ancillary's display results for an exact match to the name query (response event type is NRS). See HL7 Table 0003 - Event type code and field notes for MSH-9-Message type.
For clarity, A is the system initiating the query and B is the system sending the responses. Multiple queries and responses are permitted within single messages. The responses to a given query may be broken into several separate DSR messages. A single DSR message may contain responses to more than one QRY.
For
clarity, A is the system initiating the query and B is the system sending the
responses. Multiple queries and responses are permitted within single
messages. The responses to a given query may be broken into several separate
DSR messages. A single DSR message may contain responses to more than one
QRY.
QRY^Q02 (A to B) |
Query Message |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
QRD |
Query Definition |
5 |
[ QRF ] |
Query Filter |
5 |
[ DSC ] |
Continuation Pointer |
2 |
QCK^Q02 (B to A) |
Query General Acknowledgment |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message acknowledgment |
2 |
[ ERR ] |
Error |
2 |
[ QAK ] |
Query Acknowledgment |
5 |
Later,
perhaps more than once.
DSR^Q03 |
Display Response Message |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
[MSA] |
Message Acknowledgment |
2 |
[ ERR ] |
Error |
2 |
[ QAK ] |
Query Acknowledgment |
5 |
QRD |
Query Definition |
5 |
[ QRF ] |
Query Filter |
5 |
{ DSP } |
Display Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
ACK^Q03 (A to B) |
General Acknowledgment |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ ERR ] |
Error |
2 |
Note: All record-oriented original mode and all enhanced mode queries follow the immediate and deferred acknowledgment modes defined in Section <IP_ADDRESS>.
Version
2.3 introduced 4 enhanced queries as follows:
* An Embedded Query Language query, which supports free-form select statements,
based on the query language of choice (e.g., SQL)
* a Virtual Table request query which supports queries against Server database
tables (virtual or actual) based on specific selection criteria
* a stored procedure request, which enables an application on one system to
execute a stored procedure on another system, which is coded to extract
specific data
* an event replay request message, which is used to request data formatted as
an event replay response
Code |
Query Name |
Defining Segment |
Explanation |
|---|---|---|---|
EQQ |
Embedded Query language Query |
EQL |
Custom
message existing in an inhouse situation or communication between known vendors
where the goal is to wrap a custom EQL Query in an HL7 Message. |
RQQ |
Event Replay Query |
ERQ |
The Event Replay Query, introduced in Version 2.3, provides a way for the querying system to request data in a format very similar to the format that would have been used had this data been sent as an update in response to a trigger event. |
SPQ |
Stored Procedure Request |
SPR |
The
Stored Procedure Query provides a mechanism for the querying system to invoke a
stored procedure on the responding system. The request includes a stored
procedure name and a list of parameters passed to it. |
VQQ |
Virtual Table Query |
VTQ |
Preferable
over multiple platforms or where standardization is desired. The VTQ provides a
way to query for data to be expressed as tables without having to specify SQL
or a stored procedure. The reader is advised to consider using the new
recommended query as described in section 5.3. |
And
3 enhanced responses as follows:
Code |
Response Name |
Defining Segment |
Explanation |
|---|---|---|---|
EDR |
Enhanced Display Response |
Generalized display response message formatted for direct output to a display device |
|
ERP |
Event Replay Response |
ERQ |
Formats the data on the basis of an application-specific segment-oriented (record-oriented) message |
TBR |
Tabular Data Response |
Formats the data in a relational format, as rows and columns. |
This
set of queries and set of responses can be mixed and matched according to the
following grid. Note that the pairs appearing on shaded lines are not valid.
Query |
Response |
Response type |
Defining factor |
Validity Status |
Sec Ref |
|---|---|---|---|---|---|
EQQ^Q04 |
TBR^R08 |
Tabular |
EQL-2 = T |
valid |
<IP_ADDRESS> |
EQQ^Q04 |
EDR^R07 |
Display |
EQL-2 = D |
valid |
<IP_ADDRESS> |
EQQ^Q04 |
ERP^R09 |
Segment Pattern |
EQL-2 = R |
not valid |
|
RQQ^Q09 |
ERP^R09 |
Segment Pattern |
ERQ-2 = specified trigger event |
valid |
<IP_ADDRESS> |
RQQ^Q09 |
TBR^R08 |
Not valid |
|||
RQQ^Q09 |
EDR^R07 |
Not valid |
|||
SPQ^Q08 |
TBR^R08 |
Tabular |
SPR-2 = T |
Valid |
<IP_ADDRESS> |
SPQ^Q08 |
EDR^R07 |
Display |
SPR -2 = D |
valid |
<IP_ADDRESS> |
SPQ^Q08 |
ERP^R09 |
Segment Pattern |
SPR -2 = R |
Valid |
<IP_ADDRESS> |
VQQ^Q07 |
TBR^R08 |
Tabular |
VTQ-2 = T |
valid |
<IP_ADDRESS> |
VQQ^Q07 |
EDR^R07 |
Display |
VTQ-2 = D |
valid |
<IP_ADDRESS> |
VQQ^Q07 |
ERP^R09 |
Segment Pattern |
VTQ-2 = R |
not valid |
The
enhanced query/response pairs are contingent on the Server having defined the
Conformance Statement.
Enhanced mode implementation considerations: definition of tables and
"Virtual Tables"
g) The particular allowable values for the EQL, VTQ, SPR, and RDF segments are
determined among cooperating applications during implementation.
h) The formats chosen for the query messages are very general. This might be
read by prospective implementers to imply that the requirement for using the
Standard is the ability to respond to a wide variety of inquiries. This is not
the intent. The format here can be used with specific restrictions in any
interface.
i) The contents of the tables expressed as TBR response messages are defined by
the functional chapters. Where an existing HL7 segment contains the fields
needed to form a row of a tabular response, the segment ID can be referenced.
For example, if a table of patients is needed, where each row represents a
patient and each column a field from the PID segment, then the PID can be
referenced as a table, also sometimes referred to as a "Virtual Table."
Where each row is comprised of fields from multiple HL7 segments, the
functional chapters may define additional tables. For example, a table may be
defined to respond to insurance queries where each row represents a patient,
and is comprised of columns derived from the PID segment and the insurance
segments (IN1-IN4).
This
query provides an envelope with which a query expressed in a language (e.g.,
SQL) is packaged and sent to the responding system. It is meant to provide the
maximum query function without reinventing the wheel.
The EQQ with its EQL query defining segment supports free-form select
statements, based on the query language of choice (e.g., SQL).
EQQ^Q04 |
Embedded Query Language Query |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
EQL |
EQL Definition |
5 |
[ DSC ] |
Continuation Pointer |
2 |
The
response to the EQQ could be tabular or display. The segment pattern response
(the ERP) is invalid given that there is no way to specify the desired segment
pattern in the query defining segment, EQL.
TBR^R08 |
Tabular Data Response |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ERR] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
RDF |
Table Row Definition |
5 |
{ RDT } |
Table Row Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
EDR^R07 |
Enhanced Display Response |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ ERR ] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
{ DSP } |
Display Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
The
Event Replay Query under version 2.3 provides a way for the querying system to
request data formatted very similar to the format that would have been used
were this data to be sent as an update in response to a trigger event.
The RQQ is used to request data formatted as an event replay response.
RQQ^Q09 |
Event Replay Query |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
ERQ |
Event Replay Query |
5 |
[ DSC ] |
Continuation Pointer |
2 |
ERP^R09 |
Event Replay Response |
Chapter |
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ERR] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
ERQ |
Event Replay Query |
5 |
. . . |
||
... |
||
... |
||
[ DSC ] |
Continuation Pointer |
2 |
Note:
The remainder of this message is defined by the contents of the corresponding
segment-oriented record-oriented unsolicited update message, excluding the MSH,
as defined by the function-specific chapters of this specification. The input
parameter list may be satisfied by more than one record-oriented unsolicited
update message: in this case, the segment group after the ERQ segment may
repeat.
When this message is continued, the continuation messages should include the
MSH, MSA, [ERR], QAK, ERQ, and [DSC] segments, as well as the segments
indicated by the ellipsis (...) in the response definition and the DSC should
be used only at the end of the group corresponding to the record-oriented
unsolicited update message.
Enhanced mode record-oriented response messages note: The RDF segment from the
EQQ, VQQ and SPQ messages, and the ERQ segment from the EQQ message, are echoed
back in their respective responses. The DSC segment contains the continuation
pointer, if it is not null (DSC-1-continuation pointer).
The
Stored Procedure Query provides a mechanism for the querying system to invoke a
stored procedure on the responding system. The request includes a stored
procedure name and a list of parameters passed to it.
The SPQ enables an application on one system to execute a stored procedure on
another system, which is coded to extract specific data.
SPQ^Q08 |
Stored Procedure Request |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
SPR |
Store Procedure Request |
5 |
[ RDF ] |
Table Row Definition |
5 |
[ DSC ] |
Continuation Pointer |
2 |
Since
the SPR segment includes a response format code, the response could be tabular,
display or segment pattern.
EDR^R07 |
Enhanced Display Response |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ ERR ] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
{ DSP } |
Display Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
ERP^R09 |
Event Replay Response |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ERR] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
ERQ |
Event Replay Query |
5 |
. . . |
||
... |
||
... |
||
[ DSC ] |
Continuation Pointer |
2 |
Note:
The remainder of this message is defined by the contents of the corresponding
segment-oriented record-oriented unsolicited update message, excluding the MSH,
as defined by the function-specific chapters of this specification. The input
parameter list may be satisfied by more than one record-oriented unsolicited
update message: in this case, the segment group after the ERQ segment may
repeat.
When this message is continued, the continuation messages should include the
MSH, MSA, [ERR], QAK, ERQ, and [DSC] segments, as well as the segments
indicated by the ellipsis (...) in the response definition and the DSC should
be used only at the end of the group corresponding to the record-oriented
unsolicited update message.
Enhanced mode record-oriented response messages note: The RDF segment from the
EQQ, VQQ and SPQ messages, and the ERQ segment from the EQQ message, are echoed
back in their respective responses. The DSC segment contains the continuation
pointer, if it is not null (DSC-1-Continuation pointer).
TBR^R08 |
Tabular Data Response |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ERR] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
RDF |
Table Row Definition |
5 |
{ RDT } |
Table Row Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
The
VTQ provides a way to query for data to be expressed as tables without having
to specify SQL or a stored procedure. The reader is advised to consider using
the new recommended queries described in section <IP_ADDRESS>.
The VQQ supports queries against server database table (virtual or actual)
based on specific selection criteria delineated in the VTQ segment.
VQQ^Q07 |
Virtual Table Query |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
VTQ |
VTQ Definition |
5 |
[ RDF ] |
Table Row Definition |
5 |
[ DSC ] |
Continuation Pointer |
2 |
EDR^R07 |
Enhanced Display Response |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ ERR ] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
{ DSP } |
Display Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
TBR^R08 |
Tabular Data Response |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Message Acknowledgment |
2 |
[ERR] |
Error |
2 |
QAK |
Query Acknowledgment |
5 |
RDF |
Table Row Definition |
5 |
{ RDT } |
Table Row Data |
5 |
[ DSC ] |
Continuation Pointer |
2 |
This section includes query/response message segments not carried forward to the recommended queries for v 2.4. The reader is referred to section 5.5 for those message segments that are used by both the recommended queries and the previous generation queries.
The
EQL segment is used to define queries using select statements based on the
query language of choice (e.g., SQL). Refer to the functional chapters for the
lists of HL7-defined EQL select statements.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
32 |
ST |
O |
00696 |
Query Tag |
||
2 |
1 |
ID |
R |
0106 |
00697 |
Query/Response Format Code |
|
3 |
250 |
CE |
R |
00709 |
EQL Query Name |
||
4 |
4096 |
ST |
R |
00710 |
EQL Query Statement |
Definition: This field may be valued by the initiating system to identify the query, and may be used to match response messages to the originating query. If it is valued, the responding system is required to echo it back as the first field in the query acknowledgment segment (QAK). This field differs from MSA-2-Message control ID in that its value remains constant for each message (i.e., all continuation messages) associated with the query, whereas MSA-2-Message control ID may vary with each continuation message, since it is associated with each individual message, not the query as a whole.
Definition: This field refers to HL7 Table 0106 - Query/response format code for valid values.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the name of the query. Where the default HL7
coding system is used, these names are assigned by the function-specific
chapters of this specification. The values for this field are equivalent to
those of SPR-3-Stored procedure name (see Section <IP_ADDRESS> "SPR - stored
procedure request definition segment").
Definition:
This field contains the EQL select statement that is the basis of the
query.
Fields are designated by the "@" symbol concatenated with the HL7 segment ID
followed by the sequence number for the field separated by a period (see
chapter 2 for definition of segment ID and sequence number). If the field is
divided into components, the designation may be suffixed with ".nn," to
identify a particular component (a suffix of ".3" indicates the third component
of the field); otherwise, the whole field is assumed. If the field is further
divided into subcomponents, the designation is suffixed with ".nn.mm," which
identifies the component and subcomponent requested by relative position.
Site-specific fields may be used, provided that they begin with the letter
"Z." Note that in this case the site-specified segment ID (if the field
is not being added to an existing HL7 segment) followed by the sequence number
must be defined so that they do not conflict with existing HL7 segment IDs and
field sequence numbers. Values for this field are defined in the
function-specific chapters of this specification.
Note: If the "@" is being used as one of the delimiter characters
defined in MSH-2-Encoding characters, it must be "escaped " (See Section )
The
ERQ segment is used to issue queries where the desired response is formatted as
an event replay response message. This enables the querying application to
request detailed event data from an application that supports this feature,
such that it may no longer be necessary for it to capture and store all event
information at the time of the original trigger event.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
32 |
ST |
O |
00696 |
Query Tag |
||
2 |
250 |
CE |
R |
00706 |
Event Identifier |
||
3 |
256 |
QIP |
O |
Y |
00705 |
Input Parameter List |
Definition: This field may be valued by the initiating system to identify the query, and may be used to match response messages to the originating query. If it is valued, the responding system is required to echo it back as the first field in the query acknowledgment segment (QAK). This field differs from MSA-2-Message control ID in that its value remains constant for each message (i.e., all continuation messages) associated with the query, whereas MSA-2-Message control ID may vary with each continuation message, since it is associated with each individual message, not the query as a whole.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the HL7 event identifier corresponding to the
original trigger event. Its contents dictate the format of the response
message. Hence, a value of "A04" in this field indicates a request for the
data associated with the "register a patient" trigger event. The ERP response
message returns the contents of the "register a patient" message defined in
Chapter 3. If more than one match is found, the ERP returns repeating groups
of the segments defined by the "A04" message.
Components:
<segment field name (ST)> ^ <value1 (ST) & value2 (ST) &
value3 (ST...>
Definition: This field contains the list of parameter names and values to be
passed to the responding system, in the form "<segment field name> ^
<value1 & value2 & value3 ...>." A single valued parameter
contains only a single subcomponent in the second component: thus no
subcomponent delimiters are needed (e.g., <segment field name> ^
<value>). A simple list of values (i.e., a one-dimensional
array) may be passed instead of a single value by separating each value with
the subcomponent delimiter: "<segment field name> ^
<value1&value2 &...>." Refer to Section <IP_ADDRESS>.4, "EQL-4
EQL query statement (ST) 00710," for segment field name definition
conventions.
For example, a value of<EMAIL_ADDRESS>could be combined with the A04
event identifier to request patient registration data for the patient with the
social security number 123-45-6789.
The
QRD segment is used to define a query.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM # |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
26 |
TS |
R |
00025 |
Query Date/Time |
||
2 |
1 |
ID |
R |
0106 |
00026 |
Query Format Code |
|
3 |
1 |
ID |
R |
0091 |
00027 |
Query Priority |
|
4 |
10 |
ST |
R |
00028 |
Query ID |
||
5 |
1 |
ID |
O |
0107 |
00029 |
Deferred Response Type |
|
6 |
26 |
TS |
O |
00030 |
Deferred Response Date/Time |
||
7 |
10 |
CQ |
R |
0126 |
00031 |
Quantity Limited Request |
|
8 |
250 |
XCN |
R |
Y |
00032 |
Who Subject Filter |
|
9 |
250 |
CE |
R |
Y |
0048 |
00033 |
What Subject Filter |
10 |
250 |
CE |
R |
Y |
00034 |
What Department Data Code |
|
11 |
20 |
CM |
O |
Y |
00035 |
What Data Code Value Qual. |
|
12 |
1 |
ID |
O |
0108 |
00036 |
Query Results Level |
Definition: This field contains the date the query was generated by the application program.
Definition:
This field refers to HL7 Table 0106 - Query/response format
code for valid values.
Value |
Description |
|---|---|
D |
Response is in display format |
R |
Response is in record-oriented format |
T |
Response is in tabular format |
Definition:
This field contains the time frame in which the response is expected. Refer
HL7 Table 0091 - Query priority for valid values. Table values
and subsequent fields specify time frames for response.
Value |
Description |
|---|---|
D |
Deferred |
I |
Immediate |
Definition: This field contains a unique identifier for the query. Assigned by the querying application. Returned intact by the responding application.
Definition:
This field refers to HL7 Table 0107 - Deferred response type
for valid entries.
Value |
Description |
|---|---|
B |
Before the Date/Time specified |
L |
Later than the Date/Time specified |
Definition: This field contains the date/time before or after which to send a deferred response. If not present, the response can be sent when it is available. (See QRD-5-Deferred response type above).
Components:
<quantity (NM)> ^ <units (CE)>
Definition: This field contains the maximum length of the response that can be
accepted by the requesting system. Valid responses are numerical values (in
the first component) given in the units specified in the second component.
Refer to HL7 Table 0126 - Quantity limited request
for valid entries for the second component. Default is LI (lines).
Value |
Description |
|---|---|
CH |
Characters |
LI |
Lines |
PG |
Pages |
RD |
Records |
ZO |
Locally defined |
Components:
<ID number (ST)> ^ <family name (FN)> ^ <given name (ST)> ^
<second and further given names or initials thereof (ST)> ^ <suffix
(e.g., JR or III) (ST)> ^ <prefix (e.g., DR) (ST)> ^ <degree (e.g.,
MD) (IS)> ^ <source table (IS)> ^ <assigning authority (HD)> ^
<name type code (ID)> ^ <identifier check digit (ST)> ^ <code
identifying the check digit scheme employed (ID)> ^ <identifier type code
(IS)> ^ <assigning facility (HD)> ^ <name representation code
(ID)> ^ <name context (CE)> ^ <name validity range (DR)> ^ <
name assembly order (ID)>Subcomponents of assigning authority:
<namespace ID (IS)> & <universal ID (ST)> & <universal
ID type (ID)>
Subcomponents of assigning facility: <namespace ID (IS)> &
<universal ID (ST)> & <universal ID type (ID)>
Definition: This field identifies the subject, or who the inquiry is about.
Note: This field should not have been a required field. However, for
backwards compatibility it remains a required field. There are some queries in
the standard that have not required this field.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field describes the kind of information that is required to
satisfy the request. Valid values define the type of transaction inquiry and
may be extended locally during implementation.
Value |
Description |
|---|---|
ADV |
Advice/diagnosis |
ANU |
Nursing unit lookup (returns patients in beds, excluding empty beds) |
APN |
Patient name lookup |
APP |
Physician lookup |
ARN |
Nursing unit lookup (returns patients in beds, including empty beds) |
APM |
Medical record number query, returns visits for a medical record number |
APA |
Account number query, return matching visit |
CAN |
Cancel. Used to cancel a query |
DEM |
Demographics |
FIN |
Financial |
GID |
Generate new identifier |
GOL |
Goals |
MRI |
Most recent inpatient |
MRO |
Most recent outpatient |
NCK |
Network clock |
NSC |
Network status change |
NST |
Network statistic |
ORD |
Order |
OTH |
Other |
PRB |
Problems |
PRO |
Procedure |
RES |
Result |
RAR |
Pharmacy administration information |
RER |
Pharmacy encoded order information |
RDR |
Pharmacy dispense information |
RGR |
Pharmacy give information |
ROR |
Pharmacy prescription information |
SAL |
All schedule related information, including open slots, booked slots, blocked slots |
SBK |
Booked slots on the identified schedule |
SBL |
Blocked slots on the identified schedule |
SOF |
First open slot on the identified schedule after the start date/tiem |
SOP |
Open slots on the identified schedule |
SSA |
Time slots available for a single appointment |
SSR |
Time slots available for a recurring appointment |
STA |
Status |
VXI |
Vaccine Information |
XID |
Get cross-referenced identifiers |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the possible contents including test number,
procedure number, drug code, item number, order number, etc. The contents of
this field are determined by the contents of the previous field. This field
could contain multiple occurrences separated by repetition delimiters.
Note: This field should not have been a required field. However, for
backwards compatibility it remains a required field. There are some queries in
the standard that have not required this field.
Components:
<first data code value (ST)> ^ <last data code value (ST)>
Definition: This field contains start and stop values separated by a component
separator. These values constitute a window or range to further refine the
inquiry.
Definition:
This field is used to control level of detail in results. Refer to HL7
Table 0108 - Query results level for valid values. See chapters
4 and 7.
Value |
Description |
|---|---|
O |
Order plus order status |
R |
Results without bulk text |
S |
Status only |
T |
Full results |
The
QRF segment is used with the QRD segment to further refine the content of an
original style query.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM # |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
20 |
ST |
R |
Y |
00037 |
Where Subject Filter |
|
2 |
26 |
TS |
B |
00038 |
When Data Start Date/Time |
||
3 |
26 |
TS |
B |
00039 |
When Data End Date/Time |
||
4 |
60 |
ST |
O |
Y |
00040 |
What User Qualifier |
|
5 |
60 |
ST |
O |
Y |
00041 |
Other QRY Subject Filter |
|
6 |
12 |
ID |
O |
Y |
0156 |
00042 |
Which Date/Time Qualifier |
7 |
12 |
ID |
O |
Y |
0157 |
00043 |
Which Date/Time Status Qualifier |
8 |
12 |
ID |
O |
Y |
0158 |
00044 |
Date/Time Selection Qualifier |
9 |
60 |
TQ |
O |
00694 |
When Quantity/Timing Qualifier |
||
10 |
10 |
NM |
O |
01442 |
Search Confidence Threshold |
Definition: This field identifies the department, system, or subsystem to which the query pertains. This field may repeat as in LAB~HEMO, etc.
Definition: This field has been retained for backward compatibility only. It is recommended to use QRF-9 - When quantity/timing qualifier. When used for backward compatibility, this field contains the dates and times equal to or after which this value should be included.
Definition: This field has been retained for backward compatibility only. It is recommended to use QRF-9 - When quantity/timing qualifier. When used for backward compatibility, this field contains the dates and times equal to or before which this date should be included. This field contains the dates and times equal to or before which this date should be included.
Definition: This field contains an identifier to further define characteristics of the data of interest.
Definition: This field contains a filter defined locally for use between two systems. This filter uses codes and field definitions that have specific meaning only to the applications and/or site involved.
Definition:
This field specifies the type of date referred to in QRF-2-When data start
date/time and QRF-3-When data end date/time.
Value |
Description |
|---|---|
ANY |
Any date/time within a range |
COL |
Collection date/time, equivalent to film or sample collection date/time |
ORD |
Order date/time |
RCT |
Specimen receipt date/time, receipt of specimen in filling ancillary (Lab) |
REP |
Report date/time, report date/time at filing ancillary (i.e., Lab) |
SCHED |
Schedule date/time |
Definition:
This field specifies the status type of objects selected in date range defined
by QRF-2-When data start date/time and QRF-3-When data end
date/time.
Value |
Description |
|---|---|
ANY |
Any status |
CFN |
Current final value, whether final or corrected |
COR |
Corrected only (no final with corrections) |
FIN |
Final only (no corrections) |
PRE |
Preliminary |
REP |
Report completion date/time |
Definition:
This field allows the specification of certain types of values within the
date/time range.
Value |
Description |
|---|---|
1ST |
First value within range |
ALL |
All values within the range |
LST |
Last value within the range |
REV |
All values within the range returned in reverse chronological order (This is the default if not otherwise specified.) |
Components:
<quantity (CQ)> ^ <interval (CM)> ^ <duration (CM)> ^
<start date/time (TS)> ^ <end date/time (TS)> ^ <priority
(ST)> ^ <condition (ID)> ^ <text (TX)> ^ <conjunction
(ID)> ^ <order sequencing (CM)> ^ <occurrence duration (CE)> ^
<total occurrences (NM)>
Definition: This field allows an interval definition to be used for specifying
multiple responses to a query. With the addition of this filter, new query
specifications should no longer use QRF-2-When data start date/time and
QRF-3-When data end date/time in future implementations.
Definition:
This field contains a numeric value used to establish the minimum threshold
match. The value instructs the responding system to return no records for
patients whose "match weight" on the look-up was lower than this user-defined
value.
Example: |0.50| or |8.25|
One use of this optional field is in Patient Look-up transactions where the
searching system employs a numeric algorithm for determining potential matches
to patient/person lookups.
The
SPR segment is used to issue queries using stored procedure calls. Refer to
the functional chapters for the lists of HL7-defined stored procedure names,
input parameters and output tables.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
32 |
ST |
O |
00696 |
Query Tag |
||
2 |
1 |
ID |
R |
0106 |
00697 |
Query/Response Format Code |
|
3 |
250 |
CE |
R |
00704 |
Stored Procedure Name |
||
4 |
256 |
QIP |
O |
Y |
00705 |
Input Parameter List |
Definition: This field may be valued by the initiating system to identify the query, and may be used to match response messages to the originating query. If it is valued, the responding system is required to echo it back as the first field in the query acknowledgment segment (QAK). This field differs from MSA-2-Message control ID in that its value remains constant for each message (i.e., all continuation messages) associated with the query, whereas MSA-2-Message control ID may vary with each continuation message, since it is associated with each individual message, not the query as a whole.
Definition:
This field refers to HL7 Table 0106 - Query/response format
code for valid values.
Value |
Description |
|---|---|
D |
Response is in display format |
R |
Response is in record-oriented format |
T |
Response is in tabular format |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the name of the stored procedure that is to be
executed. Values for this field are defined in the function-specific chapters
of this specification; site-specific stored procedure names begin with the
letter "Z."
Components:
<segment field name (ST)> ^ <value1 (ST) & value2 (ST) &
value3 (ST) ...>
Definition: This field contains the list of parameter names and values to be
passed to the stored procedure, in the form "<segment field name> ^
<value1& value2 & value3 ...>." A single valued parameter
contains only a single subcomponent in the second component: thus no
subcomponent delimiters are needed (e.g., <segment field name> ^
<value>). A simple list of values (i.e., a one-dimensional array)
may be passed instead of a single value by separating each value with the
subcomponent delimiter: "<segment field name> ^ <value1&
value2 &...>." Refer to Section <IP_ADDRESS>.4, "EQL-4 EQL query
statement (ST) 00710 for segment field naming conventions.
The
URD segment is used in sending unsolicited updates about orders and results.
Its purpose is similar to that of the QRD segment, but from the
results/unsolicited update point of view. Some of the fields have parallels in
the QRD segment.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM # |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |