org.eclipse.ohf.ihe.pdq.consumer
Class PdqConsumerQuery

java.lang.Object
  extended by org.eclipse.ohf.hl7v2.core.utilities.Worker
      extended by org.eclipse.ohf.hl7v2.core.message.model.Item
          extended by org.eclipse.ohf.hl7v2.core.message.model.ModelProvider
              extended by org.eclipse.ohf.hl7v2.core.message.model.Message
                  extended by org.eclipse.ohf.ihe.common.hl7v2.message.PixPdqMessage
                      extended by org.eclipse.ohf.ihe.pdq.consumer.PdqConsumerQuery
All Implemented Interfaces:
HL7_Constants

public class PdqConsumerQuery
extends PixPdqMessage

QBP^Q22 Patient Demographics Query

IHE HL7 Segments: MSH,QPD,RCP
IHE HL7 Standard: HL7 2.5

Author:
Sondra Renly

Field Summary
static int MAX_PATIENTS_RETURNED
          IHE PDQ Quantity Limit Introduced to prevent exceeding max audit message size
static java.lang.String MSH_9_1_PDQ
          IHE PDQ Message Type
static java.lang.String MSH_9_2_PDQ
           
static java.lang.String MSH_9_3_PDQ
           
static java.lang.String QPD_1_1_PDQ
          IHE PDQ Query Tag
static java.lang.String QPD_1_2_PDQ
           
static java.lang.String QPD_1_3_PDQ
           
 
Fields inherited from class org.eclipse.ohf.hl7v2.core.message.model.Item
NODE_TYPE_COMPONENT, NODE_TYPE_CONTENT, NODE_TYPE_FIELD, NODE_TYPE_LIST, NODE_TYPE_MESSAGE, NODE_TYPE_SEGMENT, NODE_TYPE_SUBCOMPONENT
 
Fields inherited from class org.eclipse.ohf.hl7v2.core.utilities.Worker
hecAccepted, hecApplicationError, hecBadField, hecBadMessage, hecBadSegCode, hecConformance, hecDataTypeError, hecDefinitionError, hecDuplicateKey, hecDuplicateMsgId, hecHL7LibraryError, hecInternalError, hecNoDefinitions, hecNoTableValue, hecRecordLocked, hecRequiredField, hecRequiredSeg, hecSequenceError, hecSuperfluousSeg, hecUnknownKey, hecUnsEvntCode, hecUnsMsgType, hecUnsProcID, hecUnsVersion, hecValidationFailed, hecXML
 
Fields inherited from interface org.eclipse.ohf.ihe.common.hl7v2.message.HL7_Constants
DSC, DSC_1, DSC_2, ERR, EVN, EVN_2_1, MRG, MRG_1_1, MRG_1_4_1, MRG_1_4_2, MRG_1_4_3, MSA, MSH, MSH_10, MSH_11_1, MSH_11_1_PRODUCTION, MSH_12, MSH_18_1, MSH_18_1_ASCII, MSH_3_1, MSH_3_1_DEFAULT, MSH_3_2, MSH_3_3, MSH_4_1, MSH_4_1_DEFAULT, MSH_4_2, MSH_4_3, MSH_5_1, MSH_5_1_DEFAULT, MSH_5_2, MSH_5_3, MSH_6_1, MSH_6_1_DEFAULT, MSH_6_2, MSH_6_3, MSH_7, PD1, PID, PID_11_1, PID_11_10, PID_11_2, PID_11_3, PID_11_4, PID_11_5, PID_11_6, PID_11_7, PID_11_8, PID_11_9, PID_13_1, PID_14_1, PID_18_1, PID_18_4_1, PID_18_4_2, PID_18_4_3, PID_3_1, PID_3_4_1, PID_3_4_1_DEFAULT, PID_3_4_2, PID_3_4_2_DEFAULT, PID_3_4_3, PID_3_4_3_DEFAULT, PID_5_1, PID_5_2, PID_5_3, PID_5_4, PID_5_5, PID_5_6, PID_7_1, PID_8, PV1, PV1_2, PV1_2_INPATIENT, PV1_2_OUTPATIENT, QAK, QPD, QPD_1_1, QPD_1_2, QPD_1_3, QPD_1_4, QPD_1_5, QPD_1_6, QPD_2, QPD_3_1, QPD_3_4_1, QPD_3_4_2, QPD_3_4_3, QPD_8_4_1, QPD_8_4_2, QPD_8_4_3, RCP, RCP_1, RCP_1_IMMEDIATE, RCP_2_1, RCP_2_2_1, RCP_2_2_1_RECORDS
 
