protected Element eventIdentification(EventIdentificationType eventIdentification) { Element element = new Element("EventIdentification"); if (eventIdentification != null) { element.setAttribute("EventActionCode", eventIdentification.getEventActionCode().getValue()); element.setAttribute("EventDateTime", eventIdentification.getEventDateTime().toString()); element.setAttribute("EventOutcomeIndicator", eventIdentification.getEventOutcomeIndicator().getValue().toString()); if (eventIdentification.getEventID() != null) { element.addContent(codedValueType("EventID", eventIdentification.getEventID())); } eventIdentification.getEventTypeCode().stream() .map(eventTypeCode -> codedValueType("EventTypeCode", eventTypeCode)) .forEach(element::addContent); if (eventIdentification.getEventOutcomeDescription() != null) { element.addContent( new Element("EventOutcomeDescription") .addContent(eventIdentification.getEventOutcomeDescription())); } eventIdentification.getPurposesOfUse().stream() .map(purposeOfUse -> codedValueType("PurposeOfUse", purposeOfUse)) .forEach(element::addContent); } return element; }
/** * Create and set an Event Identification block for this audit event message * * @param outcome The Event Outcome Indicator * @param action The Event Action Code * @param id The Event ID * @param type The Event Type Code * @return this */ 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(); }
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Create, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Export, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobileDocumentRetrieval, event.getEventIdentification().getEventTypeCode().get(0));
boolean serverSide, boolean requiresPatient) { assertEquals(eventOutcomeIndicator, auditMessage.getEventIdentification().getEventOutcomeIndicator()); assertEquals(eventActionCode, auditMessage.getEventIdentification().getEventActionCode()); assertEquals(eventId, auditMessage.getEventIdentification().getEventID());
@Test public void testRetrieveDocument() { try { getProducerTemplate().requestBody("direct:input", null, byte[].class); fail(); } catch (CamelExecutionException e) { assertTrue(e.getCause() instanceof HttpOperationFailedException); // Check ATNA Audit AbstractMockedAuditMessageQueue sender = getAuditSender(); assertEquals(1, sender.getMessages().size()); AuditMessage event = sender.getMessages().get(0); assertEquals( EventOutcomeIndicator.MajorFailure, event.getEventIdentification().getEventOutcomeIndicator()); } }
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobilePatientIdentifierCrossReferenceQuery, event.getEventIdentification().getEventTypeCode().get(0));
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobilePatientIdentifierCrossReferenceQuery, event.getEventIdentification().getEventTypeCode().get(0));
protected AuditEvent translate(AuditMessage auditMessage) { EventIdentificationType eit = auditMessage.getEventIdentification(); AuditEvent auditEvent = new AuditEvent() .setType(codedValueTypeToCoding(eit.getEventID())) .setAction(getAuditEventAction(eit.getEventActionCode())) .setRecorded(Date.from(eit.getEventDateTime())) .setOutcome(getAuditEventOutcome(eit.getEventOutcomeIndicator())) .setOutcomeDesc(eit.getEventOutcomeDescription()); eit.getEventTypeCode().forEach(etc -> auditEvent.addSubtype(codedValueTypeToCoding(etc))); eit.getPurposesOfUse().forEach(pou -> auditEvent.addPurposeOfEvent(codedValueTypeToCodeableConcept(pou))); auditMessage.getActiveParticipants().forEach(ap -> auditEvent.addAgent(activeParticipantToAgent(ap))); auditEvent.setSource(auditSourceIdentificationToEventSource(auditMessage.getAuditSourceIdentification())); auditMessage.getParticipantObjectIdentifications().forEach(poit -> auditEvent.addEntity(participantObjectIdentificationToEntity(poit))); return auditEvent; }
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Create, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Import, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.ProvideDocumentBundle, event.getEventIdentification().getEventTypeCode().get(0));
protected AuditEvent translate(AuditMessage auditMessage) { EventIdentificationType eit = auditMessage.getEventIdentification(); AuditEvent auditEvent = new AuditEvent() .setType(codedValueTypeToCoding(eit.getEventID())) .setAction(getAuditEventAction(eit.getEventActionCode())) .setRecorded(Date.from(eit.getEventDateTime())) .setOutcome(getAuditEventOutcome(eit.getEventOutcomeIndicator())) .setOutcomeDesc(eit.getEventOutcomeDescription()); eit.getEventTypeCode().forEach(etc -> auditEvent.addSubtype(codedValueTypeToCoding(etc))); eit.getPurposesOfUse().forEach(pou -> auditEvent.addPurposeOfEvent(codedValueTypeToCodeableConcept(pou))); auditMessage.getActiveParticipants().forEach(ap -> auditEvent.addAgent(activeParticipantToAgent(ap))); auditEvent.setSource(auditSourceIdentificationToEventSource(auditMessage.getAuditSourceIdentification())); auditMessage.getParticipantObjectIdentifications().forEach(poit -> auditEvent.addEntity(participantObjectIdentificationToEntity(poit))); return auditEvent; }
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Create, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Import, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.ProvideDocumentBundle, event.getEventIdentification().getEventTypeCode().get(0));
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobilePatientDemographicsQuery, event.getEventIdentification().getEventTypeCode().get(0));
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobilePatientDemographicsQuery, event.getEventIdentification().getEventTypeCode().get(0));
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobileDocumentReferenceQuery, event.getEventIdentification().getEventTypeCode().get(0));
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobileDocumentReferenceQuery, event.getEventIdentification().getEventTypeCode().get(0));
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobileDocumentManifestQuery, event.getEventIdentification().getEventTypeCode().get(0));
event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( EventActionCode.Execute, event.getEventIdentification().getEventActionCode()); assertEquals(EventIdCode.Query, event.getEventIdentification().getEventID()); assertEquals(FhirEventTypeCode.MobileDocumentManifestQuery, event.getEventIdentification().getEventTypeCode().get(0));