Search in sources :

Example 1 with Device

use of org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device in project ipf by oehf.

the class PixV3QueryRequestTransformer method fromSender.

public Device fromSender(final MCCIMT000100UV01Sender sender) {
    if (sender == null) {
        return null;
    }
    final Device simpleDevice = new Device();
    simpleDevice.setTelecom(sender.getTelecom());
    final MCCIMT000100UV01Device device = sender.getDevice();
    if (device != null) {
        simpleDevice.getIds().addAll(device.getId());
        simpleDevice.getNames().addAll(device.getName());
        simpleDevice.setDesc(device.getDesc());
        simpleDevice.getDeviceTelecom().addAll(device.getTelecom());
        simpleDevice.setManufacturerModelName(device.getManufacturerModelName());
        simpleDevice.setSoftwareName(device.getSoftwareName());
    }
    return simpleDevice;
}
Also used : MCCIMT000100UV01Device(net.ihe.gazelle.hl7v3.mccimt000100UV01.MCCIMT000100UV01Device) Device(org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device) MCCIMT000100UV01Device(net.ihe.gazelle.hl7v3.mccimt000100UV01.MCCIMT000100UV01Device)

Example 2 with Device

use of org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device in project ipf by oehf.

the class PixV3QueryResponseTransformer method fromSender.

public Device fromSender(final MCCIMT000300UV01Sender sender) {
    if (sender == null) {
        return null;
    }
    final Device simpleDevice = new Device();
    simpleDevice.setTelecom(sender.getTelecom());
    final MCCIMT000300UV01Device device = sender.getDevice();
    if (device != null) {
        simpleDevice.getIds().addAll(device.getId());
        simpleDevice.getNames().addAll(device.getName());
        simpleDevice.setDesc(device.getDesc());
        simpleDevice.getDeviceTelecom().addAll(device.getTelecom());
        simpleDevice.setManufacturerModelName(device.getManufacturerModelName());
        simpleDevice.setSoftwareName(device.getSoftwareName());
    }
    return simpleDevice;
}
Also used : Device(org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device)

Example 3 with Device

use of org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device in project ipf by oehf.

the class PixV3QueryResponseTransformer method fromReceiver.

public Device fromReceiver(final MCCIMT000300UV01Receiver receiver) {
    if (receiver == null) {
        return null;
    }
    final Device simpleDevice = new Device();
    simpleDevice.setTelecom(receiver.getTelecom());
    final MCCIMT000300UV01Device device = receiver.getDevice();
    if (device != null) {
        simpleDevice.getIds().addAll(device.getId());
        simpleDevice.getNames().addAll(device.getName());
        simpleDevice.setDesc(device.getDesc());
        simpleDevice.getDeviceTelecom().addAll(device.getTelecom());
        simpleDevice.setManufacturerModelName(device.getManufacturerModelName());
        simpleDevice.setSoftwareName(device.getSoftwareName());
    }
    return simpleDevice;
}
Also used : Device(org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device)

Example 4 with Device

use of org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device in project ipf by oehf.

the class PixV3QueryResponseTest method testFromQuery.

@Test
public void testFromQuery() {
    final PixV3QueryRequest query = new PixV3QueryRequest();
    query.getDataSourceOids().add("7.8.9");
    query.setQueryPatientId(new II("123", "1.2.3"));
    query.setQueryId(new II("abc", "4.5.6"));
    query.setReceiver(new Device());
    query.getReceiver().getIds().add(new II("receiver", "1.2"));
    query.setSender(new Device());
    query.getSender().getIds().add(new II("sender", "1.3"));
    query.setMessageId(new II("m1", "1.3.5"));
    final PixV3QueryResponse response = PixV3QueryResponse.fromQuery(query);
    assertEquals(query.getDataSourceOids(), response.getDataSourceOids());
    assertEquals(query.getQueryPatientId(), response.getQueryPatientId());
    assertEquals(query.getQueryId(), response.getQueryId());
    assertEquals(query.getReceiver(), response.getSender());
    assertEquals(query.getSender(), response.getReceiver());
    assertEquals(query.getMessageId(), response.getTargetMessageId());
}
Also used : PixV3QueryRequest(org.openehealth.ipf.commons.ihe.hl7v3.core.requests.PixV3QueryRequest) II(net.ihe.gazelle.hl7v3.datatypes.II) Device(org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device) Test(org.junit.jupiter.api.Test)

Example 5 with Device

use of org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device in project ipf by oehf.

the class PixV3QueryRequestTransformerTest method getSampleQuery.

public static PixV3QueryRequest getSampleQuery() {
    final PixV3QueryRequest query = new PixV3QueryRequest();
    query.setCreationTime(ZonedDateTime.now());
    query.getDataSourceOids().add("1.2.3");
    query.getDataSourceOids().add("7.8.9");
    query.setQueryPatientId(new II("123", "1.2.3"));
    query.setQueryId(new II("queryId", "4.5.6"));
    query.setMessageId(new II("m1", "1.3.5"));
    query.setReceiver(new Device());
    query.getReceiver().setDesc(new ED());
    query.getReceiver().getDesc().mixed = List.of("Description 1");
    query.getReceiver().setTelecom(new TEL());
    query.getReceiver().getTelecom().setValue("123456789");
    query.getReceiver().getIds().add(new II("1.2.840.114350.1.13.99999.4567", null));
    query.getReceiver().setSoftwareName(new SC());
    query.getReceiver().getSoftwareName().mixed = List.of("Software name 1");
    query.getReceiver().setManufacturerModelName(new SC());
    query.getReceiver().getManufacturerModelName().mixed = List.of("Manufacturer model name 1");
    query.getReceiver().getDeviceTelecom().add(new TEL());
    query.getReceiver().getDeviceTelecom().get(0).setValue("https://example.org/PIXQuery");
    query.getReceiver().getNames().add(new EN());
    query.getReceiver().getNames().get(0).mixed = List.of("Receiver");
    query.setSender(new Device());
    query.getSender().setDesc(new ED());
    query.getSender().getDesc().mixed = List.of("Description 2");
    query.getSender().setTelecom(new TEL());
    query.getSender().getTelecom().setValue("987654321");
    query.getSender().getIds().add(new II("1.2.840.114350.1.13.99997.2.7788", null));
    query.getSender().setSoftwareName(new SC());
    query.getSender().getSoftwareName().mixed = List.of("Software name 2");
    query.getSender().setManufacturerModelName(new SC());
    query.getSender().getManufacturerModelName().mixed = List.of("Manufacturer model name 2");
    query.getSender().getDeviceTelecom().add(new TEL());
    query.getSender().getDeviceTelecom().get(0).setValue("https://example.org/");
    query.getSender().getNames().add(new EN());
    query.getSender().getNames().get(0).mixed = List.of("Sender");
    return query;
}
Also used : PixV3QueryRequest(org.openehealth.ipf.commons.ihe.hl7v3.core.requests.PixV3QueryRequest) Device(org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device)

Aggregations

Device (org.openehealth.ipf.commons.ihe.hl7v3.core.metadata.Device)6 MCCIMT000100UV01Device (net.ihe.gazelle.hl7v3.mccimt000100UV01.MCCIMT000100UV01Device)2 PixV3QueryRequest (org.openehealth.ipf.commons.ihe.hl7v3.core.requests.PixV3QueryRequest)2 II (net.ihe.gazelle.hl7v3.datatypes.II)1 Test (org.junit.jupiter.api.Test)1