Constructor Summary
PdqConsumerQuery(org.eclipse.ohf.hl7v2.core.message.MessageManager globalFactory, org.eclipse.ohf.hl7v2.core.conformance.model.CPConformanceProfile cpProfile)
          Constructs a PDQ "QBP_Q22" message object.
 
Method Summary
 void addOptionalContinuationPointer(PdqConsumerResponse response)
          DSC Segment Copy Forward If more patients are on the server, a DSC segment will be included in the response for retrieving additional patients.
 void addOptionalDemographicSearch(java.lang.String path, java.lang.String data)
          Generic demographic search query.
 void addOptionalQuantityLimit(int quantity)
          RCP-2 Quantity Limited Request Limits the max number of patients returned in the response.
 void addQueryPatientAccountNumberId(java.lang.String accountNumberId, java.lang.String namespaceId, java.lang.String universalId, java.lang.String universalIdType)
          PID-18 Account Number ID
 void addQueryPatientAddressCensusTract(java.lang.String censusTract)
          PID-11-10 Patient Address - Census Tract
 void addQueryPatientAddressCity(java.lang.String city)
          PID-11-3 Patient Address - City
 void addQueryPatientAddressCountry(java.lang.String country)
          PID-11-6 Patient Address - Country
 void addQueryPatientAddressCountyParishCode(java.lang.String countyParishCode)
          PID-11-9 Patient Address - County or Parish Code
 void addQueryPatientAddressOtherDesignation(java.lang.String address)
          PID-11-2 Patient Address - Other Designation
 void addQueryPatientAddressOtherGeographicDesignation(java.lang.String otherDesignation)
          PID-11-8 Patient Address - Other Designation
 void addQueryPatientAddressStateOrProvince(java.lang.String stateOrProvince)
          PID-11-4 Patient Address - State or Province
 void addQueryPatientAddressStreetAddress(java.lang.String address)
          PID-11-1 Patient Address - Street Address
 void addQueryPatientAddressType(java.lang.String type)
          PID-11-7 Patient Address - Address Type
 void addQueryPatientAddressZipOrPostalCode(java.lang.String zipOrPostalCode)
          PID-11-5 Patient Address - Zip or Postal Code
 void addQueryPatientDateOfBirth(java.lang.String dob)
          PID-7 Date/Time of Birth
 void addQueryPatientID(java.lang.String idNumber, java.lang.String namespaceId, java.lang.String universalId, java.lang.String universalIdType)
          PID-3 Patient ID (internal)
 void addQueryPatientNameDegree(java.lang.String degree)
          PID-5-6 Patient Name - Degree
 void addQueryPatientNameFamilyName(java.lang.String familyName)
          PID-5-1 Patient Name - Family Name
 void addQueryPatientNameGivenName(java.lang.String givenName)
          PID-5-2 Patient Name - Given Name
 void addQueryPatientNameOtherName(java.lang.String otherName)
          PID-5-3 Patient Name - Other Name
 void addQueryPatientNamePrefix(java.lang.String prefix)
          PID-5-5 Patient Name - Prefix
 void addQueryPatientNameSuffix(java.lang.String suffix)
          PID-5-4 Patient Name - Suffix
 void addQueryPatientPhoneBusinessUnformattedTelephoneNumber(java.lang.String businessPhone)
          PID-14-1 Business Phone Unformatted
 void addQueryPatientPhoneHomeUnformattedTelephoneNumber(java.lang.String homePhone)
          PID-13-1 Home Phone Unformatted
 void addQueryPatientSex(java.lang.String sex)
          PID-8 Administrative Sex
 void changeDefaultMessageQueryName(java.lang.String identifier, java.lang.String text, java.lang.String codingSystem, java.lang.String alternateIdentifier, java.lang.String alternateText, java.lang.String alternateCodingSystem)
          QPD-1 Message Query Name Query name for this message.
 void changeDefaultQueryTag(java.lang.String tag)
          QPD-2 Query Tag The initiating system's value to identify the query.
 void changeDefaultWhatDomainsReturned(java.lang.String namespaceId, java.lang.String universalId, java.lang.String universalIdType)
          QPD-8 What Domains Returned The domain restriction for this message query.
 
