5  HL7 Queries within PatientDataQuery Operation

Although there is a single NHIN SOAP operation, it may contain a variety of different HL7 queries. HL7 2.4 requires a formal “Conformance Statement” be published for each of these queries. The sections that follow document the currently supported NHIN queries for patient data and their “Conformance Statements.” Table 1 below lists all of the currently defined HL7 queries supported within the NHINQuery service.

HL7 Queries Supported by NHINQuery SOAP Service

5.1  Observation Reporting Query for Patient Results and Reports

An Observation Reporting Query requests clinical results and reports for one person. Query “parameter” values may be used to limit the number and type of the returned results and reports. The query contains HL7’s MSH, QPD, and PID, and RCP segments, in that order. The response message is an HL7 response based on the ORU^R01 message for laboratory reports and results and/or a NCPDP Scripts 8.1 element for medication dispensing history. The official HL7 query “conformance statement” for the query is defined in section below, although it does not address the medication dispensing history portion of the returned data.

Most clinical data are supported by this query-response pair. Clinical laboratory results, pathology reports, vital signs, nursing notes, radiology reports, diagnosis lists, patient questionnaire results, discharge summaries, and more are easily represented in the response message. Refer to chapter 7 of the HL7 2.4 manual for more details on the ORU^R01 message and its great flexibility.

The HL7 ORU^R01 messages are formatted according to the ELINCS 2.0 standard, formerly available at http://www.chcf.org/topics/chronicdisease/index.cfm. The ELINCS specification contains an implementation guide for constructing HL7 ORU^R01 messages. ELINCS defines LOINC codes to be used for common laboratory tests, types of HL7 data expected in each ORU^R01 data field, and general guidelines for HL7 message construction. “Laboratory Results Standards," part of The Markle Connecting for Health Common Framework: Resources for Implementing Private and Secure Health Information Exchange, notes the deviations we make from the ELINCS standard. For the most part, these deviations are simply the permission to populate HL7 data fields in cases where ELINCS prohibits those data fields from being valued.

The NCPDP Scripts 8.1 XML in which the medication dispensing history is returned is described in “Medication History Standards,” part of The Markle Connecting for Health Common Framework: Resources for Implementing Private and Secure Health Information Exchange.

5.1.1  Observation Reporting Query Conformance Statement

 

Query Grammar Pattern

 

Response Grammar Pattern

 

QPD Input Parameter Specification

 

QPD Input Parameter Field Description and Commentary

 

RCP Response Control Parameter Field Description and Commentary

5.1.2  Observation Reporting Query HL7 Message Description

The QPD segment defines the type of data, amount of data, and reporting time frame of the data being requested. The PID segment defines the patient for whom data is being requested.

5.1.3  Observation Reporting Query Response Message

This response message is based on the standard HL7 ORU^R01 message. It contains one <RSP_Z01> node for each registration for which results and/or reports exist. Each <RSP_Z01> node contains exactly one <RSP_Z01.PATIENT> node, which contains exactly one <PID> node.

Each <RSP_Z01> node also contains one or more <RSP_Z01.ORDER_OBSERVATION> nodes. Each <RSP_Z01.ORDER_OBSERVATION> node represents a single result battery or text report, as per the HL7 Observation Reporting specification. The order of the <RSP_Z01.ORDER_OBSERVATION> nodes is not guaranteed. 

The following table lists the HL7 segments that one can currently expect in the NHIN query response. Note that the HL7 specification defines additional segments for this message type; but that NHIN queries do not return those optional segments at this point in time. In fact, most of those optional segments will never be returned in NHIN query responses.

Note that the XML format for sending HL7 results requires some additional “grouping” tags that segregate the registration data from the reports. Our sample messages demonstrate this grouping.

5.1.4  Complete Example

