public void auditXCPDQueryEvent(RFC3881EventOutcomeCodes eventOutcome, String sourceUserId,
			String humanRequestorUserId, CodedValueType humanRequestorRoleIdCode,
			String XCPDRGUri, String homeCommunityId, String queryByParameter,
            List<CodedValueType> purposesOfUse)
	{
		if (!isAuditorEnabled()) {
			return;
		}
		QueryEvent queryEvent = new QueryEvent(true, eventOutcome,
				new IHETransactionEventTypeCodes.CrossGatewayPatientDiscovery(), purposesOfUse);
		
		// Add the source active participant
		queryEvent.addSourceActiveParticipant(sourceUserId, getSystemAltUserId(), getSystemUserName(), getSystemNetworkId(), true);
		
		// if human requestor is not specified, try getting it from configuration
		if (EventUtils.isEmptyOrNull(humanRequestorUserId)){
			humanRequestorUserId = getHumanRequestor();
		}
		if (!EventUtils.isEmptyOrNull(humanRequestorUserId)){
			queryEvent.addHumanRequestorActiveParticipant(humanRequestorUserId, null, null, humanRequestorRoleIdCode);
		}
		
		// Set the destination active participant
		queryEvent.addDestinationActiveParticipant(XCPDRGUri, null, null, EventUtils.getAddressForUrl(XCPDRGUri, false), false);
		
		// set the audit source
		queryEvent.setAuditSourceId(getAuditSourceId(), getAuditEnterpriseSiteId());
				
		// add query parameters participant object
		byte[] queryByParameterBytes = null;
		if (queryByParameter != null) {
			try {
				queryByParameterBytes = queryByParameter.getBytes("UTF-8");
			} catch (UnsupportedEncodingException e) {
				LOGGER.error("could not use UTF-8 encoding due to it being unsupported on this system, using system default which may cause problems downstream", e);
				queryByParameterBytes = queryByParameter.getBytes();
			}
		}
		queryEvent.addQueryParticipantObject(null, homeCommunityId, queryByParameterBytes, null,
                new IHETransactionEventTypeCodes.CrossGatewayQuery());
		
		audit(queryEvent);
	}
public void auditXCPDQueryEvent ( RFC3881EventOutcomeCodes eventOutcome , String sourceUserId , String humanRequestorUserId , CodedValueType humanRequestorRoleIdCode , String XCPDRGUri , String homeCommunityId , String queryByParameter , List < CodedValueType > purposesOfUse ) { if ( ! isAuditorEnabled ( ) ) { return ; } QueryEvent queryEvent = new QueryEvent ( true , eventOutcome , new IHETransactionEventTypeCodes . CrossGatewayPatientDiscovery ( ) , purposesOfUse ) ; queryEvent . addSourceActiveParticipant ( sourceUserId , getSystemAltUserId ( ) , getSystemUserName ( ) , getSystemNetworkId ( ) , true ) ; if ( EventUtils . isEmptyOrNull ( humanRequestorUserId ) ) { humanRequestorUserId = getHumanRequestor ( ) ; } if ( ! EventUtils . isEmptyOrNull ( humanRequestorUserId ) ) { queryEvent . addHumanRequestorActiveParticipant ( humanRequestorUserId , null , null , humanRequestorRoleIdCode ) ; } queryEvent . addDestinationActiveParticipant ( XCPDRGUri , null , null , EventUtils . getAddressForUrl ( XCPDRGUri , false ) , false ) ; queryEvent . setAuditSourceId ( getAuditSourceId ( ) , getAuditEnterpriseSiteId ( ) ) ; byte [ ] queryByParameterBytes = null ; if ( queryByParameter != null ) { try { queryByParameterBytes = queryByParameter . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { LOGGER . error ( "could not use UTF-8 encoding due to it being unsupported on this system, using system default which may cause problems downstream" , e ) ; queryByParameterBytes = queryByParameter . getBytes ( ) ; } } queryEvent . addQueryParticipantObject ( null , homeCommunityId , queryByParameterBytes , null , new IHETransactionEventTypeCodes . CrossGatewayQuery ( ) ) ; audit ( queryEvent ) ; }
Audits an ITI-55 Cross Gateway Patient Discovery event for
XCPD Initiating Gateway actors.

@param eventOutcome The event outcome indicator
@param sourceUserId The user id of the source system calling the XCPD IG
@param humanRequestorUserId Human requestor if known, null is ok here
@param humanRequestorRoleIdCode CVT type to define the roll that gives this user access
@param XCPDRGUri The URI of the XCPD Responding Gateway being accessed
@param homeCommunityId the home community id of the source system (the caller, not the callee)
@param queryByParameter a String containing the XML of the queryByParameter portion of the call