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

## Class HL7Batch

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

- All Implemented Interfaces:
    IHL7Batch

      public class HL7Batch
      extends java.lang.Object
      implements IHL7Batch

  HL7Batch consist of Batch header, trailer, Collection of messages and Query segments if it is a Query Batch.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HL7Batch()`
    `HL7Batch(BHS objBHS, BTS objBTS, ISingleCollection<Message> objHL7BatchCollection)` Constructor for HL7batch used to initialize member
    `HL7Batch(ISingleCollection<Message> objHL7BatchCollection)` Constructor for HL7batch.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getBatchControlID()` Gets the BatchControlID.
    `BHS` | `getBatchHeader()` Gets the batch header.
    `BTS` | `getBatchTrailer()` Gets the batch trailer.
    `ISingleCollection<Message>` | `getMessageCollection()` Gets the message collection.
    `java.lang.String` | `getQueryIdentifier()` Retrieve String of Query Identifier
    `QPD` | `getQueryParameterDefinitionSegment()` Retrieve object of Query Parameter Definition Segment
    `RCP` | `getResponseControlParameterSegment()` Retrieve object of Response Control Parameter Segment
    `boolean` | `isDeferred()` Checks whether Query Priority is Deferred or Immediate
    `boolean` | `isResponseBatch()` Checks if is response batch.
    `void` | `setBatchHeader(BHS objBatchHeader)` Sets the batch header.
    `void` | `setBatchTrailer(BTS objBatchTrailer)` Sets the batch trailer.
    `void` | `setMessageCollection(ISingleCollection<Message> objMessageCollection)` Sets the message collection.
    `void` | `setQuerySegments(QPD objQPD, RCP objRCP)` Sets query segments required to form Enhanced mode Query Batch.
    `boolean` | `validate()` Validates HL7 Batch objects.

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

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

- - ### Constructor Detail

    - #### HL7Batch

          public HL7Batch()

    - #### HL7Batch

          public HL7Batch(ISingleCollection<Message> objHL7BatchCollection)

      Constructor for HL7batch.
      Parameters:
        `objHL7BatchCollection` - - object of HL7BatchCollection

    - #### HL7Batch

          public HL7Batch(BHS objBHS,
                  BTS objBTS,
                  ISingleCollection<Message> objHL7BatchCollection)

      Constructor for HL7batch used to initialize member
      Parameters:
        `objBHS-` - object of BHS
        `objBTS` - - object of BTS
        `objHL7BatchCollection` - - object of HL7BatchCollection

  - ### Method Detail

    - #### getQueryParameterDefinitionSegment

          public QPD getQueryParameterDefinitionSegment()

      Retrieve object of Query Parameter Definition Segment
      Specified by:
        `getQueryParameterDefinitionSegment` in interface `IHL7Batch`
      Returns:
        QPD - object of QPD

    - #### getResponseControlParameterSegment

          public RCP getResponseControlParameterSegment()

      Retrieve object of Response Control Parameter Segment
      Specified by:
        `getResponseControlParameterSegment` in interface `IHL7Batch`
      Returns:
        RCP - object of RCP

    - #### getQueryIdentifier

          public java.lang.String getQueryIdentifier()

      Retrieve String of Query Identifier
      Specified by:
        `getQueryIdentifier` in interface `IHL7Batch`
      Returns:
        String - String of RCP

    - #### isDeferred

          public boolean isDeferred()

      Checks whether Query Priority is Deferred or Immediate
      Specified by:
        `isDeferred` in interface `IHL7Batch`
      Returns:
        boolean - true, if Query Priority is deferred.

    - #### setQuerySegments

          public void setQuerySegments(QPD objQPD,
                              RCP objRCP)

      Sets query segments required to form Enhanced mode Query Batch.
      Specified by:
        `setQuerySegments` in interface `IHL7Batch`
      Parameters:
        `objQPD` - Specified Query Parameter definition Segment.
        `objRCP` - Specified Response control parameter segment.

    - #### getBatchControlID

          public java.lang.String getBatchControlID()

      Gets the BatchControlID.
      Specified by:
        `getBatchControlID` in interface `IHL7Batch`
      Returns:
        String - The BatchControlID.

    - #### getBatchHeader

          public BHS getBatchHeader()

      Gets the batch header.
      Specified by:
        `getBatchHeader` in interface `IHL7Batch`
      Returns:
        BHS - The batch header

    - #### setBatchHeader

          public void setBatchHeader(BHS objBatchHeader)

      Sets the batch header.
      Specified by:
        `setBatchHeader` in interface `IHL7Batch`
      Parameters:
        `objBatchHeader` - the new batch header

    - #### getBatchTrailer

          public BTS getBatchTrailer()

      Gets the batch trailer.
      Specified by:
        `getBatchTrailer` in interface `IHL7Batch`
      Returns:
        BTS - The batch trailer

    - #### setBatchTrailer

          public void setBatchTrailer(BTS objBatchTrailer)

      Sets the batch trailer.
      Specified by:
        `setBatchTrailer` in interface `IHL7Batch`
      Parameters:
        `objBatchTrailer` - the new batch trailer

    - #### getMessageCollection

          public ISingleCollection<Message> getMessageCollection()

      Gets the message collection.
      Specified by:
        `getMessageCollection` in interface `IHL7Batch`
      Returns:
        ISingleCollection - The message collection

    - #### setMessageCollection

          public void setMessageCollection(ISingleCollection<Message> objMessageCollection)

      Sets the message collection.
      Specified by:
        `setMessageCollection` in interface `IHL7Batch`
      Parameters:
        `objMessageCollection` - the new message collection

    - #### isResponseBatch

          public boolean isResponseBatch()

      Checks if is response batch.
      Specified by:
        `isResponseBatch` in interface `IHL7Batch`
      Returns:
        true - if is response batch false - otherwise

    - #### validate

          public boolean validate()
                           throws BatchException

      Validates HL7 Batch objects.
      Specified by:
        `validate` in interface `IHL7Batch`
      Returns:
        true - if successful false - otherwise
      Throws:
        `InvalidBatchException` - the invalid message exception
        `BatchException` - Thrown when Batch validation fails.