Sample Query:

 <QBP_Z01 xmlns="urn:hl7-org:v2xml" >
        <MSH>
                  <MSH.1/>
                  <MSH.2/>
                  <MSH.3>
                              <HD.1>Query Application Name</HD.1>
                  </MSH.3>
                  <MSH.4>
                              <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                  </MSH.4>
                  <MSH.5>
                              <HD.1>Target ISB</HD.1>
                  </MSH.5>
                  <MSH.6>
                              <HD.1>Target SNO Name</HD.1>
                  </MSH.6>
                  <MSH.7>
                              <TS.1>200506171410</TS.1>
                  </MSH.7>
                  <MSH.9>
                              <MSG.1>QBP</MSG.1>
                              <MSG.2>Z01</MSG.2>
                              <MSG.3>QBP_Z01</MSG.3>
                  </MSH.9>
                              <MSH.10>123456789</MSH.10>
                  <MSH.11>
                               <PT.1>P</PT.1>
                  </MSH.11>
                  <MSH.12>
                               <VID.1>2.4</VID.1>
                  </MSH.12>
                  </MSH>
                  <QPD>
                               <QPD.1>
                                           <CE.1>Z01</CE.1>
                                           <CE.2>Observation Reporting Query</CE.2>
                                           <CE.3>NHIN Query Code</CE.3>
                              </QPD.1>
                              <QPD.2>Q123456</QPD.2>
                              <QPD.3>
                                           <CE.1>RES</CE.1>
                                           <CE.2>result</CE.2>
                                           <CE.3>0048</CE.3>
                              </QPD.3>
                              <QPD.5>
                                           <CE.1>LABORATORY</CE.1>
                                           <CE.2>Laboratory</CE.2>
                                           <CE.3>NHIN_0001</CE.3>
                              </QPD.5>
                              <QPD.6>
                                             <TS.1>19980810</TS.1>
                              </QPD.6>
                              <QPD.8>LATEST</QPD.8>
                  </QPD>
                  <PID>
                               <PID.1></PID.1>
                               <PID.2></PID.2>
                               <PID.3></PID.3>
                               <PID.5>
                                             <XPN.1>
                                                          <FN.1>THOMPSON</FN.1>
                                             </XPN.1>
                                             <XPN.2>MARK</XPN.2>
                                             <XPN.3>Q</XPN.3>
                               </PID.5>
                               <PID.5>
                                               <XPN.1>
                                                            <FN.1>AliasLastName</FN.1>
                                               </XPN.1>
                                               <XPN.2>AliasFirstName</XPN.2>
                                               <XPN.3>AliasMiddleName</XPN.3>
                               </PID.5>
                               <PID.7>
                                               <TS.1>19090630</TS.1>
                               </PID.7>
                               <PID.8>M</PID.8>
                               <PID.11>
                                                  <XAD.1>
                                                                 <SAD.1>28W 10TH Street</SAD.1>
                                                  </XAD.1>
                                                  <XAD.3>Metropolis</XAD.3>
                                                  <XAD.4>IN</XAD.4>
                                                  <XAD.5>98765</XAD.5>
                               </PID.11>
                               <PID.11>
                                                  <XAD.1>
                                                                 <SAD.1>666 Bleaker Street</SAD.1>
                                                  </XAD.1>
                                                  <XAD.3>QUINCY</XAD.3>
                                                  <XAD.4>MA</XAD.4>
                                                  <XAD.5>02171</XAD.5>
                               </PID.11>
                               <PID.19>9991112222</PID.19>
                  </PID>
                  <RCP>
                               <RCP.1>I</RCP.1>
                               <RCP.2><CQ.1>10</CQ.1></RCP.2>
                  </RCP>
       </QBP_Z01>

 Sample Response:

