Patient Demographics Query HL7 v3

Patient Demographics Query HL7 v3

Transaction ITI-47 is used by the Patient Demographics Consumer and Patient Demographics Supplier actors.. The Patient Demographics Supplier actor uses this transaction to return demographic information for all patients matching the demographic criteria provided by the Patient Demographics Consumer. The following figure is an interaction diagram that illustrates the interaction between the Patient Demographics Consumer and the Patient Demographics Supplier.

A Patient Demographics Consumer's need to select a patient based on demographic information about patients whose information matches a set of known data will trigger the Patient Demographics Query based on the Find Candidates Query (PRPA_TE201305UV02) trigger event. The Find Candidates Query is supported by the Patient Registry Query by Demographics (PRPA_MT201306UV02) message. The receiver shall respond to the query by sending the Patient Registry Find Candidates Response message (PRPA_MT201310UV02) which uses the Application Level Acknowledgement transmission wrapper.

Major Components of the Patient Registry Query by Demographics

  • LivingSubjectName parameter is an optional parameter that specifies the name of the person whose information is being queried. If the sender needs to indicate that the name parts specified are not limited to an exact match, then the use attribute of the value element should be set to "SRCH" and then it is up to the Patient Demographics Supplier to choose to handle phonetic issues, alternative spellings, upper and lower case, partial matching, accented characters, etc.
  • LivingSubjectAdministrativeGender is an optional parameter that specifies the administrative gender of the person.
  • LivingSubjectBirthTime is an optional parameter that specifies the birth date and time of the person.
  • PatientAddress is an optional parameter that specifies one or more addresses associated with the person whose information is being queried.
  • LivingSubjectId is an optional parameter that specifies an identifier associated with the patient whose information is being queried.
  • OtherIDsScopingOrganization is an optional repeating parameters that specifies the assigning authority of the patient identity domains for which identifiers are to be returned.
  • MothersMaidenName is an optional parameter which specifies the maiden name of the mother of the person whose information is being queried.
  • PatientTelecom is an optional parameter that specifies the primary telephone number or email address of the person whose information is being queried.

Message Information Model of the Patient Registry Query by Demographics Message

The message information model for this query is a strict subset of the Patient Registry Query by Demographics (PRPA_RM201306UV02) RMIM. The following restrictions are made on the original RMIMs to arrive at the restricted model:

  • Exactly one value attribute shall be present in each parameter
  • Only the LivingSubjectId, OtherIDsScopingOrganization, and LivingSubjectName parameters can have more that one instance
  • QueryByParameter.responsePriorityCode is required and is fixed to I (Immediate)
  • QueryByParameter.responseModalityCode is required and is fixed to R (Real Time)
  • QueryByParameter.statusCode is defaulted to "new"

Expected Actions

The Patient Demographics Supplier shall immediately return a Find Candidates Response message. The response message uses the Application Acknowledgement transmission wrapper, as specified in ITI TF-2x: Appendix O.1.3, and no other acknowledgements are part of this transaction.

The Patient Demographics Supplier shall be capable of accepting, searching on, and responding with attributes in the Query Person by Demographics message. Handling of approximate matching are to be supported by the Supplier as deemed appropriate but the supplier shall return at least all exact matches to the query parameters sent by the Consumer.

Incremental Response Processing: The Supplier which supports the Continuation Option, shall be capable of accepting and processing the QueryByParameter.responsePriorityCode attribute. The Supplier shall be able to interpret the QueryByParameter.initialQuantity to return successive responses of partial lists of records. When processing incremental responses, the Consumer shall request additional responses using the Query Control Act Request Continue/Cancel message (QUQI_MT000001UV01).

Message Information Model of the Patient Registry Find Candidates Response Message

The message information model for this message is a strict subset of the Patient Registry Find Candidates Response (PRPA_RM201310UV02) RMIM. See pages 234-237 of IHE IT Infrastructure Technical Framework, Volume 2b. The QueryAck.resultTotalQuantity, QueryAck.resultCurrentQuantity, and QueryAck.resultRemainingQuantity attributes SHALL have the appropriate values populated.

