cdac.medinfo.sdk.hl7282.baselibs.segmentfactory

## Class SegmentMap

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.segmentfactory.SegmentMap

- All Implemented Interfaces:
    ISegmentMap

      public final class SegmentMap
      extends java.lang.Object
      implements ISegmentMap

  SegmentMap class is the implementation of ISegmentMap. SegmentMap represents structure of a segment as per defined in HL7 standard. It includes index for attribute item sequence defined in segment structure. Index for Attribute Item starts with 1.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SegmentMap()` Instantiates SegmentMap

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttributeItem(IAttributeItem objAttributeItem)` Adds AttributeItem to ISegmentMap at current available index.
    `void` | `addAttributeItem(IAttributeItem objAttributeItem, int index, EnumMapModifyMode enumModifyMode)` Adds AttributeItem to ISegmentMap at given index position according to the modification mode.
    `ISegmentMap` | `clone()` Retrieves a clone of ISegmentMap.
    `IAttributeItem` | `getAttributeItem(int index)` Retrieves IAttributeItem for defined index.
    `java.lang.String` | `getDataTypeName(int iItemID)` Retrieves the Data Type name of an Item specified by HL7 Standard for the specified Item.
    `java.lang.String` | `getFieldName(int iItemID)` Retrieves the Field name of an Item specified by HL7 Standard for the specified Item.
    `java.lang.String` | `getItemConformanceLength(int iItemID)` Retrieves the Conformance Length of an Item specified by HL7 Standard for the specified Item.
    `ISingleCollection<java.lang.Integer>` | `getItemIDList()` Retrieves the list of Item ID of all AttributeItems which are member of ISEgmentMap.
    `int` | `getItemMaximumLength(int iItemID)` Retrieves the Maximum Length of an Item specified by HL7 Standard for the specified Item.
    `int` | `getItemMinimumLength(int iItemID)` Retrieves the Minimum Length of an Item specified by HL7 Standard for the specified Item.
    `boolean` | `getLock()` Retrieves current status of lock for ISegmentMap.
    `int` | `getOccurrence(int iItemID)` Retrieves Occurrence for attribute defined by HL7 standard in segment.
    `int[]` | `getValueTable(int iItemID)` Retrieves the Table value specified by HL7 Standard for the specified Item ID.
    `boolean` | `isOptional(int iItemID)` Retrieves the status indicating whether the specified Item ID is optional or not.
    `boolean` | `isRepeatable(int iItemID)` Retrieves the status indicating whether the specified Item ID is repeatable or not.
    `void` | `setLock(boolean bLock)` Sets lock on ISegmentMap.
    `int` | `size()` Retrieves size of ISegmentMap

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

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

