cdac.medinfo.sdk.hl7282.baselibs.segments

## Class TQ1

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

- All Implemented Interfaces:
    ISegment

      public class TQ1
      extends Segment

  TQ1 - Timing/Quantity Segment.

  This segment is used to specify the complex timing of events and actions such as those that occur in order management and scheduling systems. This segment determines the quantity, frequency, priority, and timing of a service.

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

  TQ1-1: Set ID - TQ1 (SI)Optional
  TQ1-2: Quantity (CQ)Optional
  TQ1-3: Repeat Pattern (RPT)Optional
  TQ1-4: Explicit Time (TM)Optional
  TQ1-5: Relative Time and Units (CQ)Optional
  TQ1-6: Service Duration (CQ)Optional
  TQ1-7: Start date/time (DTM)Optional
  TQ1-8: End date/time (DTM)Optional
  TQ1-9: Priority (CWE)Optional
  TQ1-10: Condition text (TX)Optional
  TQ1-11: Text instruction (TX)Optional
  TQ1-12: Conjunction (ID)Conditional
  TQ1-13: Occurrence duration (CQ)Optional
  TQ1-14: Total occurrence's (NM)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
    `TQ1()` Constructs the TQ1 segment.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addExplicitTime(java.lang.String strExplicitTime)` Add the Explicit Time.
    `void` | `addExplicitTime(TM objexplicitTime)` Add the Explicit Time.
    `void` | `addPriority(CWE objpriority)` Add the Priority.
    `void` | `addPriority(java.lang.String strIdentifier, java.lang.String strText, java.lang.String strNameOfCodingSystem, java.lang.String strAlternateIdentifier, java.lang.String strAlternateText, java.lang.String strNameOfAlternateCodingSystem, java.lang.String strCodingSystemVersionID, java.lang.String strAlternateCodingSystemVersionId, java.lang.String strOriginalText, java.lang.String strSecondAlternateIdentifier, java.lang.String strSecondAlternateText, java.lang.String strNameofSecondAlternateCodingSystem, java.lang.String strSecondAlternateCodingSystemVersionID, java.lang.String strCodingSystemOID, java.lang.String strValueSetOID, java.lang.String strValueSetVersionID, java.lang.String strAlternateCodingSystemOID, java.lang.String strAlternateValueSetOID, java.lang.String strAlternateValueSetVersionID, java.lang.String strSecondAlternateCodingSystemOID, java.lang.String strSecondAlternateValueSetOID, java.lang.String strSecondAlternateValueSetVersionID)` Add the Priority.
    `void` | `addRelativeTimeAndUnits(CQ objrelativeTimeAndUnits)` Add the Relative Time And Units.
    `void` | `addRelativeTimeAndUnits(java.lang.String strQuantity, CWE objUnits)` Add the Relative Time And Units.
    `void` | `addRepeatPattern(CWE objRepeatPatternCode, java.lang.String strCalendarAlignment, java.lang.String strPhaseRangeBeginValue, java.lang.String strPhaseRangeEndValue, java.lang.String strPeriodQuantity, java.lang.String strPeriodUnits, java.lang.String strInstitutionSpecifiedTime, java.lang.String strEvent, java.lang.String strEventOffsetQuantity, java.lang.String strEventOffsetUnits, java.lang.String strGeneralTimingSpecification)` Add the Repeat Pattern.
    `void` | `addRepeatPattern(RPT objrepeatPattern)` Add the Repeat Pattern.
    `TX` | `getConditionText()` Retrieves the Condition Text.
    `ID` | `getConjunction()` Retrieves the Conjunction.
    `DTM` | `getEndDateTime()` Retrieves the End Date Time.
    `ISingleCollection<TM>` | `getExplicitTime()` Retrieves the Explicit Time.
    `CQ` | `getOccurrenceDuration()` Retrieves the Occurrence Duration.
    `ISingleCollection<CWE>` | `getPriority()` Retrieves the Priority.
    `CQ` | `getQuantity()` Retrieves the Quantity.
    `ISingleCollection<CQ>` | `getRelativeTimeAndUnits()` Retrieves the Relative Time And Units.
    `ISingleCollection<RPT>` | `getRepeatPattern()` Retrieves the Repeat Pattern.
    `CQ` | `getServiceDuration()` Retrieves the Service Duration.
    `SI` | `getSetID_TQ1()` Retrieves the Set ID TQ1.
    `DTM` | `getStartDateTime()` Retrieves the Start Date Time.
    `TX` | `getTextInstruction()` Retrieves the Text Instruction.
    `NM` | `getTotalOccurrences()` Retrieves the Total Occurrences.
    `void` | `setConditionText(java.lang.String strConditionText)` Set the Condition Text.
    `void` | `setConditionText(TX objconditionText)` Set the Condition Text.
    `void` | `setConjunction(ID objconjunction)` Set the Conjunction.
    `void` | `setConjunction(java.lang.String strConjunction)` Set the Conjunction.
    `void` | `setEndDateTime(DTM objendDateTime)` Set the End Date Time.
    `void` | `setEndDateTime(java.lang.String strTime)` Set the End Date Time.
    `void` | `setExplicitTime(ISingleCollection<TM> objExplicitTime)` Set the Explicit Time.
    `void` | `setOccurrenceDuration(CQ objoccurrenceDuration)` Set the Occurrence Duration.
    `void` | `setOccurrenceDuration(java.lang.String strQuantity, CWE objUnits)` Set the Occurrence Duration.
    `void` | `setPriority(ISingleCollection<CWE> objPriority)` Set the Priority.
    `void` | `setQuantity(CQ objsetID_TQ1)` Set the Quantity.
    `void` | `setQuantity(java.lang.String strQuantity, CWE objUnits)` Set the Quantity.
    `void` | `setRelativeTimeAndUnits(ISingleCollection<CQ> objRelativeTimeAndUnits)` Set the Relative Time And Units.
    `void` | `setRepeatPattern(ISingleCollection<RPT> objRepeatPattern)` Set the Repeat Pattern.
    `void` | `setServiceDuration(CQ objserviceDuration)` Set the Service Duration.
    `void` | `setServiceDuration(java.lang.String strQuantity, CWE objUnits)` Set the Service Duration.
    `void` | `setSetID_TQ1(SI objsetID_TQ1)` Set the Set ID TQ1.
    `void` | `setSetID_TQ1(java.lang.String strSetID_TQ1)` Set the Set ID TQ1.
    `void` | `setStartDateTime(DTM objstartDateTime)` Set the Start Date Time.
    `void` | `setStartDateTime(java.lang.String strTime)` Set the Start Date Time.
    `void` | `setTextInstruction(java.lang.String strTextInstruction)` Set the Text Instruction.
    `void` | `setTextInstruction(TX objtextInstruction)` Set the Text Instruction.
    `void` | `setTotalOccurrences(NM objtotalOccurrences)` Set the Total Occurrences.
    `void` | `setTotalOccurrences(java.lang.String strTotalOccurrences)` Set the Total Occurrences.
    `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

    - #### TQ1

          public TQ1()

      Constructs the TQ1 segment.

  - ### Method Detail

    - #### getSetID_TQ1

          public SI getSetID_TQ1()

      Retrieves the Set ID TQ1.
      Returns:
        String - setID_TQ1

    - #### getQuantity

          public CQ getQuantity()

      Retrieves the Quantity. This field specify the numeric quantity of the service that should be provided at each service interval.
      Returns:
        CQ - quantity

    - #### getRepeatPattern

          public ISingleCollection<RPT> getRepeatPattern()

      Retrieves the Repeat Pattern. This specify the repeating frequency with which the treatment is to be administered.
      Returns:
        ISingleCollection - repeatPattern

    - #### getExplicitTime

          public ISingleCollection<TM> getExplicitTime()

      Retrieves the Explicit Time.
      Returns:
        ISingleCollection - explicitTime

    - #### getRelativeTimeAndUnits

          public ISingleCollection<CQ> getRelativeTimeAndUnits()

      Retrieves the Relative Time And Units. This field specify the interval between schedules for service request or bottle records. If this field contains a value.
      Returns:
        ISingleCollection - relativeTimeAndUnits

    - #### getServiceDuration

          public CQ getServiceDuration()

      Retrieves the Service Duration.
      Returns:
        CQ - serviceDuration

    - #### getStartDateTime

          public DTM getStartDateTime()

      Retrieves the Start Date Time.
      Returns:
        DTM - startDateTime

    - #### getEndDateTime

          public DTM getEndDateTime()

      Retrieves the End Date Time.
      Returns:
        DTM - endDateTime

    - #### getConditionText

          public TX getConditionText()

      Retrieves the Condition Text. This field specify the conditions under which the drug is to be given.
      Returns:
        String - conditionText

    - #### getTextInstruction

          public TX getTextInstruction()

      Retrieves the Text Instruction.
      Returns:
        String - textInstruction

    - #### getConjunction

          public ID getConjunction()

      Retrieves the Conjunction.
      Returns:
        ID - conjunction

    - #### getOccurrenceDuration

          public CQ getOccurrenceDuration()

      Retrieves the Occurrence Duration. This field specify the duration for which a single performance of a service is requested.
      Returns:
        CQ - occurrenceDuration

    - #### getTotalOccurrences

          public NM getTotalOccurrences()

      Retrieves the Total Occurrences. This field specify the total number of occurrences of a service that should result from this service request.
      Returns:
        String - totalOccurrences

    - #### getPriority

          public ISingleCollection<CWE> getPriority()

      Retrieves the Priority. This field specify the urgency of the request.
      Returns:
        String - totalOccurrences

    - #### setSetID_TQ1

          public void setSetID_TQ1(java.lang.String strSetID_TQ1)

      Set the Set ID TQ1.
      Parameters:
        `strSetID_TQ1` - Specifies sequence number for timing specification transmitted.

    - #### setSetID_TQ1

          public void setSetID_TQ1(SI objsetID_TQ1)

      Set the Set ID TQ1.
      Parameters:
        `objsetID_TQ1` - Object of Set ID TQ1.

    - #### setQuantity

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

      Set the Quantity. This field specify the numeric quantity of the service that should be provided at each service interval.
      Parameters:
        `strQuantity` - Specifies the numeric quantity or amount of an entity.
        `objUnits` - Specifies the units in which the quantity is expressed.

    - #### setQuantity

          public void setQuantity(CQ objsetID_TQ1)

      Set the Quantity. This field specify the numeric quantity of the service that should be provided at each service interval.
      Parameters:
        `objsetID_TQ1` - Object of Quantity.

    - #### addRepeatPattern

          public void addRepeatPattern(CWE objRepeatPatternCode,
                              java.lang.String strCalendarAlignment,
                              java.lang.String strPhaseRangeBeginValue,
                              java.lang.String strPhaseRangeEndValue,
                              java.lang.String strPeriodQuantity,
                              java.lang.String strPeriodUnits,
                              java.lang.String strInstitutionSpecifiedTime,
                              java.lang.String strEvent,
                              java.lang.String strEventOffsetQuantity,
                              java.lang.String strEventOffsetUnits,
                              java.lang.String strGeneralTimingSpecification)

      Add the Repeat Pattern. This specify the repeating frequency with which the treatment is to be administered.
      Parameters:
        `objRepeatPatternCode` - Represents the repeat pattern defined by the other components of this data type. Refer to User-defined Table 335 - Repeat Pattern for suggested values.
        `strCalendarAlignment` - Use as CalendarAlignment.
        `strPhaseRangeBeginValue` - Use as PhaseRangeBeginValue
        `strPhaseRangeEndValue` - Use as PhaseRangeEndValue.
        `strPeriodQuantity` - Use as PeriodQuantity.
        `strPeriodUnits` - Use as PeriodUnits.
        `strInstitutionSpecifiedTime` - Use as InstitutionSpecifiedTime.
        `strEvent` - Use as Event.
        `strEventOffsetQuantity` - Use as EventOffsetQuantity.
        `strEventOffsetUnits` - Use as EventOffsetUnits.
        `strGeneralTimingSpecification` - Use as GeneralTimingSpecification.

    - #### addRepeatPattern

          public void addRepeatPattern(RPT objrepeatPattern)

      Add the Repeat Pattern. This specify the repeating frequency with which the treatment is to be administered.
      Parameters:
        `objrepeatPattern` - Object of Repeat Pattern.

    - #### setRepeatPattern

          public void setRepeatPattern(ISingleCollection<RPT> objRepeatPattern)

      Set the Repeat Pattern. This specify the repeating frequency with which the treatment is to be administered.
      Parameters:
        `objRepeatPattern` - List of RepeatPattern.

    - #### addExplicitTime

          public void addExplicitTime(java.lang.String strExplicitTime)

      Add the Explicit Time.
      Parameters:
        `strExplicitTime` - Use as ExplicitTime.

    - #### addExplicitTime

          public void addExplicitTime(TM objexplicitTime)

      Add the Explicit Time.
      Parameters:
        `objexplicitTime` - Object of Explicit Time.

    - #### setExplicitTime

          public void setExplicitTime(ISingleCollection<TM> objExplicitTime)

      Set the Explicit Time.
      Parameters:
        `objExplicitTime` - List of Explicit Time.

    - #### addRelativeTimeAndUnits

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

      Add the Relative Time And Units. This field specify the interval between schedules for service request or bottle records. If this field contains a value.
      Parameters:
        `strQuantity` - Specifies the numeric quantity or amount of an entity.
        `objUnits` - Specifies the units in which the quantity is expressed.

    - #### addRelativeTimeAndUnits

          public void addRelativeTimeAndUnits(CQ objrelativeTimeAndUnits)

      Add the Relative Time And Units. This field specify the interval between schedules for service request or bottle records. If this field contains a value.
      Parameters:
        `objrelativeTimeAndUnits` - Object of Relative Time And Units.

    - #### setRelativeTimeAndUnits

          public void setRelativeTimeAndUnits(ISingleCollection<CQ> objRelativeTimeAndUnits)

      Set the Relative Time And Units. This field specify the interval between schedules for service request or bottle records. If this field contains a value.
      Parameters:
        `objRelativeTimeAndUnits` - List of Relative Time And Units.

    - #### setServiceDuration

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

      Set the Service Duration.
      Parameters:
        `strQuantity` - Use as Quantity
        `objUnits` - Use as Units

    - #### setServiceDuration

          public void setServiceDuration(CQ objserviceDuration)

      Set the Service Duration.
      Parameters:
        `objserviceDuration` - Object of Service Duration.

    - #### setStartDateTime

          public void setStartDateTime(java.lang.String strTime)

      Set the Start Date Time.
      Parameters:
        `strTime` - Specifies a point in time using a 24-hour clock notation.

    - #### setStartDateTime

          public void setStartDateTime(DTM objstartDateTime)

      Set the Start Date Time.
      Parameters:
        `objstartDateTime` - Object of Start Date Time.

    - #### setEndDateTime

          public void setEndDateTime(java.lang.String strTime)

      Set the End Date Time.
      Parameters:
        `strTime` - Specifies a point in time using a 24-hour clock notation.

    - #### setEndDateTime

          public void setEndDateTime(DTM objendDateTime)

      Set the End Date Time.
      Parameters:
        `objendDateTime` - Object of End Date Time.

    - #### addPriority

          public void addPriority(java.lang.String strIdentifier,
                         java.lang.String strText,
                         java.lang.String strNameOfCodingSystem,
                         java.lang.String strAlternateIdentifier,
                         java.lang.String strAlternateText,
                         java.lang.String strNameOfAlternateCodingSystem,
                         java.lang.String strCodingSystemVersionID,
                         java.lang.String strAlternateCodingSystemVersionId,
                         java.lang.String strOriginalText,
                         java.lang.String strSecondAlternateIdentifier,
                         java.lang.String strSecondAlternateText,
                         java.lang.String strNameofSecondAlternateCodingSystem,
                         java.lang.String strSecondAlternateCodingSystemVersionID,
                         java.lang.String strCodingSystemOID,
                         java.lang.String strValueSetOID,
                         java.lang.String strValueSetVersionID,
                         java.lang.String strAlternateCodingSystemOID,
                         java.lang.String strAlternateValueSetOID,
                         java.lang.String strAlternateValueSetVersionID,
                         java.lang.String strSecondAlternateCodingSystemOID,
                         java.lang.String strSecondAlternateValueSetOID,
                         java.lang.String strSecondAlternateValueSetVersionID)

      Add the Priority. This field specify the urgency of the request.
      Parameters:
        `strIdentifier` - Specifies of characters (the code) that uniquely identifies the item being referenced.
        `strText` - Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction.
        `strNameOfCodingSystem` - Identifies the coding scheme being used in the identifier component.
        `strAlternateIdentifier` - Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
        `strAlternateText` - Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
        `strNameOfAlternateCodingSystem` - Identifies the coding scheme being used in the alternate identifier component.
        `strCodingSystemVersionID` - A sequence of characters that uniquely identifies a second alternate code.
        `strAlternateCodingSystemVersionId` - This component carries the version for the coding system identified by components 4-6.
        `strOriginalText` - The text as seen and/or selected by the user who entered the data.
        `strSecondAlternateIdentifier` - A sequence of characters that uniquely identifies a second alternate code.
        `strSecondAlternateText` - The descriptive or textual name of the alternate identifier.
        `strNameofSecondAlternateCodingSystem` - Identifies the coding scheme being used in the alternate identifier component.
        `strSecondAlternateCodingSystemVersionID` - This component carries the version for the coding system identified by components 10-12.
        `strCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
        `strValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
        `strValueSetVersionID` - This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
        `strAlternateCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
        `strAlternateValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
        `strAlternateValueSetVersionID` - This component carries the version for the value set identified by CWE.18. The version is a date.
        `strSecondAlternateCodingSystemOID` - This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
        `strSecondAlternateValueSetOID` - This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
        `strSecondAlternateValueSetVersionID` - This component carries the version for the value set identified by CWE.21. The version is a date.

    - #### addPriority

          public void addPriority(CWE objpriority)

      Add the Priority. This field specify the urgency of the request.
      Parameters:
        `objpriority` - Object of Priority.

    - #### setPriority

          public void setPriority(ISingleCollection<CWE> objPriority)

      Set the Priority. This field specify the urgency of the request.
      Parameters:
        `objPriority` - List of Priority.

    - #### setConditionText

          public void setConditionText(java.lang.String strConditionText)

      Set the Condition Text. This field specify the conditions under which the drug is to be given.
      Parameters:
        `strConditionText` - Use as ConditionText

    - #### setConditionText

          public void setConditionText(TX objconditionText)

      Set the Condition Text. This field specify the conditions under which the drug is to be given.
      Parameters:
        `objconditionText` - Object of Condition Text.

    - #### setTextInstruction

          public void setTextInstruction(java.lang.String strTextInstruction)

      Set the Text Instruction.
      Parameters:
        `strTextInstruction` - Use as TextInstruction.

    - #### setTextInstruction

          public void setTextInstruction(TX objtextInstruction)

      Set the Text Instruction.
      Parameters:
        `objtextInstruction` - Object of Text Instruction.

    - #### setConjunction

          public void setConjunction(java.lang.String strConjunction)

      Set the Conjunction.
      Parameters:
        `strConjunction` - Use as Conjunction.

    - #### setConjunction

          public void setConjunction(ID objconjunction)

      Set the Conjunction.
      Parameters:
        `objconjunction` - Object of Conjunction.

    - #### setOccurrenceDuration

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

      Set the Occurrence Duration. This field specify the duration for which a single performance of a service is requested.
      Parameters:
        `strQuantity` - Specifies the numeric quantity or amount of an entity.
        `objUnits` - Specifies the units in which the quantity is expressed.

    - #### setOccurrenceDuration

          public void setOccurrenceDuration(CQ objoccurrenceDuration)

      Set the Occurrence Duration. This field specify the duration for which a single performance of a service is requested.
      Parameters:
        `objoccurrenceDuration` - Object of Occurrence Duration.

    - #### setTotalOccurrences

          public void setTotalOccurrences(java.lang.String strTotalOccurrences)

      Set the Total Occurrences. This field specify the total number of occurrences of a service that should result from this service request.
      Parameters:
        `strTotalOccurrences` - Contains the total number of occurrences of a service that should result from this service request.

    - #### setTotalOccurrences

          public void setTotalOccurrences(NM objtotalOccurrences)

      Set the Total Occurrences. This field specify the total number of occurrences of a service that should result from this service request.
      Parameters:
        `objtotalOccurrences` - Object of Total Occurrences.

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