Codota Logo
MLLPConnection.readMessage
Code IndexAdd Codota to your IDE (free)

How to use
readMessage
method
in
org.dcm4che3.hl7.MLLPConnection

Best Java code snippets using org.dcm4che3.hl7.MLLPConnection.readMessage (Showing top 6 results out of 315)

  • Common ways to obtain MLLPConnection
private void myMethod () {
MLLPConnection m =
  • Codota IconSocket sock;new MLLPConnection(sock)
  • Smart code suggestions by Codota
}
origin: dcm4che/dcm4che

public void sendFiles(List<String> pathnames) throws IOException {
  for (String pathname : pathnames) {
    mllp.writeMessage(readFile(pathname));
    if (mllp.readMessage() == null)
      throw new IOException("Connection closed by receiver");
  }
}
origin: org.dcm4che.tool/dcm4che-tool-hl7snd

public void sendFiles(List<String> pathnames) throws IOException {
  for (String pathname : pathnames) {
    mllp.writeMessage(readFile(pathname));
    if (mllp.readMessage() == null)
      throw new IOException("Connection closed by receiver");
  }
}
origin: dcm4che/dcm4che

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;
  }
}
origin: dcm4che/dcm4che

  public void query(String pid, String[] domains) throws IOException {
    HL7Message qbp = HL7Message.makePixQuery(pid, domains);
    HL7Segment msh = qbp.get(0);
    msh.setSendingApplicationWithFacility(sendingApplication);
    msh.setReceivingApplicationWithFacility(receivingApplication);
    msh.setField(17, charset);
    mllp.writeMessage(qbp.getBytes(charset));
    if (mllp.readMessage() == null)
      throw new IOException("Connection closed by receiver");
  }
}
origin: org.dcm4che.tool/dcm4che-tool-hl7pix

  public void query(String pid, String[] domains) throws IOException {
    HL7Message qbp = HL7Message.makePixQuery(pid, domains);
    HL7Segment msh = qbp.get(0);
    msh.setSendingApplicationWithFacility(sendingApplication);
    msh.setReceivingApplicationWithFacility(receivingApplication);
    msh.setField(17, charset);
    mllp.writeMessage(qbp.getBytes(charset));
    if (mllp.readMessage() == null)
      throw new IOException("Connection closed by receiver");
  }
}
origin: dcm4che/dcm4che

  public void run() {
    try {
      s.setSoTimeout(conn.getIdleTimeout());
      MLLPConnection mllp = new MLLPConnection(s);
      byte[] data;
      while ((data = mllp.readMessage()) != null) {
        HL7ConnectionMonitor monitor = hl7dev.getHL7ConnectionMonitor();
        UnparsedHL7Message msg = new UnparsedHL7Message(data);
        if (monitor != null)
          monitor.onMessageReceived(conn, s, msg);
        UnparsedHL7Message rsp;
        try {
          rsp = hl7dev.onMessage(conn, s, msg);
        if (monitor != null)
          monitor.onMessageProcessed(conn, s, msg, rsp, null);
        } catch (HL7Exception e) {
          rsp = new UnparsedHL7Message(
              HL7Message.makeACK(msg.msh(), e).getBytes(null));
          if (monitor != null)
            monitor.onMessageProcessed(conn, s, msg, rsp, e);
        }
        mllp.writeMessage(rsp.data());
      }
    } catch (IOException e) {
      LOG.warn("Exception on accepted connection {}:", s, e);
    } finally {
      conn.close(s);
    }
  }
}
org.dcm4che3.hl7MLLPConnectionreadMessage

Popular methods of MLLPConnection

  • writeMessage
  • <init>
  • close
  • getSocket
  • log

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now