<RSP_Z01 xmlns="urn:hl7-org:v2xml">
        <MSH>
                        <MSH.1/>
                        <MSH.2/>
                        <MSH.3>
                                        <HD.1>Target ISB</HD.1>
                        </MSH.3>
                        <MSH.4>
                                        <HD.1>Target SNO Name</HD.1>
                        </MSH.4>
                        <MSH.5>
                                        <HD.1>Query Application Name</HD.1>
                        </MSH.5>
                        <MSH.6>
                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                        </MSH.6>
                        <MSH.7>
                                        <TS.1>20051024074506</TS.1>
                        </MSH.7>
                        <MSH.9>
                                        <MSG.1>RSP</MSG.1>
                                        <MSG.2>Z01</MSG.2>
                                        <MSG.3>RSP_Z01</MSG.3>
                        </MSH.9>
                        <MSH.10>432</MSH.10>
                        <MSH.11>
                                        <PT.1>P</PT.1>
                        </MSH.11>
                        <MSH.12>
                                        <VID.1>2.4</VID.1>
                        </MSH.12>
        </MSH>
        <MSA>
                        <MSA.1>AA</MSA.1>
                        <MSA.2>123456789</MSA.2>
        </MSA>
        <QAK/>
        <QPD>
                        <QPD.1>
                                        <CE.1>Z01</CE.1>
                                        <CE.2>Observation Reporting Query</CE.2>
                                        <CE.3>NHIN Query Code</CE.3>
                        </QPD.1>
                        <QPD.2>Q123456</QPD.2>
                        <QPD.3>
                                        <CE.1>RES</CE.1>
                                        <CE.2>result</CE.2>
                                        <CE.3>0048</CE.3>
                        </QPD.3>
                        <QPD.5>
                                        <CE.1>LABORATORY</CE.1>
                                        <CE.2>Laboratory</CE.2>
                                        <CE.3>NHIN_0001</CE.3>
                        </QPD.5>
                        <QPD.6>
                                        <TS.1>19980810</TS.1>
                        </QPD.6>
                        <QPD.8>LATEST</QPD.8>
        </QPD>
        <RSP_Z01.PATIENT_RESULT>
                        <RSP_Z01.PATIENT>
                                        <PID>
                                                        <PID.3>
                                                                        <CX.1>MADEUP-7</CX.1>
                                                                        <CX.4>
                                                                                        <HD.1>ST ELSEWHERE HOSPITAL
                                                                                                     Medical Record Numbers</HD.1>
                                                                                        <HD.2>MEDICAL RECORD NUMBER</HD.2>
                                                                                        <HD.3>ST ELSEWHERE HOSPITAL</HD.3>
                                                                        </CX.4>
                                                                        <CX.5>MR</CX.5>
                                                                        <CX.6>
                                                                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                                                                        </CX.6>
                                                        </PID.3>
                                                        <PID.5>
                                                                        <XPN.1>
                                                                                        <FN.1>THOMSON</FN.1>
                                                                        </XPN.1>
                                                                        <XPN.2>MARK</XPN.2>
                                                        </PID.5>
                                                        <PID.7>
                                                                        <TS.1>19090630</TS.1>
                                                        </PID.7>
                                                        <PID.8>M</PID.8>
                                                        <PID.11>
                                                                        <XAD.3>N. QUINCY</XAD.3>
                                                                        <XAD.4>MA</XAD.4>
                                                                        <XAD.5>02171</XAD.5>
                                                        </PID.11>
                                        </PID>
                        </RSP_Z01.PATIENT>
                        <RSP_Z01.ORDER_OBSERVATION>
                                        <OBR>
                                                        <OBR.3>
                                                                        <EI.1>FAKE-14454</EI.1>
                                                                        <EI.2>ST ELSEWHERE HOSPITAL EKG System</EI.2>
                                                                        <EI.3>FILLER ORDER NUMBER</EI.3>
                                                                        <EI.4>ST ELSEWHERE HOSPITAL</EI.4>
                                                        </OBR.3>
                                                        <OBR.4>
                                                                        <CE.1>18844-1</CE.1>
                                                                        <CE.2>EKG</CE.2>
                                                                        <CE.3>LN</CE.3>
                                                        </OBR.4>
                                                        <OBR.7>
                                                                        <TS.1>198905191158</TS.1>
                                                        </OBR.7>
                                        </OBR>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>NM</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>8626-4</CE.1>
                                                                                        <CE.2>P-Wave Axis</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>0</OBX.4>
                                                                        <OBX.5>75</OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                       <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>NM</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>8632-2</CE.1>
                                                                                        <CE.2>QRS-Axis</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>0</OBX.4>
                                                                        <OBX.5>106</OBX.5>
                                                                        <OBX.8>HH</OBX.8>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>NM</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>8638-9</CE.1>
                                                                                        <CE.2>T-Wave Axis</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>0</OBX.4>
                                                                        <OBX.5>-9</OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>CE</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>18844-1</CE.1>
                                                                                        <CE.2>EKG</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>0</OBX.4>
                                                                        <OBX.5>
                                                                                        <CE.1>9327</CE.1>
                                                                                        <CE.2>normal sinus rhythm</CE.2>
                                                                                        <CE.3>Local Concept</CE.3>
                                                                        </OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                       <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>CE</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>18844-1</CE.1>
                                                                                        <CE.2>EKG</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>1</OBX.4>
                                                                        <OBX.5>
                                                                                        <CE.1>11397</CE.1>
                                                                                        <CE.2>sinus arrhythmia</CE.2>
                                                                                        <CE.3>Local Concept</CE.3>
                                                                        </OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>CE</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>18844-1</CE.1>
                                                                                        <CE.2>EKG</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>2</OBX.4>
                                                                        <OBX.5>
                                                                                        <CE.1>678</CE.1>
                                                                                        <CE.2>right bundle branch block</CE.2>
                                                                                        <CE.3>Local Concept</CE.3>
                                                                        </OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>CE</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>18844-1</CE.1>
                                                                                        <CE.2>EKG</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>3</OBX.4>
                                                                        <OBX.5>
                                                                                        <CE.1>18557</CE.1>
                                                                                        <CE.2>abnormal ECG</CE.2>
                                                                                        <CE.3>Local Concept</CE.3>
                                                                        </OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>NM</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>8637-1</CE.1>
                                                                                        <CE.2>RR Interval</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>0</OBX.4>
                                                                        <OBX.5>998</OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>NM</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>8634-8</CE.1>
                                                                                        <CE.2>QT Interval</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>0</OBX.4>
                                                                        <OBX.5>436</OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                                        <RSP_Z01.OBSERVATION>
                                                        <OBX>
                                                                        <OBX.2>NM</OBX.2>
                                                                        <OBX.3>
                                                                                        <CE.1>8625-6</CE.1>
                                                                                        <CE.2>PR Interval</CE.2>
                                                                                        <CE.3>LN</CE.3>
                                                                        </OBX.3>
                                                                        <OBX.4>0</OBX.4>
                                                                        <OBX.5>160</OBX.5>
                                                                        <OBX.11>F</OBX.11>
                                                                        <OBX.14>
                                                                                        <TS.1>198905191158</TS.1>
                                                                        </OBX.14>
                                                        </OBX>
                                        </RSP_Z01.OBSERVATION>
                        </RSP_Z01.ORDER_OBSERVATION>
        </RSP_Z01.PATIENT_RESULT>
