Extended Telecommunication Number (XTN) -- HL7v2 composite data type.
12 components:
- Telephone Number (ST) -- deprecated
- Telecommunication Use Code (ID) -- Table 0201: PRN, WPN, NET, etc.
- Telecommunication Equipment Type (ID) -- Table 0202: PH, FX, CP, Internet, etc.
- Email Address (ST)
- Country Code (NM)
- Area/City Code (NM)
- Local Number (NM)
- Extension (NM)
- Any Text (ST)
- Extension Prefix (ST)
- Speed Dial Code (ST)
- Unformatted Telephone Number (ST)
Summary
Types
@type t() :: %HL7v2.Type.XTN{ any_text: binary() | nil, area_code: binary() | nil, country_code: binary() | nil, email_address: binary() | nil, extension: binary() | nil, extension_prefix: binary() | nil, local_number: binary() | nil, speed_dial_code: binary() | nil, telecom_equipment_type: binary() | nil, telecom_use_code: binary() | nil, telephone_number: binary() | nil, unformatted_telephone_number: binary() | nil }
Functions
Encodes an XTN to a list of component strings.
Examples
iex> HL7v2.Type.XTN.encode(%HL7v2.Type.XTN{telecom_use_code: "NET", telecom_equipment_type: "Internet", email_address: "john@example.com"})
["", "NET", "Internet", "john@example.com"]
iex> HL7v2.Type.XTN.encode(nil)
[]
Parses an XTN from a list of components.
Examples
iex> HL7v2.Type.XTN.parse(["", "PRN", "PH", "", "34", "961", "123456", "789"])
%HL7v2.Type.XTN{
telecom_use_code: "PRN",
telecom_equipment_type: "PH",
country_code: "34",
area_code: "961",
local_number: "123456",
extension: "789"
}
iex> HL7v2.Type.XTN.parse(["", "NET", "Internet", "john@example.com"])
%HL7v2.Type.XTN{
telecom_use_code: "NET",
telecom_equipment_type: "Internet",
email_address: "john@example.com"
}
iex> HL7v2.Type.XTN.parse([])
%HL7v2.Type.XTN{}