Methods inherited from class org.eclipse.ohf.ihe.common.hl7v2.message.PixPdqMessage
changeDefaultCharacterSet, changeDefaultControlId, changeDefaultProcessEnvironment, changeDefaultReceivingApplication, changeDefaultRecievingFacility, changeDefaultSendingApplication, changeDefaultSendingFacility, getCharacterSet, getMessageControlID, getProcessEnvironment, getReceivingApplication, getReceivingFacility, getSendingApplication, getSendingFacility, setField, setNonNullElement
 
Methods inherited from class org.eclipse.ohf.hl7v2.core.message.model.Message
addMSHFromFields, addMSHFromFields, bindToMSH, clear, clearContent, elementName, forceElement, getDefaultFormat, getDelimiters, getElement, getEvent, getMessageId, getMessageType, getSegments, getStructId, getStructure, hasStructId, matches, resolveVariableTypes, setDefaultFormat, setDelimiters, setEvent, setMessageId, setMessageType, setStructId, testIsElement
 
Methods inherited from class org.eclipse.ohf.hl7v2.core.message.model.ModelProvider
getDefinitions, getVersion, getVersionDefinition, setDefinitions, setVersion
 
Methods inherited from class org.eclipse.ohf.hl7v2.core.message.model.Item
getOwner, getType, getUserData, hasOwner, isElement, setOwner, setUserData
 
Methods inherited from class org.eclipse.ohf.hl7v2.core.utilities.Worker
condition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSH_9_1_PDQ

public static final java.lang.String MSH_9_1_PDQ
IHE PDQ Message Type

See Also:
Constant Field Values

MSH_9_2_PDQ

public static final java.lang.String MSH_9_2_PDQ
See Also:
Constant Field Values

MSH_9_3_PDQ

public static final java.lang.String MSH_9_3_PDQ
See Also:
Constant Field Values

QPD_1_1_PDQ

public static final java.lang.String QPD_1_1_PDQ
IHE PDQ Query Tag

See Also:
Constant Field Values

QPD_1_2_PDQ

public static final java.lang.String QPD_1_2_PDQ
See Also:
Constant Field Values

QPD_1_3_PDQ

public static final java.lang.String QPD_1_3_PDQ
See Also:
Constant Field Values

MAX_PATIENTS_RETURNED

public static final int MAX_PATIENTS_RETURNED
IHE PDQ Quantity Limit Introduced to prevent exceeding max audit message size

See Also:
Constant Field Values
Constructor Detail

PdqConsumerQuery

public PdqConsumerQuery(org.eclipse.ohf.hl7v2.core.message.MessageManager globalFactory,
                        org.eclipse.ohf.hl7v2.core.conformance.model.CPConformanceProfile cpProfile)
                 throws PdqConsumerException
Constructs a PDQ "QBP_Q22" message object. INTERNAL CONSTRUCTOR ONLY - use PdqConsumer.createQuery();

Parameters:
globalFactory - - message manager from hl7v2.core
cpProfile - - conformance profile for validation
Throws:
PdqConsumerException
Method Detail

changeDefaultMessageQueryName

public void changeDefaultMessageQueryName(java.lang.String identifier,
                                          java.lang.String text,
                                          java.lang.String codingSystem,
                                          java.lang.String alternateIdentifier,
                                          java.lang.String alternateText,
                                          java.lang.String alternateCodingSystem)
                                   throws PdqConsumerException
QPD-1 Message Query Name Query name for this message. The default is Q22^Find Candidates^HL7 (ie identifier^text^codingSystem).

Parameters:
identifier -
text -
codingSystem -
alternateIdentifier -
alternateText -
alternateCodingSystem -
Throws:
PdqConsumerException

changeDefaultQueryTag

public void changeDefaultQueryTag(java.lang.String tag)
                           throws PdqConsumerException
QPD-2 Query Tag The initiating system's value to identify the query. The default is a random generated ID.

Parameters:
tag -
Throws:
PdqConsumerException

changeDefaultWhatDomainsReturned

public void changeDefaultWhatDomainsReturned(java.lang.String namespaceId,
                                             java.lang.String universalId,
                                             java.lang.String universalIdType)
                                      throws PdqConsumerException
QPD-8 What Domains Returned The domain restriction for this message query. The default is empty, all domains returned.

Parameters:
namespaceId - (assigningAuthority > namespaceId)
universalId - (assigningAuthority > universalId)
universalIdType - (assigningAuthority > universalIdType)
Throws:
PdqConsumerException

addQueryPatientID

public void addQueryPatientID(java.lang.String idNumber,
                              java.lang.String namespaceId,
                              java.lang.String universalId,
                              java.lang.String universalIdType)
                       throws PdqConsumerException
PID-3 Patient ID (internal)

Parameters:
idNumber -
namespaceId - (assigningAuthority > namespaceId)
universalId - (assigningAuthority > universalId)
universalIdType - (assigningAuthority > universalIdType)
Throws:
PdqConsumerException

addQueryPatientNameFamilyName

public void addQueryPatientNameFamilyName(java.lang.String familyName)
                                   throws PdqConsumerException
PID-5-1 Patient Name - Family Name

Parameters:
familyName -
Throws:
PdqConsumerException

addQueryPatientNameGivenName

public void addQueryPatientNameGivenName(java.lang.String givenName)
                                  throws PdqConsumerException
PID-5-2 Patient Name - Given Name

Parameters:
givenName -
Throws:
PdqConsumerException

addQueryPatientNameOtherName

public void addQueryPatientNameOtherName(java.lang.String otherName)
                                  throws PdqConsumerException
PID-5-3 Patient Name - Other Name

Parameters:
otherName -
Throws:
PdqConsumerException

addQueryPatientNameSuffix

public void addQueryPatientNameSuffix(java.lang.String suffix)
                               throws PdqConsumerException
PID-5-4 Patient Name - Suffix

Parameters:
suffix -
Throws:
PdqConsumerException

addQueryPatientNamePrefix

public void addQueryPatientNamePrefix(java.lang.String prefix)
                               throws PdqConsumerException
PID-5-5 Patient Name - Prefix

Parameters:
prefix -
Throws:
PdqConsumerException

addQueryPatientNameDegree

public void addQueryPatientNameDegree(java.lang.String degree)
                               throws PdqConsumerException
PID-5-6 Patient Name - Degree

Parameters:
degree -
Throws:
PdqConsumerException

addQueryPatientDateOfBirth

public void addQueryPatientDateOfBirth(java.lang.String dob)
                                throws PdqConsumerException
PID-7 Date/Time of Birth

Parameters:
dob -
Throws:
PdqConsumerException

addQueryPatientSex

public void addQueryPatientSex(java.lang.String sex)
                        throws PdqConsumerException
PID-8 Administrative Sex

Parameters:
sex -
Throws:
PdqConsumerException

addQueryPatientAddressStreetAddress

public void addQueryPatientAddressStreetAddress(java.lang.String address)
                                         throws PdqConsumerException
PID-11-1 Patient Address - Street Address

Parameters:
address -
Throws:
PdqConsumerException

addQueryPatientAddressOtherDesignation

public void addQueryPatientAddressOtherDesignation(java.lang.String address)
                                            throws PdqConsumerException
PID-11-2 Patient Address - Other Designation

Parameters:
address -
Throws:
PdqConsumerException

addQueryPatientAddressCity

public void addQueryPatientAddressCity(java.lang.String city)
                                throws PdqConsumerException
PID-11-3 Patient Address - City

Parameters:
city -
Throws:
PdqConsumerException

addQueryPatientAddressStateOrProvince

public void addQueryPatientAddressStateOrProvince(java.lang.String stateOrProvince)
                                           throws PdqConsumerException
PID-11-4 Patient Address - State or Province

Parameters:
stateOrProvince -
Throws:
PdqConsumerException

addQueryPatientAddressZipOrPostalCode

