protected Content activeParticipant(ActiveParticipantType activeParticipant) { Element element = new Element("ActiveParticipant"); element.setAttribute("UserID", activeParticipant.getUserID()); conditionallyAddAttribute(element, "AlternativeUserID", activeParticipant.getAlternativeUserID()); conditionallyAddAttribute(element, "UserName", activeParticipant.getUserName()); element.setAttribute("UserIsRequestor", Boolean.toString(activeParticipant.isUserIsRequestor())); conditionallyAddAttribute(element, "NetworkAccessPointID", activeParticipant.getNetworkAccessPointID()); conditionallyAddAttribute(element, "NetworkAccessPointTypeCode", activeParticipant.getNetworkAccessPointTypeCode()); if (activeParticipant.getMediaType() != null) { element.addContent( new Element("MediaIdentifier") .addContent(codedValueType("MediaType", activeParticipant.getMediaType()))); } if (activeParticipant.getRoleIDCodes() != null) { activeParticipant.getRoleIDCodes().stream() .map(roleIdCode -> codedValueType("RoleIDCode", roleIdCode)) .forEach(element::addContent); } return element; }
assertEquals(sourceUserId, source.getUserID()); if (!serverSide) { assertNotNull(source.getAlternativeUserID()); .findFirst().orElseThrow(() -> new AssertionError("Expected destination active participant")); assertFalse(destination.isUserIsRequestor()); assertEquals(destinationUserId, destination.getUserID()); if (serverSide) { assertNotNull(destination.getAlternativeUserID());
protected AuditEvent.AuditEventAgentComponent activeParticipantToAgent(ActiveParticipantType ap) { AuditEvent.AuditEventAgentComponent agent = new AuditEvent.AuditEventAgentComponent() .setUserId(new Identifier().setValue(ap.getUserID())) .setAltId(ap.getAlternativeUserID()) .setName(ap.getUserName()) .setRequestor(ap.isUserIsRequestor()) .setMedia(codedValueTypeToCoding(ap.getMediaType())) .setNetwork(new AuditEvent.AuditEventAgentNetworkComponent() .setAddress(ap.getNetworkAccessPointID()) .setType(auditEventNetworkType(ap.getNetworkAccessPointTypeCode()))); ap.getRoleIDCodes().forEach(roleID -> agent.addPolicy(roleID.getCode())); return agent; }
protected AuditEvent.AuditEventAgentComponent activeParticipantToAgent(ActiveParticipantType ap) { AuditEvent.AuditEventAgentComponent agent = new AuditEvent.AuditEventAgentComponent() .setWho(new Reference().setIdentifier(new Identifier().setValue(ap.getUserID()))) .setAltId(ap.getAlternativeUserID()) .setName(ap.getUserName()) .setRequestor(ap.isUserIsRequestor()) .setMedia(codedValueTypeToCoding(ap.getMediaType())) .setNetwork(new AuditEvent.AuditEventAgentNetworkComponent() .setAddress(ap.getNetworkAccessPointID()) .setType(auditEventNetworkType(ap.getNetworkAccessPointTypeCode()))); ap.getRoleIDCodes().forEach(roleID -> agent.addPolicy(roleID.getCode())); return agent; }
assertFalse(destination.isUserIsRequestor()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID()); assertEquals("http://localhost:" + DEMO_APP_PORT + "/", destination.getUserID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/Patient/$ihe-pix", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/Patient/$ihe-pix", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/Patient", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/Patient", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/DocumentManifest", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/DocumentManifest", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/DocumentReference", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());
assertEquals("http://localhost:" + DEMO_APP_PORT + "/DocumentReference", destination.getUserID()); assertEquals(AuditUtils.getLocalIPAddress(), destination.getNetworkAccessPointID());