HL7v2.Type.SPD (HL7v2 v3.10.1)

Copy Markdown View Source

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)

Summary

Functions

Encodes an SPD to a list of component strings.

Parses an SPD from a list of components.

Types

t()

@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
}

Functions

encode(spd)

@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(components)

@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{}