cdac.medinfo.sdk.hl7282.baselibs.segments

## Class SGT

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

- All Implemented Interfaces:
    ISegment

      public class SGT
      extends Segment

  SGT - Segment Group Header

  The SGH segment is only used to provide information about the instantiated message structure to the parsing process to indicate that the segment group ends and subsequent segments should be interpreted accordingly. It does not contain any patient related data. The Segment Group Trailer is required if the segment group header exists.

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

  SGT-1: Set ID - SGT (SI)Required
  SGT-2: Segment Group Name (ST)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
    `SGT()` Constructs the SGT segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ST` | `getSegmentGroupName()` Retrieves the Segment Group Name.
    `SI` | `getSetID_SGT()` Retrieves the Set ID SGT.
    `void` | `setSegmentGroupName(ST objSegmentGroupName)` Set the Segment Group Name.
    `void` | `setSegmentGroupName(java.lang.String strSegmentGroupName)` Set the Segment Group Name.
    `void` | `setSetID_SGT(SI objSetID_SGT)` Set the Set ID SGT.
    `void` | `setSetID_SGT(java.lang.String strSetID_SGT)` Set the Set ID SGT.
    `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

    - #### SGT

          public SGT()

      Constructs the SGT segment.

  - ### Method Detail

    - #### getSetID_SGT

          public SI getSetID_SGT()

      Retrieves the Set ID SGT. For the first segment group transmitted, the sequence number shall be 1; for the second , it shall be 2; and so on.
      Returns:
        String - setID_SGT

    - #### setSetID_SGT

          public void setSetID_SGT(java.lang.String strSetID_SGT)

      Set the Set ID SGT. For the first segment group transmitted, the sequence number shall be 1; for the second , it shall be 2; and so on.
      Parameters:
        `strSetID_SGT` - This field contains the number that identifies SGT transaction.

    - #### setSetID_SGT

          public void setSetID_SGT(SI objSetID_SGT)

      Set the Set ID SGT. For the first segment group transmitted, the sequence number shall be 1; for the second , it shall be 2; and so on.
      Parameters:
        `objSetID_SGT` - Object of Set ID SGT.

    - #### getSegmentGroupName

          public ST getSegmentGroupName()

      Retrieves the Segment Group Name. This field contains the name of the segment group.
      Returns:
        String - SegmentGroupName

    - #### setSegmentGroupName

          public void setSegmentGroupName(java.lang.String strSegmentGroupName)

      Set the Segment Group Name. This field contains the name of the segment group.
      Parameters:
        `strSegmentGroupName` - String value of Segment Group Name

    - #### setSegmentGroupName

          public void setSegmentGroupName(ST objSegmentGroupName)

      Set the Segment Group Name. This field contains the name of the segment group.
      Parameters:
        `objSegmentGroupName` - Segment Group Name

    - #### 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` - Throws when Segment Validation fails.