Expected Actions

The Supplier shall perform the matching of patient data based on the query parameter values it receives. The information provided by the Supplier to the Consumer is a list of possible matching patients from the patient information source associated with the value that the Consumer sent in the Device class of the transmission wrapper of the query message. If OtherIDsScopingOrganization were part of the query, and they were recognized by the Supplier as identifying known identity domains, the response will also, for each patient, contain any Patient ID values found in the specified domains.

The Supplier shall response to the query request as described by the following 3 cases:

Case 1: The Supplier finds finds at least one patient record matching the criteria sent in the query parameters. There were no OtherIDsScopingOrganization parameters in the query:

AA (application accept) is returned in Acknowledgement.typeCode

OK (data found, no errors) is returned in QueryAck.queryResponseCode.

One registration event is returned from the source for each patient record found. If the Supplier returns data for multiple patients, it shall return these data in successive occurrences of the RegistrationEvent class within the wrapper. For each patient, one or more identifiers from the Patient ID domain with the target patient information source identified by the Receiver.Device are represented as Patient.id attributes.

If an incremental number of records are specified in the QueryByParameter.initialQuantity and the number of records to be sent exceeds that incremental number, the Supplier shall return only up to the incremental number of records. If the Supplier supports the Continuation option, it shall correctly populate the resultTotalQuantity, resultCurrentQuantity, and resultRemainingQuantity attributes of the QueryAck class in the control act wrapper. If the Supplier does not support the Continuation option, in addition to returning only up to the incremental number of records requested, it shall return AE (application error) in the Acknowledgement.typeCode  and AE in the QueryAck.queryResponseCode.

Case 2: The Supplier finds at least one patient record matching the criteria sent in the query parameters. One or more OtherIDsScopingOrganization parameters are present in the query; the Supplier recognizes all the requested domains.

AA (application accept) is returned in Acknowledgement.typeCode

OK (data found, no errors) is returned in QueryAck.queryResponseCode.

One registration event is returned from the source for each patient record found. If the Supplier returns data for multiple patients, it shall return these data in successive occurrences of the RegistrationEvent class within the wrapper. For each patient, the identifiers from all the Patient ID Domains requested via the OtherIDsScopingOrganization parameter are returned either as values of the Patient.id attribute, or as values of the OtherIDs.id attribute. The same patient identifier shall not appear in both the Patient.id and OtherIDs.id attributes. The Consumer shall consider the identifiers from both places as equivalently valid. If the Supplier cannot provide a patient ID for some of the requested ID domains, then an OtherIDs.id attribute shall have an appropriate null value, and the ScopingOrganization class shall identify the corresponding domain.

If an incremental number of records are specified in the QueryByParameter.initialQuantity and the number of records to be sent exceeds that incremental number, the Supplier shall return only up to the incremental number of records. If the Supplier supports the Continuation option, it shall correctly populate the resultTotalQuantity, resultCurrentQuantity, and resultRemainingQuantity attributes of the QueryAck class in the control act wrapper. If the Supplier does not support the Continuation option, in addition to returning only up to the incremental number of records requested, it shall return AE (application error) in the Acknowledgement.typeCode  and AE in the QueryAck.queryResponseCode.

Case 3: The Supplier does not recognize one or more OtherIDsScopingOrganization parameters as representing valid Patient Identity Domains.

AE (application error)  is returned in Acknowledgement.typeCode

AE (application error) is returned in QueryAck.queryResponseCode.

No Registration Event is returned and the queried-for patient identification domains are returned in the QueryByParameter parameter list.

For each domain that was not recognized, an AcknowledgementDetail class is returned in which the attributes typeCode, code, and location are valued as follows:

AttributeValue
typeCodeE
code204 (Unknown Key Identifier)
locationXPath expression for the value element of the OtherIDsScopingOrganization parameter (which includes the repetition number of the parameter)

Here is a Patient Demographics Query request:

