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

Insurance Certification Definition (ICD) -- HL7v2 composite data type.

Specifies pre-certification requirements for insurance claims.

3 components:
1. Certification Patient Type (IS) -- Table 0150: e.g., "ER" (emergency), "IPE" (inpatient elective)
2. Certification Required (ID) -- Table 0136 (Y/N): "Y" or "N"
3. Date/Time Certification Required (TS) -- when certification is needed by

# `t`

```elixir
@type t() :: %HL7v2.Type.ICD{
  certification_patient_type: binary() | nil,
  certification_required: binary() | nil,
  date_time_certification_required: HL7v2.Type.TS.t() | nil
}
```

# `encode`

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

Encodes an ICD to a list of component strings.

## Examples

    iex> HL7v2.Type.ICD.encode(%HL7v2.Type.ICD{certification_patient_type: "ER", certification_required: "Y"})
    ["ER", "Y"]

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

# `parse`

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

Parses an ICD from a list of components.

## Examples

    iex> HL7v2.Type.ICD.parse(["ER", "Y", "20260101"])
    %HL7v2.Type.ICD{
      certification_patient_type: "ER",
      certification_required: "Y",
      date_time_certification_required: %HL7v2.Type.TS{time: %HL7v2.Type.DTM{year: 2026, month: 1, day: 1}}
    }

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

---

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