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

Coded Element (CE) -- HL7v2 composite data type.

Deprecated as of v2.5. Retained for backward compatibility.
Use CWE or CNE for new implementations.

6 components:
1. Identifier (ST)
2. Text (ST)
3. Name of Coding System (ID) -- Table 0396
4. Alternate Identifier (ST)
5. Alternate Text (ST)
6. Name of Alternate Coding System (ID) -- Table 0396

# `t`

```elixir
@type t() :: %HL7v2.Type.CE{
  alternate_identifier: binary() | nil,
  alternate_text: binary() | nil,
  identifier: binary() | nil,
  name_of_alternate_coding_system: binary() | nil,
  name_of_coding_system: binary() | nil,
  text: binary() | nil
}
```

# `encode`

```elixir
@spec encode(t() | nil) :: list()
```

Encodes a CE to a list of component strings.

## Examples

    iex> HL7v2.Type.CE.encode(%HL7v2.Type.CE{identifier: "784.0", text: "Headache", name_of_coding_system: "I9C"})
    ["784.0", "Headache", "I9C"]

    iex> HL7v2.Type.CE.encode(nil)
    []

# `parse`

```elixir
@spec parse(list()) :: t()
```

Parses a CE from a list of components.

## Examples

    iex> HL7v2.Type.CE.parse(["784.0", "Headache", "I9C"])
    %HL7v2.Type.CE{identifier: "784.0", text: "Headache", name_of_coding_system: "I9C"}

    iex> HL7v2.Type.CE.parse([])
    %HL7v2.Type.CE{}

---

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