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

## Class HL7BatchFile

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

- All Implemented Interfaces:
    IHL7BatchFile

      public class HL7BatchFile
      extends java.lang.Object
      implements IHL7BatchFile

  HL7BatchFile consist of BatchFile header, trailer, and Collection of batches .

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HL7BatchFile()` Instantiates HL7BatchFile
    `HL7BatchFile(FHS objFHS, FTS objFTS, ISingleCollection<IHL7Batch> objHL7BatchCollection)` Instantiates HL7Batch batch with header and trailer segment provided.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FHS` | `getBatchFileHeader()` Gets the batch file header.
    `FTS` | `getBatchFileTrailer()` Gets the batch file trailer.
    `ISingleCollection<IHL7Batch>` | `getHL7BatchCollection()` Gets the HL7Batch collection.
    `void` | `setBatchFileHeader(FHS objBatchFileHeader)` Sets the batch file header.
    `void` | `setBatchFileTrailer(FTS objBatchFileTrailer)` Sets the batch file trailer.
    `void` | `setHL7BatchCollection(ISingleCollection<IHL7Batch> objHL7BatchCollection)` Sets the HL7Batch collection.
    `boolean` | `validate()` Validates HL7 BatchFile objects.

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

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

- - ### Constructor Detail

    - #### HL7BatchFile

          public HL7BatchFile()

      Instantiates HL7BatchFile

    - #### HL7BatchFile

          public HL7BatchFile(FHS objFHS,
                      FTS objFTS,
                      ISingleCollection<IHL7Batch> objHL7BatchCollection)

      Instantiates HL7Batch batch with header and trailer segment provided.
      Parameters:
        `objFHS` - Specified batch file header segment
        `objFTS` - Specified batch file trailer segment
        `objHL7BatchCollection` - Message Batch to be inserted in Batch file.

  - ### Method Detail

    - #### getBatchFileHeader

          public FHS getBatchFileHeader()

      Gets the batch file header.
      Specified by:
        `getBatchFileHeader` in interface `IHL7BatchFile`
      Returns:
        FHS -the batch file header

    - #### setBatchFileHeader

          public void setBatchFileHeader(FHS objBatchFileHeader)

      Sets the batch file header.
      Specified by:
        `setBatchFileHeader` in interface `IHL7BatchFile`
      Parameters:
        `objBatchFileHeader` - the new batch file header

    - #### getBatchFileTrailer

          public FTS getBatchFileTrailer()

      Gets the batch file trailer.
      Specified by:
        `getBatchFileTrailer` in interface `IHL7BatchFile`
      Returns:
        FTS - the batch file trailer

    - #### setBatchFileTrailer

          public void setBatchFileTrailer(FTS objBatchFileTrailer)

      Sets the batch file trailer.
      Specified by:
        `setBatchFileTrailer` in interface `IHL7BatchFile`
      Parameters:
        `objBatchFileTrailer` - the new batch file trailer

    - #### getHL7BatchCollection

          public ISingleCollection<IHL7Batch> getHL7BatchCollection()

      Gets the HL7Batch collection.
      Specified by:
        `getHL7BatchCollection` in interface `IHL7BatchFile`
      Returns:
        ISingleCollection - the HL7Batch collection

    - #### setHL7BatchCollection

          public void setHL7BatchCollection(ISingleCollection<IHL7Batch> objHL7BatchCollection)

      Sets the HL7Batch collection.
      Specified by:
        `setHL7BatchCollection` in interface `IHL7BatchFile`
      Parameters:
        `objHL7BatchCollection` - the new HL7Batch collection

    - #### validate

          public boolean validate()
                           throws BatchException

      Validates HL7 BatchFile objects.
      Specified by:
        `validate` in interface `IHL7BatchFile`
      Returns:
        true - if successful false - otherwise
      Throws:
        `BatchException` - the invalid HL7Batch exception