public void addQueryPatientAddressZipOrPostalCode(java.lang.String zipOrPostalCode)
                                           throws PdqConsumerException
PID-11-5 Patient Address - Zip or Postal Code

Parameters:
zipOrPostalCode -
Throws:
PdqConsumerException

addQueryPatientAddressCountry

public void addQueryPatientAddressCountry(java.lang.String country)
                                   throws PdqConsumerException
PID-11-6 Patient Address - Country

Parameters:
country -
Throws:
PdqConsumerException

addQueryPatientAddressType

public void addQueryPatientAddressType(java.lang.String type)
                                throws PdqConsumerException
PID-11-7 Patient Address - Address Type

Parameters:
type -
Throws:
PdqConsumerException

addQueryPatientAddressOtherGeographicDesignation

public void addQueryPatientAddressOtherGeographicDesignation(java.lang.String otherDesignation)
                                                      throws PdqConsumerException
PID-11-8 Patient Address - Other Designation

Parameters:
otherDesignation -
Throws:
PdqConsumerException

addQueryPatientAddressCountyParishCode

public void addQueryPatientAddressCountyParishCode(java.lang.String countyParishCode)
                                            throws PdqConsumerException
PID-11-9 Patient Address - County or Parish Code

Parameters:
countyParishCode -
Throws:
PdqConsumerException

addQueryPatientAddressCensusTract

public void addQueryPatientAddressCensusTract(java.lang.String censusTract)
                                       throws PdqConsumerException
PID-11-10 Patient Address - Census Tract

Parameters:
censusTract -
Throws:
PdqConsumerException

addQueryPatientPhoneHomeUnformattedTelephoneNumber

public void addQueryPatientPhoneHomeUnformattedTelephoneNumber(java.lang.String homePhone)
                                                        throws PdqConsumerException
PID-13-1 Home Phone Unformatted

Parameters:
homePhone -
Throws:
PdqConsumerException

addQueryPatientPhoneBusinessUnformattedTelephoneNumber

public void addQueryPatientPhoneBusinessUnformattedTelephoneNumber(java.lang.String businessPhone)
                                                            throws PdqConsumerException
PID-14-1 Business Phone Unformatted

Parameters:
businessPhone -
Throws:
PdqConsumerException

addQueryPatientAccountNumberId

public void addQueryPatientAccountNumberId(java.lang.String accountNumberId,
                                           java.lang.String namespaceId,
                                           java.lang.String universalId,
                                           java.lang.String universalIdType)
                                    throws PdqConsumerException
PID-18 Account Number ID

Parameters:
accountNumberId -
namespaceId - (assigningAuthority > namespaceId)
universalId - (assigningAuthority > universalId)
universalIdType - (assigningAuthority > universalIdType)
Throws:
PdqConsumerException

addOptionalDemographicSearch

public void addOptionalDemographicSearch(java.lang.String path,
                                         java.lang.String data)
                                  throws PdqConsumerException
Generic demographic search query.

Parameters:
path - - segment-field (ex PID-3-1 or PID-5-1)
data - - value for field, do not include any component/subcomponent delimiters, enter each value individually
Throws:
PdqConsumerException

addOptionalQuantityLimit

public void addOptionalQuantityLimit(int quantity)
                              throws PdqConsumerException
RCP-2 Quantity Limited Request Limits the max number of patients returned in the response. If more patients are on the server, a DSC segment will be included in the response for retrieving the additional patients.

Parameters:
quantity -
Throws:
PdqConsumerException

addOptionalContinuationPointer

public void addOptionalContinuationPointer(PdqConsumerResponse response)
                                    throws PdqConsumerException
DSC Segment Copy Forward If more patients are on the server, a DSC segment will be included in the response for retrieving additional patients. Copy this forward to subsequent query messages to get all remaining patients. Example: PdqConsumerQuery msg = pdqQuery.createQuery(); response = pdqQuery.sendQuery(msg, true, auditUser); while (response.getContinuationPointer() != null) { msg.addOptionalContinuationPointer(response); response = pdqQuery.sendQuery(msg, true, auditUser); readReturn(response); }

Parameters:
response -
Throws:
PdqConsumerException