<?xml version="1.0" encoding="UTF-8"?> 
<PRPA_IN201305UV02 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="urn:hl7-org:v3 ../../schema/HL7V3/NE2008/multicacheschemas/PRPA_IN201305UV02.xsd" 
 xmlns="urn:hl7-org:v3" 
 ITSVersion="XML_1.0"> 
    <id root="1.2.840.114350.1.13.0.1.7.1.1" extension="35423"/> 
    <creationTime value="20070428150301"/> 
    <interactionId root="2.16.840.1.113883.1.6" extension="PRPA_IN201305UV02"/> 
    <processingCode code="T"/> 
    <processingModeCode code="I"/> 
    <acceptAckCode code="AL"/> 
    <receiver typeCode="RCV"> 
        <device  classCode="DEV" determinerCode="INSTANCE"> 
            <id root="1.2.840.114350.1.13.999.234"/> 
            <telecom value="http://servicelocation/PDQuery"/> 
        </device> 
    </receiver> 
    <sender typeCode="SND"> 
        <device classCode="DEV" determinerCode="INSTANCE"> 
            <id root="1.2.840.114350.1.13.999.567"/> 
        </device> 
    </sender> 
    <controlActProcess  classCode="CACT" moodCode="EVN"> 
        <code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/> 
        <queryByParameter> 
            <queryId root="1.2.840.114350.1.13.28.1.18.5.999" extension="18204"/> 
            <statusCode code="new"/> 
            <initialQuantity value="2"/> 
            <matchCriterionList> 
                <minimumDegreeMatch> 
                    <value xsi:type="INT" value="75"/> 
                    <semanticsText>Degree of match requested</semanticsText> 
                </minimumDegreeMatch> 
            </matchCriterionList> 
            <parameterList> 
                <livingSubjectAdministrativeGender> 
                    <value code="M"/> 
                    <semanticsText>LivingSubject.administrativeGender</semanticsText> 
                </livingSubjectAdministrativeGender> 
                <livingSubjectBirthTime> 
                   <value value="19630804"/> 
                   <semanticsText>LivingSubject..birthTime</semanticsText> 
               </livingSubjectBirthTime> 
                <livingSubjectName> 
                    <value> 
                        <given>Jimmy</given> 
                        <family>Jones</family> 
                    </value> 
                    <semanticsText>LivingSubject.name</semanticsText> 
                </livingSubjectName>               
                <otherIDsScopingOrganization> 
                    <value root="1.2.840.114350.1.13.99997.2.3412"/> 
                    <semanticsText>OtherIDs.scopingOrganization.id</semanticsText> 
                </otherIDsScopingOrganization> 
                <otherIDsScopingOrganization> 
                    <value root="2.16.840.1.113883.4.1"/> 
                    <semanticsText>OtherIDs.scopingOrganization.id</semanticsText> 
                </otherIDsScopingOrganization> 
                <otherIDsScopingOrganization> 
                    <value root="1.2.840.114350.1.13.99998.8734"/> 
                    <semanticsText>OtherIDs.scopingOrganization.id</semanticsText> 
                </otherIDsScopingOrganization> 
            </parameterList> 
        </queryByParameter> 
    </controlActProcess> 
</PRPA_IN201305UV02>

and here is a sample response message:

