Package org.dcm4che3.net.hl7

Examples of org.dcm4che3.net.hl7.HL7MessageListener


        Device device = new Device(name);
        HL7DeviceExtension hl7Ext = new HL7DeviceExtension();
        device.addDeviceExtension(hl7Ext);
        Connection conn = createConn("host.dcm4che.org", 2575);
        device.addConnection(conn);
        HL7Application app = createHL7App(appName, conn);
        hl7Ext.addHL7Application(app);
        return device ;
    }
View Full Code Here


        conn.setProtocol(Protocol.HL7);
        return conn;
    }

    private static HL7Application createHL7App(String name, Connection conn) {
        HL7Application app = new HL7Application(name);
        app.addConnection(conn);
        app.setAcceptedSendingApplications("TEST2^DCM4CHE");
        app.setAcceptedMessageTypes(
                "ADT^A02",
                "ADT^A03",
                "ADT^A06",
                "ADT^A07",
                "ADT^A08",
View Full Code Here

        return conf.findHL7Application(name);
    }

    public HL7Application findHL7Application(String name)
            throws ConfigurationException {
        HL7Application ae = get(name);
        if (ae == null)
            throw new ConfigurationNotFoundException(
                    "Unknown HL7 Application: " + name);
        return ae;
    }
View Full Code Here

        HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class);
        return hl7Ext.getHL7Application(name);
    }

    protected HL7Application newHL7Application(Preferences appNode) {
        return new HL7Application(appNode.name());
    }
View Full Code Here

        device.addDeviceExtension(hl7Ext);
        List<Connection> devConns = device.listConnections();
        Preferences appsNode = deviceNode.node("hl7Application");
        for (String appName : appsNode.childrenNames()) {
            Preferences appNode = appsNode.node(appName);
            HL7Application hl7app = newHL7Application(appNode);
            loadFrom(hl7app, appNode);
            int n = appNode.getInt("dicomNetworkConnectionReference.#", 0);
            for (int i = 0; i < n; i++) {
                hl7app.addConnection(devConns.get(
                        appNode.getInt("dicomNetworkConnectionReference." + (i+1), 0) - 1));
            }
            hl7Ext.addHL7Application(hl7app);
        }
    }
View Full Code Here

        config.removeDevice("Test-Device-1");
    }

    private static Device createDevice(String name, String appName) throws Exception {
        Device device = new Device(name);
        HL7DeviceExtension hl7Ext = new HL7DeviceExtension();
        device.addDeviceExtension(hl7Ext);
        Connection conn = createConn("host.dcm4che.org", 2575);
        device.addConnection(conn);
        HL7Application app = createHL7App(appName, conn);
        hl7Ext.addHL7Application(app);
        return device ;
    }
View Full Code Here

    public HL7Application findHL7Application(String name)
            throws ConfigurationException {
        Device device = config.findDevice(
            "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))",
            name);
        HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class);
        return hl7Ext.getHL7Application(name);
    }
View Full Code Here

        return hl7Ext.getHL7Application(name);
    }

    @Override
    protected void storeChilds(String deviceDN, Device device) throws NamingException {
        HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class);
        if (hl7Ext == null)
            return;

        for (HL7Application hl7App : hl7Ext.getHL7Applications()) {
            String appDN = hl7appDN(hl7App.getApplicationName(), deviceDN);
            config.createSubcontext(appDN,
                    storeTo(hl7App, deviceDN, new BasicAttributes(true)));
        }
    }
View Full Code Here

                config.search(deviceDN, "(objectclass=hl7Application)");
        try {
            if (!ne.hasMore())
                return;

            HL7DeviceExtension hl7Ext = new HL7DeviceExtension();
            device.addDeviceExtension(hl7Ext);
            do {
                hl7Ext.addHL7Application(
                        loadHL7Application(ne.next(), deviceDN, device));
            } while (ne.hasMore());
        } finally {
            LdapUtils.safeClose(ne);
        }
View Full Code Here

    }

    @Override
    protected void mergeChilds(Device prev, Device device, String deviceDN)
            throws NamingException {
        HL7DeviceExtension prevHL7Ext =
                prev.getDeviceExtension(HL7DeviceExtension.class);
        HL7DeviceExtension hl7Ext =
                device.getDeviceExtension(HL7DeviceExtension.class);

        if (prevHL7Ext != null)
            for (String appName : prevHL7Ext.getHL7ApplicationNames()) {
                if (hl7Ext == null || !hl7Ext.containsHL7Application(appName))
                    config.destroySubcontextWithChilds(hl7appDN(appName, deviceDN));
            }

        if (hl7Ext == null)
            return;

        for (HL7Application hl7app : hl7Ext.getHL7Applications()) {
            String appName = hl7app.getApplicationName();
            if (prevHL7Ext == null || !prevHL7Ext.containsHL7Application(appName)) {
                String appDN = hl7appDN(hl7app.getApplicationName(), deviceDN);
                config.createSubcontext(appDN,
                        storeTo(hl7app, deviceDN, new BasicAttributes(true)));
View Full Code Here

TOP

Related Classes of org.dcm4che3.net.hl7.HL7MessageListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.