AuditDataTransformHelper { public static EventIdentificationType createEventIdentification(final String actionCode, final Integer eventOutcome, final CodedValueType eventId) { final EventIdentificationType eventIdentification = new EventIdentificationType(); eventIdentification.setEventActionCode(actionCode); try { final java.util.GregorianCalendar today = new java.util.GregorianCalendar(TimeZone.getTimeZone("GMT")); final javax.xml.datatype.DatatypeFactory factory = javax.xml.datatype.DatatypeFactory.newInstance(); final javax.xml.datatype.XMLGregorianCalendar calendar = factory.newXMLGregorianCalendar( today.get(java.util.GregorianCalendar.YEAR), today.get(java.util.GregorianCalendar.MONTH) + 1, today.get(java.util.GregorianCalendar.DAY_OF_MONTH), today.get(java.util.GregorianCalendar.HOUR_OF_DAY), today.get(java.util.GregorianCalendar.MINUTE), today.get(java.util.GregorianCalendar.SECOND), today.get(java.util.GregorianCalendar.MILLISECOND), 0); eventIdentification.setEventDateTime(calendar); } catch (DatatypeConfigurationException | ArrayIndexOutOfBoundsException e) { LOG.error("Exception when creating XMLGregorian Date message: {}", e.getLocalizedMessage(), e); } final BigInteger eventOutcomeBig = new BigInteger(eventOutcome.toString()); eventIdentification.setEventOutcomeIndicator(eventOutcomeBig); eventIdentification.setEventID(eventId); return eventIdentification; }  static EventIdentificationType createEventIdentification(final String actionCode, final Integer eventOutcome,
        final CodedValueType eventId); static CodedValueType createEventId(final String eventCode, final String eventCodeSys,
        final String eventCodeSysName, final String dispName); static CodedValueType createCodeValueType(final String code, final String codeSys, final String codeSysName,
        final String dispName); static AuditMessageType.ActiveParticipant createActiveParticipantFromUser(final UserType userInfo,
        final Boolean userIsReq); static AuditMessageType.ActiveParticipant createActiveParticipant(final String userId,
        final String altUserId, final String userName, final Boolean userIsReq); static AuditSourceIdentificationType createAuditSourceIdentificationFromUser(final UserType userInfo); static AuditSourceIdentificationType createAuditSourceIdentification(final String communityId,
        final String communityName); static ParticipantObjectIdentificationType createParticipantObjectIdentification(final String patientId); static ParticipantObjectIdentificationType createDocumentParticipantObjectIdentification(
        final String documentId); static void logAuditMessage(final AuditMessageType message); static ExternalIdentifierType findSingleExternalIdentifier(final List<ExternalIdentifierType> olExtId,
        final String sIdentScheme); static String findSingleExternalIdentifierAndExtractValue(final List<ExternalIdentifierType> olExtId,
        final String sIdentScheme); static String createCompositePatientId(final String assigningAuthId, final String patientId); static String createCompositePatientIdFromAssertion(final UserType userInfo, final String patientId);  }
@Test public void testCreateEventIdentification() { String actionCode = AuditDataTransformConstants.EVENT_ACTION_CODE_CREATE; Integer eventOutcome = AuditDataTransformConstants.EVENT_OUTCOME_INDICATOR_SUCCESS; CodedValueType eventId = new CodedValueType(); eventId.setCodeSystem(AuditDataTransformConstants.EVENT_ID_CODE_SYS_NAME_ACK); eventId.setDisplayName(AuditDataTransformConstants.EVENT_ID_DISPLAY_NAME_ENTITY_SD); EventIdentificationType expResult = new EventIdentificationType(); expResult.setEventID(eventId); expResult.setEventActionCode(actionCode); EventIdentificationType result = AuditDataTransformHelper.createEventIdentification(actionCode, eventOutcome, eventId); assertSame(expResult.getEventID(), result.getEventID()); assertSame(expResult.getEventActionCode(), result.getEventActionCode()); }