Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP HL7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.stc.connector.appconn.tcpip.hl7
Interface HL7v3AppMessage

All Known Implementing Classes:
  HL7v3AppMessageImpl

    public interface HL7v3AppMessage

This class is used as a place holder of HL7 v3 specific functions

Version:
  cvs revision: $Revision: 1.1 $ Last Modified: $Date: 2007/12/14 10:20:10 $
Author:
  Nageswara Samudrala

Field Summary
`static java.lang.String` | `version`

Method Summary
`byte[]` | `getPayload()` The payload holds HL7 data.
`int` | `loadSequenceNumber()` Loads the sequence number from the persistence file.
`void` | `receive()` Receives the enveloped data over the TCP/IP connection and de-envelopes/validates it (according to LLP settings).
`void` | `send()` Envelopes (according to LLP settings) the HL7 data which is stored in payload, The enveloped HL7 data is then sent out over the TCP/IP connection.
`void` | `setPayload(byte[] payload)` The payload holds HL7 data.
`void` | `storeHL7Ack(java.lang.String messageId, java.lang.String HL7ACK)` Stores the HL7 Ack message in the MLLPV2's persistence storage.
`void` | `storeHL7Nak(java.lang.String messageId, java.lang.String HL7NAK)` Stores the HL7 NAK message in the MLLPV2's persistence storage.
`void` | `storeSequenceNumber(int sequenceNumber)` Stores the sequence number to the persistence file.

Field Detail

### version

    static final java.lang.String version

See Also:
  Constant Field Values

Method Detail

### send

    void send()
              throws HL7ApplicationException,
                     java.io.IOException

  Envelopes (according to LLP settings) the HL7 data which is stored in payload, The enveloped HL7 data is then sent out over the TCP/IP connection.

  Before this method is called, the outgoing HL7 data should already be stored in payload by the setPayload() method. Note: If it fails to send the enveloped data over the TCP/IP connection, IOException will be thrown. If it fails to envelope data, HL7ApplicationException will be thrown.

  Parameters:
    None.

  Throws:
    ``HL7ApplicationException`` - Thrown upon LLP enveloping related error.
    ``IOException`` - Thrown upon TCP/IP transport error.
    `HL7ApplicationException`
    `java.io.IOException`

### receive

    void receive()
                 throws HL7ApplicationException,
                        java.io.IOException

  Receives the enveloped data over the TCP/IP connection and de-envelopes/validates it (according to LLP settings). The HL7 data (the de-enveloped data) is then stores in payload. After this method is called, the received HL7 data is stored in payload. The HL7 data can be retrieved with the getPayload() method.

  Note: If it fails to receive the enveloped data over the TCP/IP connection, java.io.IOException is thrown. There are 3 cases:

  - com.stc.connector.tcpip.model.exception.TCPIPNoResponseException: No any response from external server.
  - com.stc.connector.tcpip.model.exception.TCPIPIncompleteDataException: Gets response from server, but fails to get the complete enveloped data.
  - Other java.io.IOException: E.g connection is down, etc.

  If it fails to de-envelope/validate data, com.stc.connector.tcpip.hl7.exception.HL7ApplicationException is thrown.

  Parameters:
    None.

  Throws:
    ``HL7ApplicationException`` - Thrown upon LLP de-enveloping/validation related error.
    ``IOException`` - Thrown upon TCP/IP i/o error.
    `HL7ApplicationException`
    `java.io.IOException`

### getPayload

    byte[] getPayload()
                      throws HL7ApplicationException

  The payload holds HL7 data. Before calling the "send()" method, this payload should be set with HL7 data. After calling the "receive()" method, this payload should contain HL7 data.

  Parameters:
    None.

  Returns:
    `byte[]` - The payload in byte array.
  Throws:
    ``HL7ApplicationException`` - Thrown upon error.
    `HL7ApplicationException`

### setPayload

    void setPayload(byte[] payload)
                    throws HL7ApplicationException

  The payload holds HL7 data. Before calling the "send()" method, this payload should be set with HL7 data. After calling the "receive()" method, this payload should contain a HL7 data.

  Parameters:
    `payload` - The payload to set.
  Throws:
    ``HL7ApplicationException`` - Thrown upon error.
    `HL7ApplicationException`

### loadSequenceNumber

    int loadSequenceNumber()
                           throws HL7ApplicationException,
                                  java.io.IOException

  Loads the sequence number from the persistence file. The file location is defined by the configuration properties.

  Parameters:
    None.

  Returns:
    `int` - The number stored in file.
  Throws:
    ``HL7ApplicationException`` - Thrown upon error.
    ``IOException`` - Thrown upon i/o error.
    `HL7ApplicationException`
    `java.io.IOException`

### storeSequenceNumber

    void storeSequenceNumber(int sequenceNumber)
                             throws HL7ApplicationException,
                                    java.io.IOException

  Stores the sequence number to the persistence file. The file location is defined by the configuration properties.

  Parameters:
    `sequenceNumber` - The number to store.
  Throws:
    ``HL7ApplicationException`` - Thrown upon error.
    ``IOException`` - Thrown upon i/o error.
    `HL7ApplicationException`
    `java.io.IOException`

### storeHL7Ack

    void storeHL7Ack(java.lang.String messageId,
                     java.lang.String HL7ACK)
                     throws HL7ApplicationException

  Stores the HL7 Ack message in the MLLPV2's persistence storage. The persistence storage is a database holding the HL7 messages. This ACK will be stored against the original HL7 request messageId.

  Parameters:
    `messageId` - The MSH message control Id of the original HL7 request message
    `HL7ACK` - The complete HL7 ACK message to store
  Throws:
    ``HL7ApplicationException`` - Thrown upon error.
    `HL7ApplicationException`

### storeHL7Nak

    void storeHL7Nak(java.lang.String messageId,
                     java.lang.String HL7NAK)
                     throws HL7ApplicationException

  Stores the HL7 NAK message in the MLLPV2's persistence storage. The persistence storage is a database holding the HL7 messages. This NAK will be stored against the original HL7 request messageId.

  Parameters:
    `messageId` - The MSH message control Id of the original HL7 request message
    `HL7NAK` - The complete HL7 NAK message to store
  Throws:
    ``HL7ApplicationException`` - Thrown upon error.
    `HL7ApplicationException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP HL7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD