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

Specialty Description (SPD) -- HL7v2 composite data type.

Describes a practitioner's specialty or board certification.

4 components:
1. Specialty Name (ST)
2. Governing Board (ST)
3. Eligible or Certified (ID) -- C (certified), E (eligible)
4. Date of Certification (DT)

# `t`

```elixir
@type t() :: %HL7v2.Type.SPD{
  date_of_certification: Date.t() | HL7v2.Type.DT.t() | nil,
  eligible_or_certified: binary() | nil,
  governing_board: binary() | nil,
  specialty_name: binary() | nil
}
```

# `encode`

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

Encodes an SPD to a list of component strings.

## Examples

    iex> HL7v2.Type.SPD.encode(%HL7v2.Type.SPD{specialty_name: "Cardiology", governing_board: "ABIM", eligible_or_certified: "C", date_of_certification: ~D[2020-06-01]})
    ["Cardiology", "ABIM", "C", "20200601"]

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

# `parse`

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

Parses an SPD from a list of components.

## Examples

    iex> HL7v2.Type.SPD.parse(["Cardiology", "ABIM", "C", "20200601"])
    %HL7v2.Type.SPD{specialty_name: "Cardiology", governing_board: "ABIM", eligible_or_certified: "C", date_of_certification: ~D[2020-06-01]}

    iex> HL7v2.Type.SPD.parse(["Internal Medicine"])
    %HL7v2.Type.SPD{specialty_name: "Internal Medicine"}

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

---

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