<?xml version="1.0" encoding="UTF-8"?> 
<PRPA_IN201306UV02 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="urn:hl7-org:v3 ../../schema/HL7V3/NE2008/multicacheschemas/PRPA_IN201306UV02.xsd" 
    xmlns="urn:hl7-org:v3" ITSVersion="XML_1.0"> 
    <id root="1.2.840.114350.1.13.999.238" extension="55789"/> 
    <creationTime value="20070428150302"/> 
    <interactionId root="2.16.840.1.113883.1.6" extension="PRPA_IN201306UV02"/> 
    <processingCode code="T"/> 
    <processingModeCode code="I"/> 
    <acceptAckCode code="NE"/> 
    <receiver typeCode="RCV"> 
        <device classCode="DEV" determinerCode="INSTANCE"> 
            <id root="1.2.840.114350.1.13.999.567"/> 
        </device> 
    </receiver> 
    <sender typeCode="SND"> 
        <device classCode="DEV" determinerCode="INSTANCE"> 
            <id root="1.2.840.114350.1.13.999.234"/> 
            <telecom value="http://servicelocation/PDQuery"/> 
        </device> 
    </sender> 
    <acknowledgement> 
        <typeCode code="AA"/> 
        <targetMessage> 
            <id root="1.2.840.114350.1.13.0.1.7.1.1" extension="35423"/> 
        </targetMessage> 
    </acknowledgement> 
    <controlActProcess classCode="CACT" moodCode="EVN"> 
        <code code="PRPA_TE201306UV02" codeSystem="2.16.840.1.113883.1.6"/> 
        <subject typeCode="SUBJ"> 
            <registrationEvent classCode="REG" moodCode="EVN"> 
                <id nullFlavor="NA"/> 
                <statusCode code="active"/> 
                <subject1 typeCode="SBJ"> 
                    <patient classCode="PAT"> 
                        <id root="1.2.840.114350.1.13.99998.8734" extension="34827K410"/> 
                        <statusCode code="active"/> 
                        <patientPerson> 
                            <name> 
                                <given>James</given> 
                                <family>Jones</family> 
                            </name> 
                            <telecom value="tel:+1-481-555-7684;ext=2342" use="WP"/> 
                            <telecom value="tel:+1-765-555-4352" use="HP"/> 
                            <administrativeGenderCode code="M"/> 
                            <birthTime value="19630804"/> 
                            <addr> 
                                <streetAddressLine>3443 North Arctic Avenue</streetAddressLine> 
                                <city>Some City</city> 
                                <state>IL</state> 
                            </addr> 
                            <asOtherIDs classCode="PAT"> 
                                <id root="1.2.840.114350.1.13.99997.2.3412" extension="38273D433"/> 
                                <scopingOrganization classCode="ORG" determinerCode="INSTANCE"> 
                                    <id root="1.2.840.114350.1.13.99997.2.3412"/> 
                                </scopingOrganization> 
                            </asOtherIDs> 
                            <asOtherIDs classCode="CIT"> 
                                <id root="2.16.840.1.113883.4.1" extension="999-88-6345"/> 
                                <scopingOrganization classCode="ORG" determinerCode="INSTANCE"> 
                                    <id root="2.16.840.1.113883.4.1"/> 
                                </scopingOrganization> 
                            </asOtherIDs> 
                        </patientPerson> 
                        <providerOrganization classCode="ORG" determinerCode="INSTANCE"> 
                            <id root="1.2.840.114350.1.13.99998.8734"/> 
                            <name>Good Health Clinic</name> 
                            <contactParty classCode="CON"> 
                                <telecom value="tel:+1-342-555-8394"/> 
                            </contactParty> 
                        </providerOrganization> 
                        <subjectOf1> 
                            <queryMatchObservation classCode="COND" moodCode="EVN"> 
                                <code code="IHE_PDQ"/> 
                                <value xsi:type="INT" value="92"/> 
                            </queryMatchObservation> 
                        </subjectOf1> 
                    </patient> 
                </subject1> 
                <custodian typeCode="CST"> 
                    <assignedEntity classCode="ASSIGNED"> 
                        <id root="1.2.840.114350.1.13.99998.8734"/> 
                    </assignedEntity> 
                </custodian> 
            </registrationEvent> 
        </subject> 
        <subject typeCode="SUBJ"> 
            <registrationEvent classCode="REG" moodCode="EVN"> 
                <id nullFlavor="NA"/> 
                <statusCode code="active"/> 
                <subject1 typeCode="SBJ"> 
                    <patient classCode="PAT"> 
                        <id root="1.2.840.114350.1.13.99998.8734" extension="34827R534"/> 
                        <statusCode code="active"/> 
                        <patientPerson> 
                            <name> 
                                <given>Jim</given> 
                                <family>Jones</family> 
                            </name> 
                            <telecom value="tel:+1-795-555-4745" use="HP"/> 
                            <administrativeGenderCode code="M"/> 
                            <birthTime value="19630713"/> 
                            <addr> 
                                <streetAddressLine>8734 Blue Ocean Street</streetAddressLine> 
                                <city>Other City</city> 
                                <state>IL</state> 
                            </addr> 
                            <asOtherIDs classCode="CIT"> 
                                <id root="2.16.840.1.113883.4.1" extension="999-89-3300"/> 
                                <scopingOrganization classCode="ORG" determinerCode="INSTANCE"> 
                                    <id root="2.16.840.1.113883.4.1"/> 
                                </scopingOrganization> 
                            </asOtherIDs> 
                        </patientPerson> 
                        <providerOrganization classCode="ORG" determinerCode="INSTANCE"> 
                            <id root="1.2.840.114350.1.13.99998.8734"/> 
                            <name>Good Health Clinic</name> 
                            <contactParty classCode="CON"> 
                                <telecom value="tel:+1-342-555-8394"/> 
                            </contactParty> 
                        </providerOrganization> 
                        <subjectOf1> 
                            <queryMatchObservation classCode="COND" moodCode="EVN"> 
                                <code code="IHE_PDQ"/> 
                                <value xsi:type="INT" value="85"/> 
                            </queryMatchObservation> 
                        </subjectOf1> 
                    </patient> 
                </subject1> 
                <custodian typeCode="CST"> 
                    <assignedEntity classCode="ASSIGNED"> 
                        <id root="1.2.840.114350.1.13.99998.8734"/> 
                    </assignedEntity> 
                </custodian> 
            </registrationEvent> 
        </subject> 
        <queryAck> 
            <queryId root="1.2.840.114350.1.13.28.1.18.5.999" extension="18204"/> 
            <queryResponseCode code="OK"/> 
            <resultTotalQuantity value="5"/> 
            <resultCurrentQuantity value="2"/> 
            <resultRemainingQuantity value="3"/> 
        </queryAck> 
        <queryByParameter> 
            <queryId root="1.2.840.114350.1.13.28.1.18.5.999" extension="18204"/> 
            <statusCode code="new"/> 
            <initialQuantity value="2"/> 
            <parameterList> 
                <livingSubjectAdministrativeGender> 
                    <value code="M"/> 
                    <semanticsText>LivingSubject.administrativeGender</semanticsText> 
                </livingSubjectAdministrativeGender> 
                <livingSubjectBirthTime> 
                    <value value="19630804"/> 
                    <semanticsText>LivingSubject..birthTime</semanticsText> 
                </livingSubjectBirthTime> 
                <livingSubjectName> 
                    <value> 
                        <given>Jimmy</given> 
                        <family>Jones</family> 
                    </value> 
                    <semanticsText>LivingSubject.name</semanticsText> 
                </livingSubjectName> 
                <otherIDsScopingOrganization> 
                    <value root="1.2.840.114350.1.13.99997.2.3412"/> 
                    <semanticsText>OtherIDs.scopingOrganization.id</semanticsText> 
                </otherIDsScopingOrganization> 
                <otherIDsScopingOrganization> 
                    <value root="2.16.840.1.113883.4.1"/> 
                    <semanticsText>OtherIDs.scopingOrganization.id</semanticsText> 
                </otherIDsScopingOrganization> 
                <otherIDsScopingOrganization> 
                    <value root="1.2.840.114350.1.13.99998.8734"/> 
                    <semanticsText>OtherIDs.scopingOrganization.id</semanticsText> 
                </otherIDsScopingOrganization> 
            </parameterList> 
        </queryByParameter> 
    </controlActProcess> 
