HL7v2.Type.TN (HL7v2 v3.10.1)

Copy Markdown View Source

Telephone Number (TN) -- HL7v2 primitive data type.

Deprecated as of v2.3. Retained for backward compatibility with pre-v2.3 messages. Max 199 characters. Pass-through string storage. Use XTN for new implementations.

Summary

Functions

Encodes a telephone number. Pass-through.

Parses a telephone number string. Pass-through.

Functions

encode(value)

@spec encode(binary() | nil) :: binary()

Encodes a telephone number. Pass-through.

Examples

iex> HL7v2.Type.TN.encode("(555)555-1234")
"(555)555-1234"

iex> HL7v2.Type.TN.encode(nil)
""

parse(value)

@spec parse(binary() | nil) :: binary() | nil

Parses a telephone number string. Pass-through.

Examples

iex> HL7v2.Type.TN.parse("(555)555-1234X5678")
"(555)555-1234X5678"

iex> HL7v2.Type.TN.parse("")
nil

iex> HL7v2.Type.TN.parse(nil)
nil