cdac.medinfo.sdk.hl7282.baselibs.parserserializer

## Class HL7Parser

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.parserserializer.HL7Parser

-     public class HL7Parser
      extends java.lang.Object

  The HL7Parser parses the HL7Message and provides a SegmentSet. SegmentSet contains all segments of a HL7 Message in the same order as they appeared.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HL7Parser()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `LocalExtensionAgent` | `getLocalExtensionAgent()` Retrieves instance of LocalExtensionAgent.
    `ISegmentSet` | `parse(IHL7Stream objHL7Stream)` Parses the HL7Stream which contains a HL7 Message and populates the SegmentSet accordingly.
    `ISegmentSet` | `parse(java.lang.String strFilePath)` Parses the HL7 Message from given file and populates the SegmentSet accordingly.
    `void` | `setLocalExtensionAgent(LocalExtensionAgent objAgent)` Sets LocalExtensionAgent to process locally extended segments.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HL7Parser

          public HL7Parser()

  - ### Method Detail

    - #### setLocalExtensionAgent

          public void setLocalExtensionAgent(LocalExtensionAgent objAgent)

      Sets LocalExtensionAgent to process locally extended segments.
      Parameters:
        `objAgent` - instance of LocalExtensionAgent

    - #### getLocalExtensionAgent

          public LocalExtensionAgent getLocalExtensionAgent()

      Retrieves instance of LocalExtensionAgent.
      Returns:
        LocalExtensionAgent - instance of LocalExtensionAgent

    - #### parse

          public ISegmentSet parse(IHL7Stream objHL7Stream)
                            throws java.io.IOException,
                                   ParseException,
                                   SegmentNotSupportedException

      Parses the HL7Stream which contains a HL7 Message and populates the SegmentSet accordingly.
      Parameters:
        `objHL7Stream` - instance of HL7Stream
      Returns:
        ISegmentSet instance of SegmentSet
      Throws:
        `java.io.IOException` - if Input/Output operation fails
        `ParseException` - if parsing operation fails
        `SegmentNotSupportedException` - if Segment is not supported or not registered with LocalExtensionAgent

    - #### parse

          public ISegmentSet parse(java.lang.String strFilePath)
                            throws java.io.IOException,
                                   ParseException

      Parses the HL7 Message from given file and populates the SegmentSet accordingly.
      Parameters:
        `strFilePath` - path to file
      Returns:
        ISegmentSet instance of SegmentSet
      Throws:
        `java.io.IOException` - if Input/Output operation fails
        `ParseException` - if parsing operation fails