</RSP_Z01>

5.2  Patient Identities Query Message 

A Patient Identities Query identifies a person of interest (person attributes are specified in an HL7 PID segment) and requests the NHIN server to find all of the known patient registrations for that person, across that SNO. The SOAP request message is an HL7 Query By Parameter (QBP) message with event code Z02. It contains HL7’s MSH, QPD, PID, and RCP segments, in that order. The response message will contain one PID segment for each registration found in one of the SNO’s Master Patient Index tables.

5.2.1  Patient Identities Query Conformance Statement

 

Query Grammar Pattern

 

Response Grammar Pattern

Only the PID segment is currently valued, but other segments might be valued in future releases.

QPD Input Parameter Specification

 

QPD Input Parameter Field Description and Commentary

 

RCP Response Control Parameter Field Description and Commentary

5.2.2  Patient Identities Query Message Description

5.2.3  Patient Identities Response Message Format

This response contains a list of HL7 PID segments, one for each patient registration that matches the attributes specified in the query. In the case where no matches are found, the return message contains no PID segments. “No matches” is not considered an error condition.

The response is an HL7 ADT Response ADR message with event code A19. It contains only the HL7 MSH, MSA, and PID segments, in that order. There is one PID segment per registration match found.

5.2.4  Sample Patient Identities Query Message Dialogue

Sample Query:

