cdac.medinfo.sdk.hl7282.commoninterface

## Interface IGroup

- All Known Implementing Classes:
    Group

      public interface IGroup

  This is Parent Interface of Group in Model layer. Provides the contract that the implementor Group should follow.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addGroup(ISegmentKey enumSegments, IGroup objGroup)` Adds the group in Collection of data value.
    `void` | `addSegment(ISegmentKey enumSegments, ISegment objSegment)` Adds segment in multi valued paired collection.
    `ISingleCollection<IGroup>` | `getGroup(ISegmentKey enumGroup)` Gives collection of group of name enumGroup as passed by user.
    `IMap` | `getGroupMap(ISegmentKey enumGroupName)` Retrieves Map of specified Group name.
    `ISegmentKey` | `getName()` Return SegmentKey.
    `ISingleCollection<ISegment>` | `getSegment(ISegmentKey enumSegments)` Gives collection of segment of name enumSegments as passed by user.
    `ISingleCollection<ISegment>` | `getSegmentCollection()` Retrieves collection of ISegment.
    `ISegmentSet` | `getSegmentSet()` Retrieves all segments present in this group
    `int` | `populate(ISegmentSet objSegmentSet)` Populates the Segment Set.
    `void` | `setName(ISegmentKey enumName)` Sets the name of group.
    `int` | `size()` Returns the size of the group
    `boolean` | `validate()` Validates HL7 Message objects.
    `int` | `writeToXML(javax.xml.stream.XMLEventWriter eventWriter)` Uses to write to XML

- - ### Method Detail

    - #### populate

          int populate(ISegmentSet objSegmentSet)
                       throws GroupMissingException

      Populates the Segment Set.
      Returns:
        int - return HL7_FUNCTION_SUCCESS after success.
      Throws:
        `GroupMissingException`

    - #### addSegment

          void addSegment(ISegmentKey enumSegments,
                        ISegment objSegment)

      Adds segment in multi valued paired collection.
      Parameters:
        `enumSegments` - Key that is to be added to collection
        `objSegment` - Value of the key.

    - #### addGroup

          void addGroup(ISegmentKey enumSegments,
                      IGroup objGroup)

      Adds the group in Collection of data value.
      Parameters:
        `enumSegments` - - object of enumSegment .
        `objGroup` - - object of Group.

    - #### setName

          void setName(ISegmentKey enumName)

      Sets the name of group.
      Parameters:
        `enumName` - - object of enumName.

    - #### getName

          ISegmentKey getName()

      Return SegmentKey.
      Returns:
        SegmentKey.

    - #### getSegmentSet

          ISegmentSet getSegmentSet()
                                    throws InvalidMessageException

      Retrieves all segments present in this group
      Returns:
        ISingleCollection - List of Segments
      Throws:
        `InvalidMessageException`

    - #### getSegmentCollection

          ISingleCollection<ISegment> getSegmentCollection()

      Retrieves collection of ISegment.
      Returns:
        ISingleCollection -return collection of ISegment.

    - #### getGroup

          ISingleCollection<IGroup> getGroup(ISegmentKey enumGroup)

      Gives collection of group of name enumGroup as passed by user.
      Parameters:
        `enumGroup` - Name of group.
      Returns:
        ISingleCollection - Collection of Group .

    - #### getSegment

          ISingleCollection<ISegment> getSegment(ISegmentKey enumSegments)

      Gives collection of segment of name enumSegments as passed by user.
      Parameters:
        `enumSegments` - Name of Segment.
      Returns:
        ISingleCollection - Collection of Segments .

    - #### validate

          boolean validate()
                           throws InvalidMessageException

      Validates HL7 Message objects. Validate method checks for validation each and every segments in side the Message object against specified message Structure. Validation checks 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.
      Returns:
        boolean - true If Message and all segments in side it are validated properly - false If segment in side it is not validated properly and if compulsory segments are not present.
      Throws:
        `InvalidMessageException` - Thrown when Message validation fails.

    - #### writeToXML

          int writeToXML(javax.xml.stream.XMLEventWriter eventWriter)
                         throws java.io.IOException,
                                javax.xml.stream.XMLStreamException

      Uses to write to XML
      Parameters:
        `eventWriter` - object of eventWriter.
      Returns:
        int - return integer
      Throws:
        `java.io.IOException`
        `javax.xml.stream.XMLStreamException`

    - #### size

          int size()

      Returns the size of the group
      Returns:
        int - return size.

    - #### getGroupMap

          IMap getGroupMap(ISegmentKey enumGroupName)

      Retrieves Map of specified Group name.
      Parameters:
        `enumGroupName` - Object of ISegmentKey provides name of Group
      Returns:
        IMessageMap Object of IMessageMap