code: protected void auditProvideAndRegisterEvent (
  			IHETransactionEventTypeCodes transaction, 
  			RFC3881EventOutcomeCodes eventOutcome,
  			String sourceUserId, String sourceIpAddress,
              String userName,
  			String repositoryEndpointUri,
  			String submissionSetUniqueId,
  			String patientId,
              List<CodedValueType> purposesOfUse,
  			List<CodedValueType> userRoles)
  	{
  		ImportEvent importEvent = new ImportEvent(false, eventOutcome, transaction, purposesOfUse);
  		importEvent.setAuditSourceId(getAuditSourceId(), getAuditEnterpriseSiteId());
  		importEvent.addSourceActiveParticipant(sourceUserId, null, null, sourceIpAddress, true);
          if (!EventUtils.isEmptyOrNull(userName)) {
              importEvent.addHumanRequestorActiveParticipant(userName, null, userName, userRoles);
          }
  		importEvent.addDestinationActiveParticipant(repositoryEndpointUri, getSystemAltUserId(), null, EventUtils.getAddressForUrl(repositoryEndpointUri, false), false);
  		if (!EventUtils.isEmptyOrNull(patientId)) {
  			importEvent.addPatientParticipantObject(patientId);
  		}
  		importEvent.addSubmissionSetParticipantObject(submissionSetUniqueId);		
  		
  		audit(importEvent);
  	}
docs: Generically sends audit messages for XDS Document Repository Provide And Register Document Set events
  
  @param transaction The specific IHE Transaction (ITI-15 or ITI-41)
  @param eventOutcome The event outcome indicator
  @param sourceUserId The Active Participant UserID for the document consumer (if using WS-Addressing)
  @param sourceIpAddress The IP address of the document source that initiated the transaction
  @param repositoryEndpointUri The Web service endpoint URI for this document repository
  @param submissionSetUniqueId The UniqueID of the Submission Set registered
  @param patientId The Patient Id that this submission pertains to
  @param purposesOfUse purpose of use codes (may be taken from XUA token)
  @param userRoles roles of the human user (may be taken from XUA token)