<QBP_Z02 xmlns="urn:hl7-org:v2xml">
        <MSH>
                        <MSH.1/>
                        <MSH.2/>
                        <MSH.3>
                                        <HD.1>Query Application Name</HD.1>
                        </MSH.3>
                        <MSH.4>
                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                        </MSH.4>
                        <MSH.5>
                                        <HD.1>Target ISB</HD.1>
                        </MSH.5>
                        <MSH.6>
                                        <HD.1>Target SNO Name</HD.1>
                        </MSH.6>
                        <MSH.7>
                                        <TS.1>200506171410</TS.1>
                        </MSH.7>
                        <MSH.9>
                                        <MSG.1>QBP</MSG.1>
                                        <MSG.2>Z02</MSG.2>
                                        <MSG.3>QBP_Z02</MSG.3>
                        </MSH.9>
                        <MSH.10>987654321</MSH.10>
                        <MSH.11>
                                        <PT.1>P</PT.1>
                        </MSH.11>
                        <MSH.12>
                                        <VID.1>2.4</VID.1>
                        </MSH.12>
        </MSH>
        <QPD>
                        <QPD.1></QPD.1>
                        <QPD.2></QPD.2>
        </QPD>
        <PID>
                        <PID.1></PID.1>
                        <PID.2></PID.2>
                        <PID.3></PID.3>
                        <PID.5>
                                        <XPN.1>
                                                        <FN.1>THOMPSON</FN.1>
                                        </XPN.1>
                                        <XPN.2>MARK</XPN.2>
                                        <XPN.3>Q</XPN.3>
                        </PID.5>
                        <PID.5>
                                        <XPN.1>
                                                        <FN.1>AliasLastName</FN.1>
                                        </XPN.1>
                                        <XPN.2>AliasFirstName</XPN.2>
                                        <XPN.3>AliasMiddleName</XPN.3>
                        </PID.5>
                        <PID.7>
                                        <TS.1>19090630</TS.1>
                        </PID.7>
                        <PID.8>M</PID.8>
                        <PID.11>
                                        <XAD.1>
                                                        <SAD.1>28W 10TH Street</SAD.1>
                                        </XAD.1>
                                        <XAD.3>Metropolis</XAD.3>
                                        <XAD.4>IN</XAD.4>
                                        <XAD.5>98765</XAD.5>
                        </PID.11>
                        <PID.11>
                                        <XAD.1>
                                                        <SAD.1>666 Bleaker Street</SAD.1>
                                        </XAD.1>
                                        <XAD.3>QUINCY</XAD.3>
                                        <XAD.4>MA</XAD.4>
                                        <XAD.5>02171</XAD.5>
                        </PID.11>
                        <PID.19>9991112222</PID.19>
        </PID>
        <RCP/>
</QBP_Z02>

Sample Response:

