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; }
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; }