cdac.medinfo.sdk.hl7282.hl7net.auxiliaryprotocol.batch

## Class BatchAgent

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.hl7net.auxiliaryprotocol.batch.BatchAgent

- All Implemented Interfaces:
    IBatchProcessor

      public class BatchAgent
      extends java.lang.Object
      implements IBatchProcessor

  BatchAgent performs the handling of sending and receiving process for HL7Batch/HL7BatchFile during communication. It provides additional utility methods for population and creation of Batch/BatchFile through SegmentSet and vice-versa.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BatchAgent()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IHL7BatchFile` | `createBatchFile(MessageFactory objMessageFactory, ISegmentSet objSegmentSet)` Creates HL7BatchFile and populate it through provided SegmentSet.
    `ISegmentSet` | `getSegmentSet(IHL7Batch objBatch)` Populates SegemntSet through provided HL7Batch.
    `ISegmentSet` | `getSegmentSet(IHL7BatchFile objHL7BatchFile)` Populates SegemntSet through provided HL7BatchFile.
    `IHL7BatchFile` | `populateBatchFile(MessageFactory objMessageFactory, ISegmentSet objSegmentSet)` Populates HL7BatchFile through provided SegmentSet.
    `IHL7BatchFile` | `processReceive(MessageFactory objMessageFactory, ISegmentSet objISegmentSet)` Retrieves populated HL7BatchFile through given SegmentSet.
    `ISegmentSet` | `processSend(IHL7BatchFile objHL7BatchFile)` Retrieves SegmentSet generated through provided HL7BatchFile.

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

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

- - ### Constructor Detail

    - #### BatchAgent

          public BatchAgent()

  - ### Method Detail

    - #### processReceive

          public IHL7BatchFile processReceive(MessageFactory objMessageFactory,
                                     ISegmentSet objISegmentSet)

      Retrieves populated HL7BatchFile through given SegmentSet.
      Specified by:
        `processReceive` in interface `IBatchProcessor`
      Parameters:
        `objMessageFactory` - instance of MessageFactory
        `objSegmentSet` - instance of SegmentSet
      Returns:
        IHL7BatchFile - instance of HL7BatchFile
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### processSend

          public ISegmentSet processSend(IHL7BatchFile objHL7BatchFile)

      Retrieves SegmentSet generated through provided HL7BatchFile.
      Specified by:
        `processSend` in interface `IBatchProcessor`
      Parameters:
        `objHL7BatchFile` - instance of HL7BatchFile
      Returns:
        ISegmentSet - instance of ISegmentSet

    - #### createBatchFile

          public IHL7BatchFile createBatchFile(MessageFactory objMessageFactory,
                                      ISegmentSet objSegmentSet)

      Creates HL7BatchFile and populate it through provided SegmentSet. It processes messages which are supported for sending through provided Message factory.
      Specified by:
        `createBatchFile` in interface `IBatchProcessor`
      Parameters:
        `objMessageFactory` - instance of Message factory
        `objSegmentSet` - instance of SegmentSet
      Returns:
        IHL7BatchFile - instance of HL7BatchFile

    - #### populateBatchFile

          public IHL7BatchFile populateBatchFile(MessageFactory objMessageFactory,
                                        ISegmentSet objSegmentSet)

      Populates HL7BatchFile through provided SegmentSet. It processes messages which are supported for receiving through provided Message factory.
      Specified by:
        `populateBatchFile` in interface `IBatchProcessor`
      Parameters:
        `objMessageFactory` - instance of Message factory
        `objSegmentSet` - instance of SegmentSet
      Returns:
        IHL7BatchFile - instance of HL7BatchFile

    - #### getSegmentSet

          public ISegmentSet getSegmentSet(IHL7BatchFile objHL7BatchFile)

      Populates SegemntSet through provided HL7BatchFile.
      Specified by:
        `getSegmentSet` in interface `IBatchProcessor`
      Parameters:
        `objHL7BatchFile` - instance of HL7BatchFile
      Returns:
        SegmentSet - instance of SegmentSet

    - #### getSegmentSet

          public ISegmentSet getSegmentSet(IHL7Batch objBatch)

      Populates SegemntSet through provided HL7Batch.
      Specified by:
        `getSegmentSet` in interface `IBatchProcessor`
      Parameters:
        `objHL7Batch` - instance of HL7Batch
      Returns:
        SegmentSet - instance of SegmentSet