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; }
if (patient.getParticipantObjectQuery() != null) { assertEquals(QUERY_PAYLOAD, new String( patient.getParticipantObjectQuery(), StandardCharsets.UTF_8));
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; }
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; }
assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/Patient/$ihe-pix?sourceIdentifier=urn:oid:1.2.3.4|0815&targetSystem=urn:oid:1.2.3.4.6", new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8));
assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/Patient/$ihe-pix?sourceIdentifier=urn:oid:1.2.3.4|0815&targetSystem=urn:oid:1.2.3.4.6", new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8));
assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/Patient?family=Test", new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8));
assertEquals(ParticipantObjectTypeCodeRole.Query, patient.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/Patient?family=Test", new String(patient.getParticipantObjectQuery(), StandardCharsets.UTF_8));
assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/DocumentManifest?patient.identifier=urn:oid:2.16.840.1.113883.3.37.4.1.1.2.1.1|1", new String(query.getParticipantObjectQuery(), StandardCharsets.UTF_8));
assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/DocumentManifest?patient.identifier=urn:oid:2.16.840.1.113883.3.37.4.1.1.2.1.1|1", new String(query.getParticipantObjectQuery(), StandardCharsets.UTF_8));
assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/DocumentReference?patient.identifier=urn:oid:2.16.840.1.113883.3.37.4.1.1.2.1.1|1", new String(query.getParticipantObjectQuery(), StandardCharsets.UTF_8));
assertEquals(ParticipantObjectTypeCodeRole.Query, query.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/DocumentReference?patient.identifier=urn:oid:2.16.840.1.113883.3.37.4.1.1.2.1.1|1", new String(query.getParticipantObjectQuery(), StandardCharsets.UTF_8));