<RSP_Z02 xmlns="urn:hl7-org:v2xml">
        <MSH>
                        <MSH.1/>
                        <MSH.2/>
                        <MSH.3>
                                        <HD.1>Target ISB</HD.1>
                        </MSH.3>
                        <MSH.4>
                                        <HD.1>Target SNO Name</HD.1>
                        </MSH.4>
                        <MSH.5>
                                        <HD.1>Query Application Name</HD.1>
                        </MSH.5>
                        <MSH.6>
                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                        </MSH.6>
                        <MSH.7>
                                        <TS.1>20051024074505</TS.1>
                        </MSH.7>
                        <MSH.9>
                                        <MSG.1>QBP</MSG.1>
                                        <MSG.2>Z02</MSG.2>
                                        <MSG.3>QBP_Z02</MSG.3>
                        </MSH.9>
                        <MSH.10>2</MSH.10>
                        <MSH.11>
                                        <PT.1>P</PT.1>
                        </MSH.11>
                        <MSH.12>
                                        <VID.1>2.4</VID.1>
                        </MSH.12>
        </MSH>
        <MSA>
                        <MSA.1>AA</MSA.1>
                        <MSA.2>123456789</MSA.2>
        </MSA>
        <QAK/>
        <QPD>
                        <QPD.1></QPD.1>
                        <QPD.2></QPD.2>
        </QPD>
        <RSP_Z02.QUERY_RESPONSE>
                        <PID>
                                        <PID.1/>
                                        <PID.2/>
                                        <PID.3>
                                                        <CX.1>MADEUP-7</CX.1>
                                                        <CX.4>
                                                                        <HD.1>ST ELSEWHERE HOSPITAL Medical Record
                                                                                     Numbers</HD.1>
                                                                        <HD.2>MEDICAL RECORD NUMBER</HD.2>
                                                                        <HD.3>ST ELSEWHERE HOSPITAL</HD.3>
                                                        </CX.4>
                                                        <CX.5>MR</CX.5>
                                                        <CX.6>
                                                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                                                        </CX.6>
                                        </PID.3>
                                        <PID.5>
                                                        <XPN.1>
                                                                        <FN.1>THOMSON</FN.1>
                                                        </XPN.1>
                                                        <XPN.2>MARK</XPN.2>
                                        </PID.5>
                                        <PID.7>
                                                        <TS.1>19090630</TS.1>
                                        </PID.7>
                                        <PID.8>M</PID.8>
                                        <PID.11>
                                                        <XAD.3>N. QUINCY</XAD.3>
                                                        <XAD.4>MA</XAD.4>
                                                        <XAD.5>02171</XAD.5>
                                        </PID.11>
                        </PID>
        </RSP_Z02.QUERY_RESPONSE>
        <RSP_Z02.QUERY_RESPONSE>
                        <PID>
                                        <PID.1/>
                                        <PID.2/>
                                        <PID.3>
                                                        <CX.1>MADEUP-8</CX.1>
                                                        <CX.4>
                                                                        <HD.1>ST ELSEWHERE HOSPITAL Medical Record
                                                                                     Numbers</HD.1>
                                                                        <HD.2>MEDICAL RECORD NUMBER</HD.2>
                                                                        <HD.3>ST ELSEWHERE HOSPITAL</HD.3>
                                                        </CX.4>
                                                        <CX.5>MR</CX.5>
                                                        <CX.6>
                                                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                                                        </CX.6>
                                        </PID.3>
                                        <PID.5>
                                                        <XPN.1>
                                                                        <FN.1>THOMSON</FN.1>
                                                        </XPN.1>
                                                        <XPN.2>MARCUS</XPN.2>
                                        </PID.5>
                                        <PID.7>
                                                        <TS.1>19090630</TS.1>
                                        </PID.7>
                                        <PID.8>M</PID.8>
                                        <PID.11>
                                                        <XAD.3>BOSTON</XAD.3>
                                                        <XAD.4>MA</XAD.4>
                                                        <XAD.5>02171</XAD.5>
                                        </PID.11>
                        </PID>
        </RSP_Z02.QUERY_RESPONSE>
</RSP_Z02> 

5.3  Access History Query—Reporting NHIN Accesses Made and Attempted

Access History Query requests data from the SNO’s log of access attempts. This information could be used to obtain data about whose information a particular user has been accessing, which users have been accessing a particular person’s data, or a combination of those conditions. HL7 supports this type of query with its QBP/RTB pattern (query by parameter and tabular response). The QPD elements can also be used to limit the returned access log data by time. The RCP elements can limit the response data to a maximum number of rows.

5.3.1  Access History Query Conformance Statement

 

Query Grammar Pattern

 

Response Grammar Pattern

 

QPD Input Parameter Specification

 

QPD Input Parameter Field Description and Commentary

 

RCP Response Control Parameter Field Description and Commentary

 

Input/Output Specification: Virtual Table

 

Virtual Table Field Description and Commentary

5.3.2  Access History Query HL7 Message Segments

5.3.3  Access History Query Response Message Format

This response contains a list of the virtual “rows,” one per user access returned from the user access log. “No matches” is not considered an error condition. No rows are simply returned.

5.3.4  Sample Access History Message Dialogue

Sample Query:

