cdac.medinfo.sdk.hl7282.baselibs.segments

## Class BTS

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.segments.Segment
  - - cdac.medinfo.sdk.hl7282.baselibs.segments.BTS

- All Implemented Interfaces:
    ISegment

      public class BTS
      extends Segment

  BTS - Batch trailer segment

  The BTS segment defines the end of a batch.

  Represents an HL7 BTS message segment. This segment has the following fields:

  BTS-1: Batch Message Count (ST)Optional
  BTS-2: Batch Comment (ST)Optional
  BTS-3: Batch Totals (NM)Optional

  This class provides mechanism to validate message against HL7 v 2.8.2 standard. The class provides accessors & mutators for the elements mentioned above. The class has validate method which validates Message against HL7 v 2.8.2 standard.

  User can also create Segment through `SegmentFactory`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BTS()` Constructs BTS segment

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBatchTotals(NM objtempBatchTotals)` Set the Batch Totals.
    `void` | `addBatchTotals(java.lang.String strBatchTotals)` Set the Batch Totals.
    `ST` | `getBatchComment()` Retrieves the Batch Comment.
    `ST` | `getBatchMessageCount()` Retrieves the Batch Message Count.
    `ISingleCollection<NM>` | `getBatchTotals()` Retrieves Batch Totals.
    `void` | `setBatchComment(ST objbatchComment)` Set the Batch Comment.
    `void` | `setBatchComment(java.lang.String strBatchComment)` Set the Batch Comment.
    `void` | `setBatchMessageCount(ST objbatchMessageCount)` Set the Batch Message Count This field contains the count of the individual messages contained within the batch
    `void` | `setBatchMessageCount(java.lang.String strBatchMessageCount)` Set the Batch Message Count This field contains the count of the individual messages contained within the batch
    `void` | `setBatchTotals(ISingleCollection<NM> objBatchTotalsList)` Set the Batch Totals.
    `boolean` | `validate()` Validates HL7 Message objects .

    - ### Methods inherited from class cdac.medinfo.sdk.hl7282.baselibs.segments.Segment

      `addUnRecognizedField, dumpSegment, getFields, getName, getUnrecognizedFields, moveToNextSegment, parse, removeDataElement, removeDataElement, serialize, setName, setUnRecognizedField, updateDataElement, updateDataElement, writeToXML`

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

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

- - ### Constructor Detail

    - #### BTS

          public BTS()

      Constructs BTS segment

  - ### Method Detail

    - #### setBatchMessageCount

          public void setBatchMessageCount(java.lang.String strBatchMessageCount)

      Set the Batch Message Count This field contains the count of the individual messages contained within the batch
      Parameters:
        `strBatchMessageCount` - - String value of BatchMessageCount

    - #### setBatchMessageCount

          public void setBatchMessageCount(ST objbatchMessageCount)

      Set the Batch Message Count This field contains the count of the individual messages contained within the batch
      Parameters:
        `objbatchMessageCount` - object of BatchMessageCount

    - #### getBatchMessageCount

          public ST getBatchMessageCount()

      Retrieves the Batch Message Count.
      Returns:
        String - BatchMessageCount

    - #### setBatchComment

          public void setBatchComment(java.lang.String strBatchComment)

      Set the Batch Comment. This field is a comment field that is not further defined in the HL7 protocol.
      Parameters:
        `strBatchComment` - - String value of Batch Comment

    - #### setBatchComment

          public void setBatchComment(ST objbatchComment)

      Set the Batch Comment. This field is a comment field that is not further defined in the HL7 protocol.
      Parameters:
        `objbatchComment` - object of Batch Comment

    - #### getBatchComment

          public ST getBatchComment()

      Retrieves the Batch Comment.
      Returns:
        String - BatchComment

    - #### addBatchTotals

          public void addBatchTotals(java.lang.String strBatchTotals)

      Set the Batch Totals. This field contains the batch total
      Parameters:
        `strBatchTotals` - Batch Totals.

    - #### addBatchTotals

          public void addBatchTotals(NM objtempBatchTotals)

      Set the Batch Totals. This field contains the batch total
      Parameters:
        `objtempBatchTotals` - object of Batch Totals.

    - #### setBatchTotals

          public void setBatchTotals(ISingleCollection<NM> objBatchTotalsList)

      Set the Batch Totals. This field contains the batch total.
      Parameters:
        `objBatchTotalsList` - List of batch total.

    - #### getBatchTotals

          public ISingleCollection<NM> getBatchTotals()

      Retrieves Batch Totals.
      Returns:
        ISingleCollection - rangeofDecimalPrecision

    - #### validate

          public boolean validate()
                           throws InvalidSegmentException

      Validates HL7 Message objects . Validate method checks for validation each and every segments in side the Message object against specified message Structure. Validation chcecks include optionality of segment or group. It also verifies the number of times segment or group is repeated in message. e.g {PSH} while parsing PSH segment validate method will check for its mandatory presence. [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment.
      Specified by:
        `validate` in interface `ISegment`
      Overrides:
        `validate` in class `Segment`
      Returns:
        boolean - true or false.
      Throws:
        `InvalidSegmentException` - Thrown when Segment Validation Fails.