Repeat Interval (RI) -- HL7v2 composite data type.
Specifies the interval between repeated services. Used in TQ-2 (Timing/Quantity interval component).
2 components:
- Repeat Pattern (IS) -- coded pattern, e.g., "Q6H", "BID", "TID"
- Explicit Time Interval (ST) -- explicit interval, e.g., "Q2H", "300S"
Summary
Types
Functions
Encodes an RI to a list of component strings.
Examples
iex> HL7v2.Type.RI.encode(%HL7v2.Type.RI{repeat_pattern: "Q6H", explicit_time_interval: "6 hours"})
["Q6H", "6 hours"]
iex> HL7v2.Type.RI.encode(%HL7v2.Type.RI{repeat_pattern: "BID"})
["BID"]
iex> HL7v2.Type.RI.encode(nil)
[]
Parses an RI from a list of components.
Examples
iex> HL7v2.Type.RI.parse(["Q6H", "6 hours"])
%HL7v2.Type.RI{repeat_pattern: "Q6H", explicit_time_interval: "6 hours"}
iex> HL7v2.Type.RI.parse(["BID"])
%HL7v2.Type.RI{repeat_pattern: "BID"}
iex> HL7v2.Type.RI.parse([])
%HL7v2.Type.RI{}