</PRPA_IN201306UV02>

Patient Demographics Query HL7v3 Continuation

A Consumer uses this trigger event to get another set of matching records to a previously sent Patient Demographics query. The results are returned in the trigger event QUQI_TE000003UV01. An application, in the role of Query Placer, sends a query continuation message to request that the application return up to a specified number of matching records based on a previous demographics query.

Message Semantics

The Query continuation is supported by the Query Control Act Request Continue/Cancel (QUQI_MT000001UV01) message. If the Supplier supports the Continuation Option, it shall respond to the continuation request by sending the Patient Registry Find Candidates Response Message (PRPA_MT201310), which uses the Application Level Acknowledgement transmission wrapper. If a cancellation request is sent by the Consumer, the receiver shall respond by sending an Accept Acknowledgement.

The Query Continuation Message contains no domain payload, it is built from a transmission and control act wrappers. The following is a sample query continuation message:

<?xml version="1.0" encoding="UTF-8"?>
<QUQI_IN000003UV01 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="urn:hl7-org:v3 ../../schema/HL7V3/NE2008/multicacheschemas/QUQI_IN000003UV01.xsd"
	xmlns="urn:hl7-org:v3" ITSVersion="XML_1.0">
	<id root="1.2.840.114350.1.13.0.1.7.1.1" extension="35424" />
	<creationTime value="20070428150303" />
	<interactionId root="2.16.840.1.113883.1.6" extension="QUQI_IN000003UV01" />
	<processingCode code="T" />
	<processingModeCode code="I" />
	<acceptAckCode code="AL" />
	<receiver typeCode="RCV">
		<device classCode="DEV" determinerCode="INSTANCE">
			<id root="1.2.840.114350.1.13.999.234" />
			<telecom value="http://servicelocation/PDQuery" />
		</device>
	</receiver>
	<sender typeCode="SND">
		<device classCode="DEV" determinerCode="INSTANCE">
			<id root="1.2.840.114350.1.13.999.567" />
		</device>
	</sender>
	<controlActProcess classCode="CACT" moodCode="EVN">
		<queryContinuation>
			<queryId root="1.2.840.114350.1.13.28.1.18.5.999" extension="18204" />
			<continuationQuantity value="1" />
			<statusCode code="waitContinuedQueryResponse" />
		</queryContinuation>
	</controlActProcess>
