ca.uhn.hl7v2.llp
Class MinLLPReader

java.lang.Object
  extended by ca.uhn.hl7v2.llp.MinLLPReader
All Implemented Interfaces:
HL7Reader

public class MinLLPReader
extends java.lang.Object
implements HL7Reader

Title: HL7Reader Description: A buffered reader specifically designed for use in reading HL7 ASCII strings. This class assumes that the minimal lower layer protocol is being used. Copyright: Copyright (c) 2001 Company: University Health Network

Author:
Damian Horton (damian.horton@uhn.on.ca); mods by Bryan Tripp

Field Summary
static java.lang.String CHARSET_KEY
           
 
Constructor Summary
MinLLPReader()
          Creates a MinLLPReader with no setup - setInputStream must be set later.
MinLLPReader(java.io.InputStream in)
          Creates a MinLLPReader which reads from the given InputStream.
 
Method Summary
 void close()
          Closes the underlying BufferedReader.
 java.lang.String getMessage()
          Reads an HL7 encoded message from this Reader's InputStream.
static void main(java.lang.String[] args)
          Test driver for the program.
 void setInputStream(java.io.InputStream in)
          Sets the InputStream from which to read messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHARSET_KEY

public static final java.lang.String CHARSET_KEY
See Also:
Constant Field Values
Constructor Detail

MinLLPReader

public MinLLPReader()
Creates a MinLLPReader with no setup - setInputStream must be set later.


MinLLPReader

public MinLLPReader(java.io.InputStream in)
             throws java.io.IOException
Creates a MinLLPReader which reads from the given InputStream. The stream is assumed to be an ASCII bit stream.

Throws:
java.io.IOException
Method Detail

setInputStream

public void setInputStream(java.io.InputStream in)
                    throws java.io.IOException
Sets the InputStream from which to read messages. The InputStream must be set before any calls to getMessage().

Specified by:
setInputStream in interface HL7Reader
Throws:
java.io.IOException

getMessage

public java.lang.String getMessage()
                            throws LLPException,
                                   java.io.IOException
Reads an HL7 encoded message from this Reader's InputStream.

Specified by:
getMessage in interface HL7Reader
Returns:
The message, in string format, without the lower level protocol delimeters. Returns null if a -1 is received on the initial read.
Throws:
LLPException
java.io.IOException

main

public static void main(java.lang.String[] args)
Test driver for the program. Bounces a message off of an echo socket, and ascertaines whether or not this class works.


close

public void close()
           throws java.io.IOException
Closes the underlying BufferedReader.

Specified by:
close in interface HL7Reader
Throws:
java.io.IOException


Copyright © 2001-2011 University Health Network. All Rights Reserved.