public T setEventIdentification(EventOutcomeIndicator outcome,
String eventOutcomeDescription,
EventActionCode action,
EventId id,
EventType type,
Collection<PurposeOfUse> purposesOfUse) {
EventIdentificationType eventIdentification = new EventIdentificationType(id, Instant.now(), outcome);
eventIdentification.setEventActionCode(action);
eventIdentification.setEventOutcomeDescription(eventOutcomeDescription);
if (type != null) {
eventIdentification.getEventTypeCode().add(type);
}
if (purposesOfUse != null) {
purposesOfUse.stream()
.filter(Objects::nonNull)
.forEach(pou -> eventIdentification.getPurposesOfUse().add(pou));
}
auditMessage.setEventIdentification(eventIdentification);
return self();
}