</QUQI_IN000003UV01>

and this is a sample Query Continuation response message from the Supplier:

<?xml version="1.0" encoding="UTF-8"?>
<PRPA_IN201306UV02 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="urn:hl7-org:v3 ../../schema/HL7V3/NE2008/multicacheschemas/PRPA_IN201306UV02.xsd"
	xmlns="urn:hl7-org:v3" ITSVersion="XML_1.0">
	<id root="1.2.840.114350.1.13.999.238" extension="55801" />
	<creationTime value="20070428150304" />
	<interactionId root="2.16.840.1.113883.1.6" extension="PRPA_IN201306UV02" />
	<processingCode code="T" />
	<processingModeCode code="I" />
	<acceptAckCode code="NE" />
	<receiver typeCode="RCV">
		<device classCode="DEV" determinerCode="INSTANCE">
			<id root="1.2.840.114350.1.13.999.567" />
		</device>
	</receiver>
	<sender typeCode="SND">
		<device classCode="DEV" determinerCode="INSTANCE">
			<id root="1.2.840.114350.1.13.999.234" />
			<telecom value="http://servicelocation/PDQuery" />
		</device>
	</sender>
	<acknowledgement>
		<typeCode code="AA" />
		<targetMessage>
			<id root="1.2.840.114350.1.13.0.1.7.1.1" extension="35424" />
		</targetMessage>
	</acknowledgement>
	<controlActProcess classCode="CACT" moodCode="EVN">
		<code code="PRPA_TE201306UV02" codeSystem="2.16.840.1.113883.1.6" />
		<subject typeCode="SUBJ">
			<registrationEvent classCode="REG" moodCode="EVN">
				<id nullFlavor="NA" />
				<statusCode code="active" />
				<subject1 typeCode="SBJ">
					<patient classCode="PAT">
						<id root="1.2.840.114350.1.13.99998.8734" extension="34827R1844" />
						<statusCode code="active" />
						<patientPerson>
							<name>
								<given>Jaimee</given>
								<family>Johns</family>
							</name>
							<telecom value="tel:+1-498-555-7684;ext=2342" use="WP" />
							<administrativeGenderCode code="M" />
							<birthTime value="19650508" />
							<addr>
								<streetAddressLine>3443 West Palm Street</streetAddressLine>
								<city>That Town</city>
								<state>IL</state>
							</addr>
							<asOtherIDs classCode="PAT">
								<id root="1.2.840.114350.1.13.99997.2.3412" extension="38273Q992" />
								<scopingOrganization classCode="ORG"
									determinerCode="INSTANCE">
									<id root="1.2.840.114350.1.13.99997.2.3412" />
								</scopingOrganization>
							</asOtherIDs>
							<asOtherIDs classCode="CIT">
								<id root="2.16.840.1.113883.4.1" extension="999-44-9923" />
								<scopingOrganization classCode="ORG"
									determinerCode="INSTANCE">
									<id root="2.16.840.1.113883.4.1" />
								</scopingOrganization>
							</asOtherIDs>
						</patientPerson>
						<providerOrganization classCode="ORG"
							determinerCode="INSTANCE">
							<id root="1.2.840.114350.1.13.99998.8734" />
							<name>Good Health Clinic</name>
							<contactParty classCode="CON">
								<telecom value="tel:+1-342-555-8394" />
							</contactParty>
						</providerOrganization>
						<subjectOf1>
							<queryMatchObservation classCode="COND"
								moodCode="EVN">
								<code code="IHE_PDQ" />
								<value xsi:type="INT" value="79" />
							</queryMatchObservation>
						</subjectOf1>
					</patient>
				</subject1>
				<custodian typeCode="CST">
					<assignedEntity classCode="ASSIGNED">
						<id root="1.2.840.114350.1.13.99998.8734" />
					</assignedEntity>
				</custodian>
			</registrationEvent>
		</subject>
		<queryAck>
			<queryId root="1.2.840.114350.1.13.28.1.18.5.999" extension="18204" />
			<queryResponseCode code="OK" />
			<resultTotalQuantity value="5" />
			<resultCurrentQuantity value="1" />
			<resultRemainingQuantity value="2" />
		</queryAck>
		<queryByParameter>
			<queryId root="1.2.840.114350.1.13.28.1.18.5.999" extension="18204" />
			<statusCode code="new" />
			<initialQuantity value="2" />
			<parameterList>
				<livingSubjectAdministrativeGender>
					<value code="M" />
					<semanticsText>LivingSubject.administrativeGender</semanticsText>
				</livingSubjectAdministrativeGender>
				<livingSubjectBirthTime>
					<value value="19630804" />
					<semanticsText>LivingSubject..birthTime</semanticsText>
				</livingSubjectBirthTime>
				<livingSubjectName>
					<value>
						<given>Jimmy</given>
						<family>Jones</family>
					</value>
					<semanticsText>LivingSubject.name</semanticsText>
				</livingSubjectName>
				<otherIDsScopingOrganization>
					<value root="1.2.840.114350.1.13.99997.2.3412" />
					<semanticsText>OtherIDs.scopingOrganization.id</semanticsText>
				</otherIDsScopingOrganization>
				<otherIDsScopingOrganization>
					<value root="2.16.840.1.113883.4.1" />
					<semanticsText>OtherIDs.scopingOrganization.id</semanticsText>
				</otherIDsScopingOrganization>
				<otherIDsScopingOrganization>
					<value root="1.2.840.114350.1.13.99998.8734" />
					<semanticsText>OtherIDs.scopingOrganization.id</semanticsText>
				</otherIDsScopingOrganization>
			</parameterList>
		</queryByParameter>
	</controlActProcess>
