Repeat Pattern (RPT) -- HL7v2 composite data type.
Defines a repeating schedule pattern for timing-related segments (TQ1-3). More expressive than RI, supporting calendar-aligned and phase-based patterns.
10 components per HL7 v2.5.1:
- Repeat Pattern Code (CWE) -- sub-components delimited by
&, Table 0335 - Calendar Alignment (ID) -- Table 0527
- Phase Range Begin Value (NM)
- Phase Range End Value (NM)
- Period Quantity (NM)
- Period Units (IS)
- Institution Specified Time (ID) -- Table 0136 (Y/N)
- Event (ID) -- Table 0528
- Event Offset Quantity (NM)
- Event Offset Units (IS)
Summary
Types
@type t() :: %HL7v2.Type.RPT{ calendar_alignment: binary() | nil, event: binary() | nil, event_offset_quantity: HL7v2.Type.NM.t() | nil, event_offset_units: binary() | nil, institution_specified_time: binary() | nil, period_quantity: HL7v2.Type.NM.t() | nil, period_units: binary() | nil, phase_range_begin_value: HL7v2.Type.NM.t() | nil, phase_range_end_value: HL7v2.Type.NM.t() | nil, repeat_pattern_code: HL7v2.Type.CWE.t() | nil }
Functions
Encodes an RPT to a list of component strings.
Examples
iex> HL7v2.Type.RPT.encode(%HL7v2.Type.RPT{
...> repeat_pattern_code: %HL7v2.Type.CWE{identifier: "QAM", text: "Every morning", name_of_coding_system: "HL70335"}
...> })
["QAM&Every morning&HL70335"]
iex> HL7v2.Type.RPT.encode(%HL7v2.Type.RPT{
...> repeat_pattern_code: %HL7v2.Type.CWE{identifier: "Q6H"},
...> period_quantity: %HL7v2.Type.NM{value: "6", original: "6"},
...> period_units: "h"
...> })
["Q6H", "", "", "", "6", "h"]
iex> HL7v2.Type.RPT.encode(nil)
[]
Parses an RPT from a list of components.
Examples
iex> HL7v2.Type.RPT.parse(["QAM&Every morning&HL70335"])
%HL7v2.Type.RPT{
repeat_pattern_code: %HL7v2.Type.CWE{identifier: "QAM", text: "Every morning", name_of_coding_system: "HL70335"}
}
iex> HL7v2.Type.RPT.parse(["Q6H&Every 6 hours&HL70335", "DY", "", "", "6", "h"])
%HL7v2.Type.RPT{
repeat_pattern_code: %HL7v2.Type.CWE{identifier: "Q6H", text: "Every 6 hours", name_of_coding_system: "HL70335"},
calendar_alignment: "DY",
period_quantity: %HL7v2.Type.NM{value: "6", original: "6"},
period_units: "h"
}
iex> HL7v2.Type.RPT.parse([])
%HL7v2.Type.RPT{}