protected Element participantObjectIdentification(ParticipantObjectIdentificationType poi) { Element element = new Element("ParticipantObjectIdentification"); if (poi != null) { conditionallyAddAttribute(element, "ParticipantObjectID", poi.getParticipantObjectID()); if (poi.getParticipantObjectTypeCode() != null) { conditionallyAddAttribute(element, "ParticipantObjectTypeCode", poi.getParticipantObjectTypeCode().getValue().toString()); } conditionallyAddAttribute(element, "ParticipantObjectTypeCodeRole", poi.getParticipantObjectTypeCodeRole()); conditionallyAddAttribute(element, "ParticipantObjectDataLifeCycle", poi.getParticipantObjectDataLifeCycle()); conditionallyAddAttribute(element, "ParticipantObjectSensitivity", poi.getParticipantObjectSensitivity()); element.addContent(codedValueType("ParticipantObjectIDTypeCode", poi.getParticipantObjectIDTypeCode())); if (poi.getParticipantObjectName() != null) { element.addContent(new Element("ParticipantObjectName") .addContent(poi.getParticipantObjectName())); } if (poi.getParticipantObjectQuery() != null) { element.addContent(new Element("ParticipantObjectQuery") .addContent(new String( Base64.getEncoder().encode(poi.getParticipantObjectQuery()), StandardCharsets.UTF_8))); } poi.getParticipantObjectDetails().stream() .map(participantObjectDetail -> typeValuePairType("ParticipantObjectDetail", participantObjectDetail)) .forEach(element::addContent); poi.getParticipantObjectDescriptions().stream() .map(this::dicomObjectDescription) .forEach(element::addContent); } return element; }
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())); }
objectDetails.stream() .filter(Objects::nonNull) .forEach(objectDetail -> poit.getParticipantObjectDetails().add(objectDetail));
private void testRequest(boolean serverSide) { Iti63AuditStrategy strategy = new Iti63AuditStrategy(serverSide); XdsQueryAuditDataset auditDataset = getXdsAuditDataset(strategy); AuditMessage auditMessage = makeAuditMessage(strategy, auditContext, auditDataset); assertNotNull(auditMessage); auditMessage.validate(); // System.out.println(printAuditMessage(auditMessage)); assertCommonXdsAuditAttributes(auditMessage, EventOutcomeIndicator.Success, EventIdCode.Query, EventActionCode.Execute, serverSide, true); assertEquals(2, auditMessage.findParticipantObjectIdentifications( poit -> poit.getParticipantObjectTypeCode() == ParticipantObjectTypeCode.System) .get(0) .getParticipantObjectDetails().size()); }
private void testRequest(boolean serverSide, XdsIRetrieveAuditStrategy30 strategy) { XdsNonconstructiveDocumentSetRequestAuditDataset auditDataset = getXdsAuditDataset(strategy); AuditMessage auditMessage = makeAuditMessage(strategy, auditContext, auditDataset); assertNotNull(auditMessage); auditMessage.validate(); // System.out.println(printAuditMessage(auditMessage)); assertCommonXdsAuditAttributes(auditMessage, EventOutcomeIndicator.Success, serverSide ? EventIdCode.Export : EventIdCode.Import, serverSide ? EventActionCode.Read : EventActionCode.Create, serverSide, true); assertEquals(3, auditMessage.findParticipantObjectIdentifications( poit -> poit.getParticipantObjectTypeCodeRole() == ParticipantObjectTypeCodeRole.Report).size()); assertEquals(4, auditMessage.findParticipantObjectIdentifications( poit -> poit.getParticipantObjectTypeCode() == ParticipantObjectTypeCode.System) .get(0) .getParticipantObjectDetails().size()); }
private void testRequest(boolean serverSide, XdsIRetrieveAuditStrategy30 strategy) { XdsNonconstructiveDocumentSetRequestAuditDataset auditDataset = getXdsAuditDataset(strategy); AuditMessage auditMessage = makeAuditMessage(strategy, auditContext, auditDataset); assertNotNull(auditMessage); auditMessage.validate(); // System.out.println(printAuditMessage(auditMessage)); assertCommonXdsAuditAttributes(auditMessage, EventOutcomeIndicator.Success, serverSide ? EventIdCode.Export : EventIdCode.Import, serverSide ? EventActionCode.Read : EventActionCode.Create, serverSide, true); assertEquals(3, auditMessage.findParticipantObjectIdentifications( poit -> poit.getParticipantObjectTypeCodeRole() == ParticipantObjectTypeCodeRole.Report).size()); assertEquals(4, auditMessage.findParticipantObjectIdentifications( poit -> poit.getParticipantObjectTypeCode() == ParticipantObjectTypeCode.System) .get(0) .getParticipantObjectDetails().size()); }
if (!patient.getParticipantObjectDetails().isEmpty()) { assertEquals(MESSAGE_ID, new String( patient.getParticipantObjectDetails().get(0).getValue(), StandardCharsets.UTF_8));
protected AuditEvent.AuditEventEntityComponent participantObjectIdentificationToEntity(ParticipantObjectIdentificationType poit) { AuditEvent.AuditEventEntityComponent entity = new AuditEvent.AuditEventEntityComponent() .setIdentifier(new Identifier() .setValue(poit.getParticipantObjectID())) // poit.getParticipantObjectIDTypeCode())) not used here .setType(new Coding() .setCode(String.valueOf(poit.getParticipantObjectTypeCode().getValue())) .setSystem("http://hl7.org/fhir/audit-entity-type")) .setRole(new Coding() .setCode(String.valueOf(poit.getParticipantObjectTypeCodeRole().getValue())) .setSystem("http://hl7.org/fhir/object-role")) .setLifecycle(new Coding() .setCode(String.valueOf(poit.getParticipantObjectDataLifeCycle().getValue())) .setSystem("http://hl7.org/fhir/dicom-audit-lifecycle")) .addSecurityLabel(new Coding() .setCode(poit.getParticipantObjectSensitivity())) .setName(poit.getParticipantObjectName()) // poit.getParticipantObjectDescription) not mappable here .setQuery(poit.getParticipantObjectQuery()); poit.getParticipantObjectDetails().forEach(tvp -> entity.addDetail(new AuditEvent.AuditEventEntityDetailComponent() .setType(tvp.getType()) .setValue(tvp.getValue()))); return entity; }
protected AuditEvent.AuditEventEntityComponent participantObjectIdentificationToEntity(ParticipantObjectIdentificationType poit) { AuditEvent.AuditEventEntityComponent entity = new AuditEvent.AuditEventEntityComponent() .setWhat(new Reference().setIdentifier(new Identifier() .setValue(poit.getParticipantObjectID()))) // poit.getParticipantObjectIDTypeCode())) not used here .setType(new Coding() .setCode(String.valueOf(poit.getParticipantObjectTypeCode().getValue())) .setSystem("http://hl7.org/fhir/audit-entity-type")) .setRole(new Coding() .setCode(String.valueOf(poit.getParticipantObjectTypeCodeRole().getValue())) .setSystem("http://hl7.org/fhir/object-role")) .setLifecycle(new Coding() .setCode(String.valueOf(poit.getParticipantObjectDataLifeCycle().getValue())) .setSystem("http://hl7.org/fhir/dicom-audit-lifecycle")) .addSecurityLabel(new Coding() .setCode(poit.getParticipantObjectSensitivity())) .setName(poit.getParticipantObjectName()) // poit.getParticipantObjectDescription) not mappable here .setQuery(poit.getParticipantObjectQuery()); poit.getParticipantObjectDetails().forEach(tvp -> entity.addDetail(new AuditEvent.AuditEventEntityDetailComponent() .setType(tvp.getType()) .setValue(new Base64BinaryType(tvp.getValue())))); return entity; }
p.getParticipantObjectTypeCode() == ParticipantObjectTypeCode.System).get(0); assertEquals(Iti68TestRouteBuilder.DOCUMENT_UNIQUE_ID, poit.getParticipantObjectID()); assertEquals(2, poit.getParticipantObjectDetails().size());