cdac.medinfo.sdk.hl7282.baselibs.segments

## Class TQ2

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

- All Implemented Interfaces:
    ISegment

      public class TQ2
      extends Segment

  TQ2 - Timing/Quantity Relationship.

  The TQ2 segment is used to form a relationship between the service request the TQ1/TQ2 segments are associated with, and other service requests. The TQ2 segment will link the current service request with one or more other service requests.

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

  TQ2-1: Set ID - TQ2 (SI)Optional
  TQ2-2: Sequence/Results Flag (ID)Optional
  TQ2-3: Related Placer Number (EI)Conditional
  TQ2-4: Related Filler Number (EI)Conditional
  TQ2-5: Related Placer Group Number (EI)Conditional
  TQ2-6: Sequence Condition Code (ID)Conditional
  TQ2-7: Cyclic Entry/Exit Indicator (ID)Conditional
  TQ2-8: Sequence Condition Time Interval (CQ)Optional
  TQ2-9: Cyclic Group Maximum Number of Repeats (NM)Optional
  TQ2-10: Special Service Request Relationship (ID)Conditional

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRelatedFillerNo(EI objrelatedFillerNo)` Add the Related Filler No.
    `void` | `addRelatedFillerNo(java.lang.String strEntityIdentifier, java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Add the Related Filler No.
    `void` | `addRelatedPlacerGroupNo(EI objrelatedPlacerGroupNo)` Add the Related Placer Group No.
    `void` | `addRelatedPlacerGroupNo(java.lang.String strEntityIdentifier, java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Add the Related Placer Group No.
    `void` | `addRelatedPlacerNo(EI objrelatedPlacerNo)` Add the Related Placer No.
    `void` | `addRelatedPlacerNo(java.lang.String strEntityIdentifier, java.lang.String strNamespaceId, java.lang.String strUniversalId, java.lang.String strUniversalIdType)` Add the Related Placer No.
    `ID` | `getCyclicEntryExitIndicator()` Retrieves the Cyclic Entry Exit Indicator.
    `NM` | `getCyclicGroupMaxNoOfRepeats()` Retrieves the Cyclic Group Max No Of Repeats.
    `ISingleCollection<EI>` | `getRelatedFillerNo()` Retrieves the Related Filler No.
    `ISingleCollection<EI>` | `getRelatedPlacerGroupNo()` Retrieves the Related Placer Group No.
    `ISingleCollection<EI>` | `getRelatedPlacerNo()` Retrieves the Related Placer No.
    `ID` | `getSequenceConditionCode()` Retrieves the Sequence Condition Code.
    `CQ` | `getSequenceCondTimeInterval()` Retrieves the Sequence Cond Time Interval.
    `ID` | `getSequenceResultsFlag()` Retrieves the Sequence Results Flag.
    `SI` | `getSetID_TQ2()` Retrieves the Set ID TQ2.
    `ID` | `getSpecialServiceRequestRelationship()` Retrieves the Special Service Request Relationship.
    `void` | `setCyclicEntryExitIndicator(ID objcyclicEntryExitIndicator)` Set the Cyclic Entry Exit Indicator.
    `void` | `setCyclicEntryExitIndicator(java.lang.String strCyclicEntryExitIndicator)` Set the Cyclic Entry Exit Indicator.
    `void` | `setCyclicGroupMaxNoOfRepeats(NM objcyclicGroupMaxNoOfRepeats)` Set the Cyclic Group Max No Of Repeats.
    `void` | `setCyclicGroupMaxNoOfRepeats(java.lang.String strCyclicGroupMaxNoOfRepeats)` Set the Cyclic Group Max No Of Repeats.
    `void` | `setRelatedFillerNo(ISingleCollection<EI> objrelatedFillerNoList)` Set the Related Filler No.
    `void` | `setRelatedPlacerGroupNo(ISingleCollection<EI> objrelatedPlacerGroupNoList)` Set the Related Placer Group No.
    `void` | `setRelatedPlacerNo(ISingleCollection<EI> objrelatedPlacerNoList)` Set the Related Placer No.
    `void` | `setSequenceConditionCode(ID objsequenceConditionCode)` Set the Sequence Condition Code.
    `void` | `setSequenceConditionCode(java.lang.String strSequenceConditionCode)` Set the Sequence Condition Code.
    `void` | `setSequenceCondTimeInterval(CQ objsequenceCondTimeInterval)` Set the Sequence Condition Time Interval.
    `void` | `setSequenceCondTimeInterval(java.lang.String strQuantity, CWE objUnits)` Set the Sequence Condition Time Interval.
    `void` | `setSequenceResultsFlag(ID objsequenceResultsFlag)` Set the Sequence Results Flag.
    `void` | `setSequenceResultsFlag(java.lang.String strSequenceResultsFlag)` Set the Sequence Results Flag.
    `void` | `setSetID_TQ2(SI objsetID_TQ2)` Set the Set ID TQ2.
    `void` | `setSetID_TQ2(java.lang.String strSetID_TQ2)` Set the Set ID TQ2.
    `void` | `setSpecialServiceRequestRelationship(ID objspecialServiceRequestRelationship)` Set the Special Service Request Relationship.
    `void` | `setSpecialServiceRequestRelationship(java.lang.String strSpecialServiceRequestRelationship)` Set the Special Service Request Relationship.
    `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

    - #### TQ2

          public TQ2()

      Constructs the TQ2 segment.

  - ### Method Detail

    - #### getSetID_TQ2

          public SI getSetID_TQ2()

      Retrieves the Set ID TQ2. This field specify the value for timing specification transmitted.
      Returns:
        SI - setID_TQ2

    - #### getSequenceResultsFlag

          public ID getSequenceResultsFlag()

      Retrieves the Sequence Results Flag. This field specify the sequencing relationship between the current service request,and the related service request(s) specified in this TQ2 segment.
      Returns:
        ID - sequenceResultsFlag

    - #### getRelatedPlacerNo

          public ISingleCollection<EI> getRelatedPlacerNo()

      Retrieves the Related Placer No. This field specify the placer numbers of the service request(s) to which this TQ2 segment links the current service request.
      Returns:
        ISingleCollection - relatedPlacerNo

    - #### getRelatedFillerNo

          public ISingleCollection<EI> getRelatedFillerNo()

      Retrieves the Related Filler No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Returns:
        ISingleCollection - relatedFillerNo

    - #### getRelatedPlacerGroupNo

          public ISingleCollection<EI> getRelatedPlacerGroupNo()

      Retrieves the Related Placer Group No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Returns:
        ISingleCollection - relatedPlacerGroupNo

    - #### getSequenceConditionCode

          public ID getSequenceConditionCode()

      Retrieves the Sequence Condition Code. This field specify the start/end of the related service request(s) and the current service request.
      Returns:
        ID - sequenceConditionCode

    - #### getCyclicEntryExitIndicator

          public ID getCyclicEntryExitIndicator()

      Retrieves the Cyclic Entry Exit Indicator. This field specify the number of service request in a cyclic series of service requests.
      Returns:
        ID - cyclicEntryExitIndicator

    - #### getSequenceCondTimeInterval

          public CQ getSequenceCondTimeInterval()

      Retrieves the Sequence Cond Time Interval. This field specify the interval of time between the start/end of the related service request(s) and the start/end of the current service request
      Returns:
        CQ - sequenceCondTimeInterval

    - #### getCyclicGroupMaxNoOfRepeats

          public NM getCyclicGroupMaxNoOfRepeats()

      Retrieves the Cyclic Group Max No Of Repeats. This field specify the maximum number of repeats for a cyclic group.
      Returns:
        NM - cyclicGroupMaxNoOfRepeats

    - #### getSpecialServiceRequestRelationship

          public ID getSpecialServiceRequestRelationship()

      Retrieves the Special Service Request Relationship. This field specify an additional or alternate relationship between this service request and other service requests
      Returns:
        ID - specialServiceRequestRelationship

    - #### setCyclicEntryExitIndicator

          public void setCyclicEntryExitIndicator(java.lang.String strCyclicEntryExitIndicator)

      Set the Cyclic Entry Exit Indicator. This field specify the number of service request in a cyclic series of service requests.
      Parameters:
        `strCyclicEntryExitIndicator` - String which to set as Cyclic Entry Exit Indicator

    - #### setCyclicEntryExitIndicator

          public void setCyclicEntryExitIndicator(ID objcyclicEntryExitIndicator)

      Set the Cyclic Entry Exit Indicator. This field specify the number of service request in a cyclic series of service requests.
      Parameters:
        `objcyclicEntryExitIndicator` - Object of Cyclic Entry Exit Indicator.

    - #### setCyclicGroupMaxNoOfRepeats

          public void setCyclicGroupMaxNoOfRepeats(java.lang.String strCyclicGroupMaxNoOfRepeats)

      Set the Cyclic Group Max No Of Repeats. This field specify the maximum number of repeats for a cyclic group.
      Parameters:
        `strCyclicGroupMaxNoOfRepeats` - String which to set as Group Maximum Number Of Repeats

    - #### setCyclicGroupMaxNoOfRepeats

          public void setCyclicGroupMaxNoOfRepeats(NM objcyclicGroupMaxNoOfRepeats)

      Set the Cyclic Group Max No Of Repeats. This field specify the maximum number of repeats for a cyclic group.
      Parameters:
        `objcyclicGroupMaxNoOfRepeats` - Object of Cyclic Group Max No Of Repeats.

    - #### addRelatedFillerNo

          public void addRelatedFillerNo(java.lang.String strEntityIdentifier,
                                java.lang.String strNamespaceId,
                                java.lang.String strUniversalId,
                                java.lang.String strUniversalIdType)

      Add the Related Filler No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `strEntityIdentifier` - Specifies defined by a hierarchic designator, represented by components 2 through 4. [Reference Section 2.A.33, "HD - hierarchic designator".]
        `strNamespaceId` - Specifies the HL7 identifier for the user-defined table of values for this component. [Refer to User-defined Table 0363 - Assigning authority]
        `strUniversalId` - Specifies string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Specifies the interpretation of the second component of the HD.

    - #### addRelatedFillerNo

          public void addRelatedFillerNo(EI objrelatedFillerNo)

      Add the Related Filler No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `objrelatedFillerNo` - Object of Related Filler No.

    - #### setRelatedFillerNo

          public void setRelatedFillerNo(ISingleCollection<EI> objrelatedFillerNoList)

      Set the Related Filler No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `objrelatedFillerNoList` - List of Related Filler No.

    - #### addRelatedPlacerGroupNo

          public void addRelatedPlacerGroupNo(java.lang.String strEntityIdentifier,
                                     java.lang.String strNamespaceId,
                                     java.lang.String strUniversalId,
                                     java.lang.String strUniversalIdType)

      Add the Related Placer Group No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `strEntityIdentifier` - Specifies defined by a hierarchic designator, represented by components 2 through 4. [Reference Section 2.A.33, "HD - hierarchic designator".]
        `strNamespaceId` - Specifies the HL7 identifier for the user-defined table of values for this component. [Refer to User-defined Table 0363 - Assigning authority]
        `strUniversalId` - Specifies string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Specifies the interpretation of the second component of the HD.

    - #### addRelatedPlacerGroupNo

          public void addRelatedPlacerGroupNo(EI objrelatedPlacerGroupNo)

      Add the Related Placer Group No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `objrelatedPlacerGroupNo` - Object of Related Placer Group No.

    - #### setRelatedPlacerGroupNo

          public void setRelatedPlacerGroupNo(ISingleCollection<EI> objrelatedPlacerGroupNoList)

      Set the Related Placer Group No. This field specify the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `objrelatedPlacerGroupNoList` - List of Related Placer Group No.

    - #### addRelatedPlacerNo

          public void addRelatedPlacerNo(java.lang.String strEntityIdentifier,
                                java.lang.String strNamespaceId,
                                java.lang.String strUniversalId,
                                java.lang.String strUniversalIdType)

      Add the Related Placer No. This field specify the placer numbers of the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `strEntityIdentifier` - Specifies defined by a hierarchic designator, represented by components 2 through 4. [Reference Section 2.A.33, "HD - hierarchic designator".]
        `strNamespaceId` - Specifies the HL7 identifier for the user-defined table of values for this component. [Refer to User-defined Table 0363 - Assigning authority]
        `strUniversalId` - Specifies string formatted according to the scheme defined by the component, (UID type).
        `strUniversalIdType` - Specifies the interpretation of the second component of the HD.

    - #### addRelatedPlacerNo

          public void addRelatedPlacerNo(EI objrelatedPlacerNo)

      Add the Related Placer No. This field specify the placer numbers of the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `objrelatedPlacerNo` - Object of Related Placer No.

    - #### setRelatedPlacerNo

          public void setRelatedPlacerNo(ISingleCollection<EI> objrelatedPlacerNoList)

      Set the Related Placer No. This field specify the placer numbers of the service request(s) to which this TQ2 segment links the current service request.
      Parameters:
        `objrelatedPlacerNoList` - List of Related Placer No.

    - #### setSequenceConditionCode

          public void setSequenceConditionCode(java.lang.String strSequenceConditionCode)

      Set the Sequence Condition Code. This field specify the start/end of the related service request(s) and the current service request.
      Parameters:
        `strSequenceConditionCode` - String which to set as Sequence Condition Code.

    - #### setSequenceConditionCode

          public void setSequenceConditionCode(ID objsequenceConditionCode)

      Set the Sequence Condition Code. This field specify the start/end of the related service request(s) and the current service request.
      Parameters:
        `objsequenceConditionCode` - Object of Sequence Condition Code.

    - #### setSequenceCondTimeInterval

          public void setSequenceCondTimeInterval(java.lang.String strQuantity,
                                         CWE objUnits)

      Set the Sequence Condition Time Interval. This field specify the interval of time between the start/end of the related service request(s) and the start/end of the current service request
      Parameters:
        `strQuantity` - Specifies the numeric quantity or amount of an entity.
        `objUnits` - Specifies the units in which the quantity is expressed.

    - #### setSequenceCondTimeInterval

          public void setSequenceCondTimeInterval(CQ objsequenceCondTimeInterval)

      Set the Sequence Condition Time Interval. This field specify the interval of time between the start/end of the related service request(s) and the start/end of the current service request
      Parameters:
        `objsequenceCondTimeInterval` - Object of Sequence Condition Time Interval.

    - #### setSequenceResultsFlag

          public void setSequenceResultsFlag(java.lang.String strSequenceResultsFlag)

      Set the Sequence Results Flag. This field specify the sequencing relationship between the current service request,and the related service request(s) specified in this TQ2 segment.
      Parameters:
        `strSequenceResultsFlag` - String which to set as Sequence Results Flag

    - #### setSequenceResultsFlag

          public void setSequenceResultsFlag(ID objsequenceResultsFlag)

      Set the Sequence Results Flag. This field specify the sequencing relationship between the current service request,and the related service request(s) specified in this TQ2 segment.
      Parameters:
        `objsequenceResultsFlag` - Object of Sequence Results Flag.

    - #### setSetID_TQ2

          public void setSetID_TQ2(java.lang.String strSetID_TQ2)

      Set the Set ID TQ2. This field specify the value for timing specification transmitted.
      Parameters:
        `strSetID_TQ2` - String which to set as SetID-TQ2

    - #### setSetID_TQ2

          public void setSetID_TQ2(SI objsetID_TQ2)

      Set the Set ID TQ2. This field specify the value for timing specification transmitted.
      Parameters:
        `objsetID_TQ2` - Object of Set ID TQ2.

    - #### setSpecialServiceRequestRelationship

          public void setSpecialServiceRequestRelationship(java.lang.String strSpecialServiceRequestRelationship)

      Set the Special Service Request Relationship. This field specify an additional or alternate relationship between this service request and other service requests
      Parameters:
        `strSpecialServiceRequestRelationship` - String which to set as Special Service Request Relationship

    - #### setSpecialServiceRequestRelationship

          public void setSpecialServiceRequestRelationship(ID objspecialServiceRequestRelationship)

      Set the Special Service Request Relationship. This field specify an additional or alternate relationship between this service request and other service requests
      Parameters:
        `objspecialServiceRequestRelationship` - Object of Special Service Request Relationship.

    - #### 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.