Tabnine Logo
MLLPConnection.readMessage
Code IndexAdd Tabnine 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)

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

  • Making http requests using okhttp
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JTable (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now