- - ### Constructor Detail

    - #### SegmentMap

          public SegmentMap()

      Instantiates SegmentMap

  - ### Method Detail

    - #### setLock

          public void setLock(boolean bLock)

      Sets lock on ISegmentMap. If lock is set then new AttributeItem can not be added in SegmentMap
      Specified by:
        `setLock` in interface `ISegmentMap`
      Parameters:
        `bLock` - value of lock

    - #### getLock

          public boolean getLock()

      Retrieves current status of lock for ISegmentMap.
      Specified by:
        `getLock` in interface `ISegmentMap`
      Returns:
        boolean - status of lock

    - #### getAttributeItem

          public IAttributeItem getAttributeItem(int index)

      Retrieves IAttributeItem for defined index. Map index starts with 1.
      Specified by:
        `getAttributeItem` in interface `ISegmentMap`
      Parameters:
        `index` - sequence value for attribute.
      Returns:
        IAttributeItem instance of AttributeItem

    - #### addAttributeItem

          public void addAttributeItem(IAttributeItem objAttributeItem)

      Adds AttributeItem to ISegmentMap at current available index. Adds AttributeItem only if map is not in lock state. In Lock state map can be modified only if LocalExtension feature is supported.
      Specified by:
        `addAttributeItem` in interface `ISegmentMap`
      Parameters:
        `objAttributeItem` - instance of Attribute Item

    - #### addAttributeItem

          public void addAttributeItem(IAttributeItem objAttributeItem,
                              int index,
                              EnumMapModifyMode enumModifyMode)

      Adds AttributeItem to ISegmentMap at given index position according to the modification mode. Adds AttributeItem only if map is not in lock state. In Lock state map can be modified only if LocalExtension feature is supported.
      Specified by:
        `addAttributeItem` in interface `ISegmentMap`
      Parameters:
        `objAttributeItem` - instance of Attribute Item
        `index` - sequence position
        `enumModifyMode` - enumerated value of modification mode

    - #### size

          public int size()

      Description copied from interface: `ISegmentMap`
      Retrieves size of ISegmentMap
      Specified by:
        `size` in interface `ISegmentMap`
      Returns:
        int - total number of Attribute Items

    - #### getItemIDList

          public ISingleCollection<java.lang.Integer> getItemIDList()

      Retrieves the list of Item ID of all AttributeItems which are member of ISEgmentMap.
      Specified by:
        `getItemIDList` in interface `ISegmentMap`
      Returns:
        ISingleCollection - return collection of Item ID

    - #### getValueTable

          public int[] getValueTable(int iItemID)

      Retrieves the Table value specified by HL7 Standard for the specified Item ID.
      Specified by:
        `getValueTable` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        int[] - return array of Table value for specified Item ID

    - #### getItemMinimumLength

          public int getItemMinimumLength(int iItemID)

      Retrieves the Minimum Length of an Item specified by HL7 Standard for the specified Item.
      Specified by:
        `getItemMinimumLength` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        int - return Minimum Length value for specified Item ID

    - #### getItemMaximumLength

          public int getItemMaximumLength(int iItemID)

      Retrieves the Maximum Length of an Item specified by HL7 Standard for the specified Item.
      Specified by:
        `getItemMaximumLength` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        int - return Maximum Length value for specified Item ID

    - #### getItemConformanceLength

          public java.lang.String getItemConformanceLength(int iItemID)

      Retrieves the Conformance Length of an Item specified by HL7 Standard for the specified Item.
      Specified by:
        `getItemConformanceLength` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        String - return Conformance Length value for specified Item ID

    - #### getDataTypeName

          public java.lang.String getDataTypeName(int iItemID)

      Retrieves the Data Type name of an Item specified by HL7 Standard for the specified Item.
      Specified by:
        `getDataTypeName` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        String - return Data type name for specified Item ID

    - #### isRepeatable

          public boolean isRepeatable(int iItemID)

      Retrieves the status indicating whether the specified Item ID is repeatable or not.
      Specified by:
        `isRepeatable` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        boolean - the status indicating whether the specified Item ID is repeatable or not

    - #### getOccurrence

          public int getOccurrence(int iItemID)

      Retrieves Occurrence for attribute defined by HL7 standard in segment.
      Specified by:
        `getOccurrence` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        int - Number of Occurrence of the attribute

    - #### isOptional

          public boolean isOptional(int iItemID)

      Retrieves the status indicating whether the specified Item ID is optional or not.
      Specified by:
        `isOptional` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        boolean - the status indicating whether the specified Item ID is optional or not

    - #### getFieldName

          public java.lang.String getFieldName(int iItemID)

      Retrieves the Field name of an Item specified by HL7 Standard for the specified Item.
      Specified by:
        `getFieldName` in interface `ISegmentMap`
      Parameters:
        `iItemID` - Integer value of Item ID
      Returns:
        String - return Field name for specified Item ID

    - #### clone

          public ISegmentMap clone()

      Retrieves a clone of ISegmentMap.
      Specified by:
        `clone` in interface `ISegmentMap`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        ISegmentMap - instance of ISegmentMap