Package org.dcm4che3.net.hl7

Examples of org.dcm4che3.net.hl7.HL7MessageListener


        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


    protected void loadChilds(Device device, Preferences deviceNode)
            throws BackingStoreException, ConfigurationException {
        if (!deviceNode.nodeExists("hl7Application"))
            return;

        HL7DeviceExtension hl7Ext = new HL7DeviceExtension();
        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

    }

    @Override
    protected void mergeChilds(Device prev, Device device,
            Preferences deviceNode) throws BackingStoreException {
        HL7DeviceExtension prevHL7Ext = prev.getDeviceExtension(HL7DeviceExtension.class);
        HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class);

        if (hl7Ext == null) {
            if (prevHL7Ext != null)
                deviceNode.node("hl7Application").removeNode();
            return;
        }

        Preferences appsNode = deviceNode.node("hl7Application");
        if (prevHL7Ext != null)
            for (String appName : prevHL7Ext.getHL7ApplicationNames()) {
                if (!hl7Ext.containsHL7Application(appName))
                    appsNode.node(appName).removeNode();
            }

        List<Connection> devConns = device.listConnections();
        for (HL7Application app : hl7Ext.getHL7Applications()) {
            String appName = app.getApplicationName();
            Preferences appNode = appsNode.node(appName);
            if (prevHL7Ext == null || !prevHL7Ext.containsHL7Application(appName)) {
                storeTo(app, appNode, devConns);
            } else {
View Full Code Here

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

        return new HL7Application(appNode.name());
    }

    @Override
    protected void storeChilds(Device device, Preferences deviceNode) {
        HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class);
        if (hl7Ext == null)
            return;

        List<Connection> devConns = device.listConnections();
        Preferences parent = deviceNode.node("hl7Application");
        for (HL7Application hl7App : hl7Ext.getHL7Applications()) {
            Preferences appNode = parent.node(hl7App.getApplicationName());
            storeTo(hl7App, appNode, devConns);
        }
    }
View Full Code Here

    }

    @Override
    public byte[] onMessage(HL7Application hl7App, Connection conn, Socket s,
            HL7Segment msh, byte[] msg, int off, int len, int mshlen) throws HL7Exception {
        HL7MessageListener listener = listeners.get(msh.getMessageType());
        if (listener == null) {
            listener = listeners.get("*");
            if (listener == null)
                return super.onMessage(hl7App, conn, s, msh, msg, off, len, mshlen);
        }
        return  listener.onMessage(hl7App, conn, s, msh, msg, off, len, mshlen);
    }
View Full Code Here

        this.status = status;
    }

    public void setTransferSyntaxes(String[] tss) {
        rq.addPresentationContext(
                new PresentationContext(1, UID.VerificationSOPClass,
                        UID.ImplicitVRLittleEndian));
        rq.addPresentationContext(
                new PresentationContext(2,
                        UID.StorageCommitmentPushModelSOPClass,
                        tss));
        ae.addTransferCapability(
                new TransferCapability(null,
                        UID.VerificationSOPClass,
View Full Code Here

            LOG.warn("{}: M-DELETE {} failed!", as, file);
    }

    private DicomServiceRegistry createServiceRegistry() {
        DicomServiceRegistry serviceRegistry = new DicomServiceRegistry();
        serviceRegistry.addDicomService(new BasicCEchoSCP());
        serviceRegistry.addDicomService(cstoreSCP);
        return serviceRegistry;
    }
View Full Code Here

    public StgCmtSCU(ApplicationEntity ae) throws IOException {
        this.remote = new Connection();
        this.ae = ae;
        DicomServiceRegistry serviceRegistry = new DicomServiceRegistry();
        serviceRegistry.addDicomService(new BasicCEchoSCP());
        serviceRegistry.addDicomService(stgcmtResultHandler);
        ae.setDimseRQHandler(serviceRegistry);
    }
View Full Code Here

                    Attributes.createFileMetaInformation(iuid, cuid,
                            UID.ExplicitVRLittleEndian),
                    eventInfo);
        } catch (IOException e) {
            LOG.warn(as + ": Failed to store Storage Commitment Result:", e);
            throw new DicomServiceException(Status.ProcessingFailure, e);
        } finally {
            SafeClose.close(out);
        }
        return null;
    }
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.