@Override public void validate() { super.validate(); if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Source)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Source"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Destination)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Destination"); } // DICOM restricts Participating Object to be one SOP Queried and the Query, but IHE also uses this Audit Event // for all sorts of other queries, so we cannot validate this at this point. } }
@Override public void validate() { super.validate(); if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Destination)).isEmpty()) { throw new AuditException("Must have one or more ActiveParticipant with RoleIDCode Destination"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.SourceMedia)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode SourceMedia"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).isEmpty()) { throw new AuditException("Must one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); int sources = getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Source)).size(); if (sources < 1 || sources > 2) { throw new AuditException("Must have one or two ActiveParticipant with RoleIDCode Source"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.DestinationMedia)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode DestinationMedia"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).isEmpty()) { throw new AuditException("Must one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } } }
@Override public void validate() { super.validate(); if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Source)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Source"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Destination)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Destination"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.StudyInstanceUID).isEmpty()) { throw new AuditException("Must have one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode StudyInstanceUID"); } } }
@Override public void validate() { super.validate(); if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Source)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Source"); } if (getMessage().findActiveParticipants(ap -> ap.getRoleIDCodes().contains(ActiveParticipantRoleIdCode.Destination)).size() != 1) { throw new AuditException("Must have one ActiveParticipant with RoleIDCode Destination"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.PatientNumber).size() != 1) { throw new AuditException("Must have one ParticipantObjectIdentification with ParticipantObjectIDTypeCode PatientNumber"); } if (getMessage().findParticipantObjectIdentifications(poi -> poi.getParticipantObjectIDTypeCode() == ParticipantObjectIdTypeCode.StudyInstanceUID).isEmpty()) { throw new AuditException("Must have one or more ParticipantObjectIdentification with ParticipantObjectIDTypeCode StudyInstanceUID"); } } }
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; }
roleIdCodes.stream() .filter(Objects::nonNull) .forEach(roleId -> ap.getRoleIDCodes().add(roleId));
.filter(apt -> ActiveParticipantRoleIdCode.Source == apt.getRoleIDCodes().get(0)) .findFirst().orElseThrow(() -> new AssertionError("Expected source participant")); .filter(apt -> ActiveParticipantRoleIdCode.Destination == apt.getRoleIDCodes().get(0)) .findFirst().orElseThrow(() -> new AssertionError("Expected destination active participant")); assertFalse(destination.isUserIsRequestor());
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; }