<QBP_Z03 xmlns="urn:hl7-org:v2xml">
        <MSH>
                        <MSH.1/>
                        <MSH.2/>
                        <MSH.3>
                                        <HD.1>Query Application Name</HD.1>
                        </MSH.3>
                        <MSH.4>
                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                        </MSH.4>
                        <MSH.5>
                                        <HD.1>Target ISB</HD.1>
                        </MSH.5>
                        <MSH.6>
                                        <HD.1>Target SNO Name</HD.1>
                        </MSH.6>
                        <MSH.7>
                                        <TS.1>200506171410</TS.1>
                        </MSH.7>
                        <MSH.9>
                                        <MSG.1>QBP</MSG.1>
                                        <MSG.2>Z03</MSG.2>
                                        <MSG.3>QBP_Z03</MSG.3>
                        </MSH.9>
                        <MSH.10>987654321</MSH.10>
                        <MSH.11>
                                        <PT.1>P</PT.1>
                        </MSH.11>
                        <MSH.12>
                                        <VID.1>2.4</VID.1>
                        </MSH.12>
        </MSH>
        <QPD>
                        <QPD.1>
                                        <CE.1>Z03</CE.1>
                                        <CE.2>Access History Query</CE.2>
                                        <CE.3>NHIN Query Code</CE.3>
                        </QPD.1>
                        <QPD.2>Q987654321</QPD.2>
                        <QPD.4>
                                        <TS.1>200602241030</TS.1>
                        </QPD.4>
        </QPD>
        <PID>
                        <PID.1></PID.1>
                        <PID.2></PID.2>
                        <PID.3></PID.3>
                        <PID.5>
                                        <XPN.1>
                                                        <FN.1>THOMPSON</FN.1>
                                        </XPN.1>
                                        <XPN.2>MARK</XPN.2>
                                        <XPN.3>Q</XPN.3>
                        </PID.5>
                        <PID.5>
                                        <XPN.1>
                                                        <FN.1>AliasLastName</FN.1>
                                        </XPN.1>
                                        <XPN.2>AliasFirstName</XPN.2>
                                        <XPN.3>AliasMiddleName</XPN.3>
                        </PID.5>
                        <PID.7>
                                        <TS.1>19090630</TS.1>
                        </PID.7>
                        <PID.8>M</PID.8>
                        <PID.11>
                                        <XAD.1>
                                                        <SAD.1>28W 10TH Street</SAD.1>
                                        </XAD.1>
                                        <XAD.3>Metropolis</XAD.3>
                                        <XAD.4>IN</XAD.4>
                                        <XAD.5>98765</XAD.5>
                        </PID.11>
                        <PID.11>
                                        <XAD.1>
                                                        <SAD.1>666 Bleaker Street</SAD.1>
                                        </XAD.1>
                                        <XAD.3>QUINCY</XAD.3>
                                        <XAD.4>MA</XAD.4>
                                        <XAD.5>02171</XAD.5>
                        </PID.11>
                        <PID.19>9991112222</PID.19>
        </PID>
        <RCP/>
</QBP_Z03>

Sample Response:

<RTB_Z03 xmlns="urn:hl7-org:v2xml">
        <MSH>
                        <MSH.1/>
                        <MSH.2/>
                        <MSH.3>
                                        <HD.1>Target ISB</HD.1>
                        </MSH.3>
                        <MSH.4>
                                        <HD.1>Target SNO Name</HD.1>
                        </MSH.4>
                        <MSH.5>
                                        <HD.1>Query Application Name</HD.1>
                        </MSH.5>
                        <MSH.6>
                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                        </MSH.6>
                        <MSH.7>
                                        <TS.1>20051024074505</TS.1>
                        </MSH.7>
                        <MSH.9>
                                        <MSG.1>RSP</MSG.1>
                                        <MSG.2>Z03</MSG.2>
                                        <MSG.3>RSP_Z03</MSG.3>
                        </MSH.9>
                        <MSH.10>2</MSH.10>
                        <MSH.11>
                                        <PT.1>P</PT.1>
                        </MSH.11>
                        <MSH.12>
                                        <VID.1>2.4</VID.1>
                        </MSH.12>
        </MSH>
        <MSA>
                        <MSA.1>AA</MSA.1>
                        <MSA.2>123456789</MSA.2>
        </MSA>
        <QAK/>
        <QPD>
                        <QPD.1>
                                        <CE.1>Z03</CE.1>
                                        <CE.2>Access History Query</CE.2>
                                        <CE.3>NHIN Query Code</CE.3>
                        </QPD.1>
                        <QPD.2>Q987654321</QPD.2>
                        <QPD.4>
                                        <TS.1>200602241030</TS.1>
                        </QPD.4>
        </QPD>
        <RTB_Z03.ROW_DEFINITION>
                        <RDF>
                                        <RDF.1>8</RDF.1>
                                        <RDF.2>
                                                        <RCD.1>QueryUser</RCD.1>
                                                        <RCD.2>XCN</RCD.2>
                                                        <RCD.3>100</RCD.3>
                                        </RDF.2>
                                        <RDF.2>
                                                        <RCD.1>QueryURL</RCD.1>
                                                        <RCD.2>ST</RCD.2>
                                                        <RCD.3>100</RCD.3>
                                        </RDF.2>
                                        <RDF.2>
                                                        <RCD.1>QueryTag</RCD.1>
                                                        <RCD.2>ST</RCD.2>
                                                        <RCD.3>40</RCD.3>
                                        </RDF.2>
                                        <RDF.2>
                                                        <RCD.1>QueryBegin</RCD.1>
                                                        <RCD.2>DT</RCD.2>
                                                        <RCD.3>26</RCD.3>
                                        </RDF.2>
                                        <RDF.2>
                                                        <RCD.1>QueryEnd</RCD.1>
                                                        <RCD.2>DT</RCD.2>
                                                        <RCD.3>26</RCD.3>
                                        </RDF.2>
                                        <RDF.2>
                                                        <RCD.1>QueryServiceCode</RCD.1>
                                                        <RCD.2>CE</RCD.2>
                                                        <RCD.3>200</RCD.3>
                                        </RDF.2>
                                        <RDF.2>
                                                       <RCD.1>QueryDepartmentCode</RCD.1>
                                                        <RCD.2>CE</RCD.2>
                                                        <RCD.3>200</RCD.3>
                                        </RDF.2>
                                        <RDF.2>
                                                        <RCD.1>Patient</RCD.1>
                                                        <RCD.2>XCN</RCD.2>
                                                        <RCD.3>200</RCD.3>
                                        </RDF.2>
                        </RDF>
                        <RDT>
                                        <RDT.1>
                                                        <XCN.1>JoeUser</XCN.1>
                                                        <XCN.2>
                                                                        <FN.1>Smith</FN.1>
                                                        </XCN.2>
                                                        <XCN.3>Joseph</XCN.3>
                                                        <XCN.9>
                                                                        <HD.1>ST ELSEWHERE HOSPITAL Users</HD.1>
                                                                        <HD.2>USERID</HD.2>
                                                                        <HD.3>ST ELSEWHERE HOSPITAL</HD.3>
                                                        </XCN.9>
                                                        <XCN.13>EI</XCN.13>
                                                        <XCN.14>
                                                                        <HD.1>ST ELSEWHERE HOSPITAL</HD.1>
                                                        </XCN.14>
                                        </RDT.1>
                                        <RDT.2>https://www.myisb.org</RDT.2>
                                        <RDT.3>Observation Reporting Query</RDT.3>
                                        <RDT.4>
                                                        <TS.1>200602230831</TS.1>
                                        </RDT.4>
                                        <RDT.5>
                                                        <TS.1>200602230832</TS.1>
                                        </RDT.5>
                                        <RDT.8>
                                                        <XCN.1>123456-7</XCN.1>
                                                        <XCN.2>
                                                                        <FN.1>Patient</FN.1>
                                                        </XCN.2>
                                                        <XCN.3>Example</XCN.3>
                                                        <XCN.9>
                                                                        <HD.1>Brigadoon Emergency Care Patients</HD.1>
                                                                        <HD.2>MR</HD.2>
                                                                        <HD.3>Brigadoon Emergency Care</HD.3>
                                                        </XCN.9>
                                                        <XCN.13>MR</XCN.13>
                                                        <XCN.14>
                                                                        <HD.1>Brigadoon Emergency Care</HD.1>
                                                        </XCN.14>
                                        </RDT.8>
                        </RDT>
        </RTB_Z03.ROW_DEFINITION>
</RTB_Z03>