cdac.medinfo.sdk.hl7282.baselibs.segments

## Class RDT

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

- All Implemented Interfaces:
    ISegment

      public class RDT
      extends Segment

  RDT - table row data segment.

  The RDT segment contains the row data of the tabular data response message (TBR).

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

  RDT-1: Column Value (varies)Required

  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
    `RDT()` Constructs the RDT segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ISingleCollection<IDataType>` | `getColumnValue()` Retrieves the Data Type Column Value.
    `int` | `parse(java.lang.String strSegmentStream, IDelimiter objIDelimiter)` Parses HL7 Segment Strings from any Stream into HL7 Segment object.
    `int` | `serialize(IHL7Stream objIHL7Stream, IDelimiter objIDelimiter)` Serializes HL7 Message objects.
    `void` | `setColumnValues(ISingleCollection<IDataType> objColumnValues)` Set the Data Type Column Value.
    `boolean` | `validate()` Validates HL7 Message objects .

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

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

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

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

- - ### Constructor Detail

    - #### RDT

          public RDT()

      Constructs the RDT segment.

  - ### Method Detail

    - #### getColumnValue

          public ISingleCollection<IDataType> getColumnValue()

      Retrieves the Data Type Column Value. This field specify the position order defined for the query or table separated by field delimiters. This is a requested field.
      Returns:
        ISingleCollection - dataTypeColumnValue

    - #### setColumnValues

          public void setColumnValues(ISingleCollection<IDataType> objColumnValues)

      Set the Data Type Column Value. This field specify the position order defined for the query or table separated by field delimiters. This is a requested field.
      Parameters:
        `objColumnValues` - Use as ColumnValues.

    - #### parse

          public int parse(java.lang.String strSegmentStream,
                  IDelimiter objIDelimiter)
                    throws InvalidSegmentException,
                           java.io.IOException

      Parses HL7 Segment Strings from any Stream into HL7 Segment object. This method checks for the Repetition of the fields in the Segment. It also checks for the optionality of the fields as whether they are mandatory or optional. Successful parsing of the segment populates the object with the data present on the stream and provides easy accessor and mutator methods to navigate the message. It also leads to failure if version of given HL7 Message is not 2.8.2. This method raises exception if there is Segment which is not valid as per HL7 v 2.8.2 standard.
      Specified by:
        `parse` in interface `ISegment`
      Overrides:
        `parse` in class `Segment`
      Parameters:
        `strSegmentStream` - String of HL7Stream.
        `objIDelimiter` - Object of class Delimiter.
      Returns:
        int - Success if segment is valid. - Fail if segment in not valid.
      Throws:
        `InvalidSegmentException` - Thrown when Segment Validation Fails.
        `java.io.IOException` - Signals that an I/O exception of some sort has occurred.

    - #### serialize

          public int serialize(IHL7Stream objIHL7Stream,
                      IDelimiter objIDelimiter)
                        throws SerializeException,
                               java.io.IOException

      Serializes HL7 Message objects. Before serializaton it validates Message as per HL7 v2.5 standard. For successfully serialization , Message Object should follow order of segments as per its corresponding Message Structure. Serialize method fails if given stream is null. It mandates presence of required segments and the number of occurrences specified by the standard. This method also checks for presence of Mandatory Groups.It also verifies repeatability of Group.
      Specified by:
        `serialize` in interface `ISegment`
      Overrides:
        `serialize` in class `Segment`
      Parameters:
        `objIHL7Stream` - Object of HL7Stream class
        `objIDelimiter` - Object of Delimiter class present as inner class in MSG class
      Returns:
        int - function status [success/failure].
      Throws:
        `SerializeException` - Thrown when serialization of Message fails.
        `java.io.IOException` - Signals that an I/O exception of some sort has occurred.

    - #### 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 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.
      Specified by:
        `validate` in interface `ISegment`
      Overrides:
        `validate` in class `Segment`
      Returns:
        boolean - true or false.
      Throws:
        `InvalidSegmentException` - Throws when Segment Validation fails.