</PRPA_IN201306UV02>

Expected Actions

If the number of records specified in the initialQuantity of the original quantity, and the Supplier supports the Continuation Option, the Supplier shall return an incremental response of that number of records when the number of matching records it finds exceeds the number of records specified. In subsequent query continuation messages, the Consumer may specify a different number of records to be returned from now on for this query session by populating the continuationQuantity attribute. In addition, the consumer may specify from which record the next set of matches should start by populating the startResultNumber attribute. If the Supplier does not support the Continuation option and the number of matching records to the original query exceed the number specified, then, in addition to returning up to that number of records, the Supplier shall return AE in the Acknowledgement.typeCode and AE in QueryAck.queryResponseCode.

The Supplier should always populate the resultTotalQuantity, resultCurrentQuantity, and resultRemainingQuantity in the QueryAck class.

The Consumer shall indicate a query session cancellation by sending a continuation message, and setting the continuationQuantity attribute to 0, and setting the statusCode to "aborted". The Supplier shall respond with an Accept Acknowledgement. Sending a query cancellation message is optional. The Consumer may simply not send any continuation messages once a record has been selected. How long the Supplier retains query results (for incremental response) is an implementation decision and therefore beyond the scope of HIE.

Here is a sample Query Cancellation message:

<?xml version="1.0" encodin<QUQI_IN000003UV01_Cancel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="urn:hl7-org:v3 ../../schema/HL7V3/NE2008/multicacheschemas/QUQI_IN000003UV01.xsd"
 xmlns="urn:hl7-org:v3"
 ITSVersion="XML_1.0">
    <id root="1.2.840.114350.1.13.0.1.7.1.1" extension="35425"/>
    <creationTime value="20070428150306"/>
    <interactionId root="2.16.840.1.113883.1.6" extension="QUQI_IN000003UV01"/>
    <processingCode code="T"/>
    <processingModeCode code="I"/>
    <acceptAckCode code="AL"/>
    <receiver typeCode="RCV">
        <device classCode="DEV" determinerCode="INSTANCE">
            <id root="1.2.840.114350.1.13.999.234"/>
            <telecom value="http://servicelocation/PDQuery"/>
        </device>
    </receiver>
    <sender typeCode="SND">
        <device  classCode="DEV" determinerCode="INSTANCE">
            <id root="1.2.840.114350.1.13.999.567"/>
        </device>
    </sender>
    <controlActProcess  classCode="CACT" moodCode="EVN">
        <queryContinuation>
            <queryId root="1.2.840.114350.1.13.28.1.18.5.999" extension="18204"/>
            <statusCode code="aborted"/>
        </queryContinuation>
    </controlActProcess>
