# `HL7v2.Type.TN`
[🔗](https://github.com/Balneario-de-Cofrentes/hl7v2/blob/v3.10.1/lib/hl7v2/type/tn.ex#L1)

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.

# `encode`

```elixir
@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`

```elixir
@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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
