public List<ParticipantObjectIdentificationType> findParticipantObjectIdentifications(Predicate<ParticipantObjectIdentificationType> selector) { return getParticipantObjectIdentifications().stream() .filter(selector) .collect(Collectors.toList()); }
public T addParticipantObjectIdentification(ParticipantObjectIdentificationType poit) { auditMessage.getParticipantObjectIdentifications().add(poit); return self(); }
private void serialize(AuditMessage auditMessage, Writer writer, XMLOutputter outputter) throws IOException { Element element = new Element("AuditMessage"); element.addContent(eventIdentification(auditMessage.getEventIdentification())); auditMessage.getActiveParticipants().stream() .map(this::activeParticipant) .forEach(element::addContent); element.addContent(auditSourceIdentification(auditMessage.getAuditSourceIdentification())); auditMessage.getParticipantObjectIdentifications().stream() .map(this::participantObjectIdentification) .forEach(element::addContent); outputter.output(new Document(element), writer); }
private void testRequest(boolean serverSide, Iti59AuditStrategy strategy) { Iti59AuditDataset auditDataset = getHpdAuditDataset(strategy); AuditMessage[] auditMessages = makeAuditMessages(strategy, auditContext, auditDataset); assertEquals(3, auditMessages.length); for (AuditMessage auditMessage : auditMessages) { auditMessage.validate(); System.out.println(printAuditMessage(auditMessage)); assertEquals(1, auditMessage.getParticipantObjectIdentifications().size()); ParticipantObjectIdentificationType participant = auditMessage.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCodeRole.Provider, participant.getParticipantObjectTypeCodeRole()); assertEquals(HpdParticipantObjectIdTypeCode.RelativeDistinguishedName, participant.getParticipantObjectIDTypeCode()); } assertCommonHpdAuditAttributes(auditMessages[0], EventOutcomeIndicator.Success, serverSide ? EventIdCode.Import : EventIdCode.Export, EventActionCode.Update, serverSide); ParticipantObjectIdentificationType participant = auditMessages[2].getParticipantObjectIdentifications().get(0); assertEquals(1, participant.getParticipantObjectDetails().size()); assertEquals("old uid", participant.getParticipantObjectDetails().get(0).getType()); assertEquals("1.11.111.1111:klmno", new String(participant.getParticipantObjectDetails().get(0).getValue())); }
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; }
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; }
@Test public void testGetResource() { PdqPatient p = client.read() .resource(PdqPatient.class) .withId("4711") .execute(); assertEquals("Test", p.getName().get(0).getFamily().get(0).getValue()); assertEquals(String.format("http://localhost:%d/Patient/4711", DEMO_APP_PORT), p.getId()); AbstractMockedAuditMessageQueue sender = getAuditSender(); assertEquals(1, sender.getMessages().size()); AuditMessage event = sender.getMessages().get(0); // Patient ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); assertEquals("Patient/4711", patient.getParticipantObjectID()); }
ParticipantObjectIdentificationType patient = auditMessage.getParticipantObjectIdentifications().stream() .filter(poi -> ParticipantObjectIdTypeCode.PatientNumber == poi.getParticipantObjectIDTypeCode()) .findFirst().orElseThrow(() -> new AssertionError("Expected patient participant object"));
@Test public void testGetResource() { PdqPatient p = client.read() .resource(PdqPatient.class) .withId("4711") .execute(); assertEquals("Test", p.getName().get(0).getFamily()); assertEquals(String.format("http://localhost:%d/Patient/4711", DEMO_APP_PORT), p.getId()); AbstractMockedAuditMessageQueue sender = getAuditSender(); assertEquals(1, sender.getMessages().size()); AuditMessage event = sender.getMessages().get(0); // Patient ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); assertEquals("Patient/4711", patient.getParticipantObjectID()); }
ParticipantObjectIdentificationType patientIn = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patientIn.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patientIn.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patientIn = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patientIn.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patientIn.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType poit = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, poit.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Job, poit.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType poit = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, poit.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Job, poit.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType query = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, query.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.System, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType query = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, query.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType query = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, query.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.Person, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Patient, patient.getParticipantObjectTypeCodeRole()); ParticipantObjectIdentificationType query = event.getParticipantObjectIdentifications().get(1); assertEquals(ParticipantObjectTypeCode.System, query.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole());
ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentifications().get(0); assertEquals(ParticipantObjectTypeCode.System, patient.getParticipantObjectTypeCode()); assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole());