public HL7Connection open(Connection remote) throws IOException, IncompatibleConnectionException, GeneralSecurityException { return new HL7Connection(this, connect(remote)); }
public boolean removeHL7Application(HL7Application hl7App) { return removeHL7Application(hl7App.getApplicationName()) != null; }
public MLLPConnection connect(Connection remote) throws IOException, IncompatibleConnectionException, GeneralSecurityException { return connect(findCompatibleConnection(remote), remote); }
public HL7Rcv() throws IOException { conn.setProtocol(Protocol.HL7); device.addDeviceExtension(hl7Ext); device.addConnection(conn); hl7Ext.addHL7Application(hl7App); hl7App.setAcceptedMessageTypes("*"); hl7App.addConnection(conn); hl7App.setHL7MessageListener(handler); }
private void reconfigureHL7Applications(HL7DeviceExtension from) { hl7apps.keySet().retainAll(from.hl7apps.keySet()); for (HL7Application src : from.hl7apps.values()) { HL7Application hl7app = hl7apps.get(src.getApplicationName()); if (hl7app == null) addHL7Application(hl7app = new HL7Application(src.getApplicationName())); hl7app.reconfigure(src); } } }
UnparsedHL7Message onMessage(Connection conn, Socket s, UnparsedHL7Message msg) throws HL7Exception { HL7Application hl7App = getHL7Application(msg.msh().getReceivingApplicationWithFacility(), true); if (hl7App == null) throw new HL7Exception( new ERRSegment(msg.msh()) .setHL7ErrorCode(ERRSegment.TableValueNotFound) .setErrorLocation(ERRSegment.UnknownReceivingApplication) .setUserMessage("Receiving Application not recognized")); return hl7App.onMessage(conn, s, msg); }
public HL7Application getHL7Application(String name, boolean matchOtherAppNames) { HL7Application app = hl7apps.get(name); if (app == null) app = hl7apps.get("*"); if (app == null && matchOtherAppNames) for (HL7Application app1 : getHL7Applications()) if (app1.isOtherApplicationName(name)) return app1; return app; }
@Override public UnparsedHL7Message onMessage(HL7Application hl7App, Connection conn, Socket s, UnparsedHL7Message msg) throws HL7Exception { HL7MessageListener listener = listeners.get(msg.msh().getMessageType()); if (listener == null) { listener = listeners.get("*"); if (listener == null) return super.onMessage(hl7App, conn, s, msg); } return listener.onMessage(hl7App, conn, s, msg); }
@Override public UnparsedHL7Message onMessage(HL7Application hl7App, Connection conn, Socket s, UnparsedHL7Message msg) throws HL7Exception { return new UnparsedHL7Message( HL7Message.makeACK(msg.msh(), HL7Exception.AA, null).getBytes(null)); } }
public void writeMessage(UnparsedHL7Message msg) throws IOException { try { mllpConnection.writeMessage(msg.data()); if (monitor != null) monitor.onMessageSent(hl7Application, mllpConnection.getSocket(), msg, null); } catch (IOException e) { monitor.onMessageSent(hl7Application, mllpConnection.getSocket(), msg, e); throw e; } }
public UnparsedHL7Message readMessage(UnparsedHL7Message msg) throws IOException { try { byte[] b = mllpConnection.readMessage(); UnparsedHL7Message rsp = b != null ? new UnparsedHL7Message(b) : null; monitor.onMessageResponse(hl7Application, mllpConnection.getSocket(), msg, rsp, null); return rsp; } catch (IOException e) { monitor.onMessageResponse(hl7Application, mllpConnection.getSocket(), msg, null, e); throw e; } }
public HL7Application(String name) { setApplicationName(name); }
public HL7Connection(HL7Application hl7Application, MLLPConnection mllpConnection) { this.hl7Application = hl7Application; this.mllpConnection = mllpConnection; this.monitor = hl7Application.getDevice() .getDeviceExtensionNotNull(HL7DeviceExtension.class) .getHL7ConnectionMonitor(); }
@Override public void reconfigure(DeviceExtension from) { reconfigureHL7Applications((HL7DeviceExtension) from); }
public HL7Segment msh() { init(); return msh; }
public HL7MessageListener getHL7MessageListener() { HL7MessageListener listener = hl7MessageListener; if (listener != null) return listener; HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); return hl7Ext != null ? hl7Ext.getHL7MessageListener() : null; }
public HL7Rcv() throws IOException { conn.setProtocol(Protocol.HL7); device.addDeviceExtension(hl7Ext); device.addConnection(conn); hl7Ext.addHL7Application(hl7App); hl7App.setAcceptedMessageTypes("*"); hl7App.addConnection(conn); hl7App.setHL7MessageListener(handler); }
public HL7Connection open(HL7Application remote) throws IOException, IncompatibleConnectionException, GeneralSecurityException { return new HL7Connection(this, connect(remote)); }
public MLLPConnection connect(HL7Application remote) throws IOException, IncompatibleConnectionException, GeneralSecurityException { CompatibleConnection cc = findCompatibleConnection(remote); return connect(cc.getLocalConnection(), cc.getRemoteConnection()); }
public HL7Connection open(Connection local, Connection remote) throws IOException, IncompatibleConnectionException, GeneralSecurityException { return new HL7Connection(this, connect(local, remote)); }