</QUQI_IN000003UV01_Cancel>

and a sample response to the cancellation request:

<?xml version="1.0" encoding="UTF-8"?>
<MCCI_IN000002UV01 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="urn:hl7-org:v3 ../../schema/HL7V3/NE2008/multicacheschemas/MCCI_IN000002UV01.xsd"
 xmlns="urn:hl7-org:v3"
 ITSVersion="XML_1.0">
    <id root="1.2.840.114350.1.13.999.238" extension="55814"/>
    <creationTime value="20070428150307"/>
    <interactionId root="2.16.840.1.113883.1.6" extension="MCCI_IN000002UV01"/>
    <processingCode code="T"/>
    <processingModeCode code="I"/>
    <acceptAckCode code="NE"/>
    <receiver typeCode="RCV">
        <device classCode="DEV" determinerCode="INSTANCE">
            <id root="1.2.840.114350.1.13.999.567"/>
        </device>
    </receiver>
    <sender typeCode="SND">
        <device classCode="DEV" determinerCode="INSTANCE">
            <id root="1.2.840.114350.1.13.999.234"/>
            <telecom value="http://servicelocation/PDQuery"/>
        </device>
    </sender>
    <acknowledgement>
        <typeCode code="AA"/>
        <targetMessage>
            <id root="1.2.840.114350.1.13.0.1.7.1.1" extension="35425"/>
        </targetMessage>
    </acknowledgement>
</MCCI_IN000002UV01>
Â