The TQ2 (Timing/Quantity Relationship) segment expresses how one order relates in time and sequence to other orders. Where the TQ1 segment carries the timing and quantity of a single order, TQ2 links that order to related orders — by placer, filler, or placer group number — and states the condition that governs when this order may start relative to them. It is the relationship companion to TQ1 within an order message.
Purpose
TQ2 communicates inter-order timing and sequencing. It allows an order to declare that it should run, for example, only after a related order completes, or as part of a cyclic group that repeats a fixed number of times. It does this by referencing the related placer number, filler number, and placer group number, then applying a sequence condition code, a cyclic entry/exit indicator, a sequence condition time interval, a cyclic group maximum number of repeats, and the relationship of the special service request to its companions.
This makes TQ2 the mechanism for modeling dependencies such as "draw specimen B fifteen minutes after specimen A" or "repeat this cycle three times," without conflating that relationship with the standalone timing carried in TQ1.
Used in
TQ2 appears in order messages such as ORM and OML, positioned immediately after the TQ1 segment to express the timing relationship between this order and other orders. It operates within the order group anchored by the ORC segment and an OBR, where TQ1 states the order's own timing and TQ2 ties it to its siblings or predecessors.
Field-by-field reference
Source: HAPI HL7v2 v2.5.1 javadocs (TQ2 javadoc) for sequence, name, data type, and repetition. Length is not published in the javadocs (—); Required and Table # are filled from the HL7 v2.5.1 standard where well-established.
| Seq | Name | Data Type | Length | Req | Repeat | Table # | Description |
|---|---|---|---|---|---|---|---|
| TQ2-1 | Set ID - TQ2 | si | — | R | — | — | Sequence number for this TQ2 instance |
| TQ2-2 | Sequence/Results Flag | id | — | O | — | HL70503 | How sequenced orders relate to one another |
| TQ2-3 | Related Placer Number | ei | — | O | Y | — | Placer numbers of related orders |
| TQ2-4 | Related Filler Number | ei | — | O | Y | — | Filler numbers of related orders |
| TQ2-5 | Related Placer Group Number | ei | — | O | Y | — | Placer group numbers of related orders |
| TQ2-6 | Sequence Condition Code | id | — | O | — | HL70504 | Condition governing the order sequence |
| TQ2-7 | Cyclic Entry/Exit Indicator | id | — | O | — | HL70505 | Marks first or last service in a cycle |
| TQ2-8 | Sequence Condition Time Interval | cq | — | O | — | — | Time interval applied to the sequence condition |
| TQ2-9 | Cyclic Group Maximum Number of Repeats | nm | — | O | — | — | Maximum repeats for the cyclic group |
| TQ2-10 | Special Service Request Relationship | id | — | O | — | HL70506 | Relationship of this request to companions |
Most-used fields
The fields that carry the relationship intent are:
- TQ2-1 Set ID - TQ2 — the required sequence number that orders multiple TQ2 instances within the order.
- TQ2-3, TQ2-4, TQ2-5 Related numbers — the placer, filler, and placer group references that identify which orders this one relates to; all three repeat.
- TQ2-6 Sequence Condition Code — the coded condition (for example, start-on-completion) that drives the dependency.
- TQ2-7 Cyclic Entry/Exit Indicator — marks an order as the entry or exit point of a cyclic group.
- TQ2-9 Cyclic Group Maximum Number of Repeats — caps how many times a cyclic group repeats.
Version differences (2.3 to 2.8.2)
TQ2 did not exist in v2.3 or v2.4, where order timing was expressed through the now-deprecated TQ component of OBR-27 (Quantity/Timing). The TQ1/TQ2 pair was introduced in HL7 v2.5 to replace that overloaded field, and TQ2 specifically carries the inter-order relationship that the old TQ structure expressed poorly. The 10-field structure shown here is stable across v2.5, v2.5.1, v2.6, v2.7, and into v2.8.x, with later versions clarifying table bindings rather than changing the field roster. When bridging from v2.3/v2.4 systems, the legacy OBR-27 timing must be decomposed into TQ1 and TQ2; conversely, when sending to those older systems, TQ2 relationships must be folded back into the legacy quantity/timing field, which often cannot represent them fully.
Common mistakes
- Placing TQ2 before TQ1. TQ2 must follow TQ1 in the order group; the timing of the order itself is stated first, then its relationship to others.
- Omitting TQ2-1. The Set ID is required; multiple TQ2 instances cannot be ordered correctly without it.
- Putting multiple related orders in one repetition. TQ2-3, TQ2-4, and TQ2-5 are repeating fields; each related order should be a separate repetition rather than a delimited blob in one.
- Sending free text in TQ2-6. The Sequence Condition Code is ID-typed against table HL70504; arbitrary values will fail strict validation.
- Confusing the time interval with TQ1 timing. TQ2-8 is the interval that qualifies the sequence condition (the gap between related orders), not the order's own duration, which belongs in TQ1.
Examples
Minimal TQ2 with only the required Set ID and a simple start-after-completion condition:
TQ2|1||PLC10042^MAIN^L||||EA
Fully-populated TQ2 expressing a cyclic relationship with a time interval and repeat cap:
TQ2|1|S|PLC10042^MAIN^L|FLR55218^LAB^L|PGRP7781^MAIN^L|EA|*|15^min|3|S
Annotated breakdown:
TQ2|1|S|PLC10042^MAIN^L|FLR55218^LAB^L|PGRP7781^MAIN^L|EA|*|15^min|3|S
| | | | | | | | | |
| | | | | | | | | +-> TQ2-10 Special Service Request Relationship
| | | | | | | | +---> TQ2-9 Cyclic Group Max Number of Repeats (3)
| | | | | | | +---------> TQ2-8 Sequence Condition Time Interval (15 min)
| | | | | | +-----------> TQ2-7 Cyclic Entry/Exit Indicator (*)
| | | | | +--------------> TQ2-6 Sequence Condition Code (EA = on completion)
| | | | +------------------------------> TQ2-5 Related Placer Group Number
| | | +----------------------------------------------> TQ2-4 Related Filler Number
| | +-------------------------------------------------------------> TQ2-3 Related Placer Number
| +---------------------------------------------------------------> TQ2-2 Sequence/Results Flag (S)
+-----------------------------------------------------------------> TQ2-1 Set ID - TQ2
In-context excerpt 1 — TQ2 after TQ1 inside an OML^O21 laboratory order, sequencing a second draw after the first:
MSH|^~&|CPOE|MAINHOSP|LAB|MAINLAB|20260610081500||OML^O21^OML_O21|MSG00440|P|2.5.1
PID|1||MRN772841^^^MAINHOSP^MR||Rivera^Dolores^^^^^L||19590312|F
ORC|NW|PLC10043^MAIN^L|||||^^^20260610090000
OBR|1|PLC10043^MAIN^L||1742-6^ALT^LN
TQ1|1|||||^^^20260610090000
TQ2|1|S|PLC10042^MAIN^L|||EA|||15^min
In-context excerpt 2 — TQ2 inside an ORM^O01 order expressing a cyclic group that repeats three times:
MSH|^~&|CPOE|MAINHOSP|PHARM|MAINPHARM|20260610074500||ORM^O01^ORM_O01|MSG00451|P|2.5.1
PID|1||MRN551209^^^MAINHOSP^MR||Okafor^Samuel^^^^^L||19740825|M
ORC|NW|PLC20881^MAIN^L|||||1^Q8H^^20260610080000
OBR|1|PLC20881^MAIN^L||5811-5^Urinalysis^LN
TQ1|1|1|||Q8H||20260610080000
TQ2|1|C|PLC20880^MAIN^L|||EA|*|8^hr|3|S
FHIR mapping
No segment-level ConceptMap is published in the HL7 v2-to-FHIR Implementation Guide for TQ2. Conceptually, TQ2 expresses a timing relationship between orders and is part of a request's Timing in FHIR terms. The related placer, filler, and group numbers correspond to ServiceRequest.basedOn or ServiceRequest relationships between sibling or dependent requests, while the sequence condition and cyclic repeat information align with the Timing structure of the governing request. Because TQ2 describes a relationship across requests rather than a single discrete resource, no normalized one-to-one mapping is defined.
Engine considerations
- TQ2 must be modeled as following TQ1 within the order group; engines should preserve that ordering when routing or transforming order messages.
- TQ2-3, TQ2-4, and TQ2-5 are repeating EI fields; engines that collapse repetitions will lose individual related-order references.
- TQ2-2, TQ2-6, TQ2-7, and TQ2-10 are ID-typed against bound tables (HL70503, HL70504, HL70505, HL70506); strict validators reject out-of-table values.
- TQ2-8 is a CQ (composite quantity with units); keep the quantity and units components together when transforming.
- When converting to or from pre-v2.5 systems, TQ2 relationships have no clean home in the legacy OBR-27 quantity/timing field; engines must apply explicit mapping logic rather than assume a lossless round-trip.
- Length is not published in the javadocs, so do not enforce javadoc-derived field-length limits; defer to the HL7 v2.5.1 standard.
How Vorro parses and produces TQ2
On ingest, Vorro reads TQ2 in its required position after TQ1 and links it to the surrounding order using the ORC and OBR context. The repeating related-number fields (TQ2-3, TQ2-4, TQ2-5) are parsed into normalized collections so each related placer, filler, and group reference is retained independently. The ID-typed condition fields are validated against their bound tables and surfaced as coded relationship attributes, and TQ2-8 is parsed as a structured quantity-with-units.
When producing TQ2, Vorro emits TQ2-1 as a sequential Set ID, then renders each related-number collection as discrete field repetitions rather than a single concatenated value. The sequence condition code, cyclic entry/exit indicator, and special service request relationship are emitted as normalized table values, and the sequence condition time interval is reconstructed from its structured quantity representation. Unset optional fields are left empty so the produced segment carries only the relationships that were actually defined, preserving the ordering of TQ1 then TQ2 within the order group.
