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

Coded with No Exceptions (CNE) -- HL7v2 composite data type.

Like CWE but requires a valid code. Free text alone (component 9 only)
is NOT permitted. Component 1 (Identifier) is required.

9 components (same layout as CWE):
1. Identifier (ST) -- REQUIRED
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
7. Coding System Version ID (ST)
8. Alternate Coding System Version ID (ST)
9. Original Text (ST)

# `t`

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

# `encode`

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

Encodes a CNE to a list of component strings.

## Examples

    iex> HL7v2.Type.CNE.encode(%HL7v2.Type.CNE{identifier: "F", text: "Female", name_of_coding_system: "HL70001"})
    ["F", "Female", "HL70001"]

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

# `parse`

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

Parses a CNE from a list of components.

## Examples

    iex> HL7v2.Type.CNE.parse(["F", "Female", "HL70001"])
    %HL7v2.Type.CNE{identifier: "F", text: "Female", name_of_coding_system: "HL70001"}

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

---

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