HL7v2.Type.DLN (HL7v2 v3.10.1)

Copy Markdown View Source

Driver's License Number (DLN) -- HL7v2 composite data type.

Used for driver's license identification.

3 components:

  1. License Number (ST)
  2. Issuing State, Province, Country (IS) -- Table 0333
  3. Expiration Date (DT)

Summary

Functions

Encodes a DLN to a list of component strings.

Parses a DLN from a list of components.

Types

t()

@type t() :: %HL7v2.Type.DLN{
  expiration_date: Date.t() | HL7v2.Type.DT.t() | nil,
  issuing_state_province_country: binary() | nil,
  license_number: binary() | nil
}

Functions

encode(dln)

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

Encodes a DLN to a list of component strings.

Examples

iex> HL7v2.Type.DLN.encode(%HL7v2.Type.DLN{license_number: "S12345678", issuing_state_province_country: "CA", expiration_date: ~D[2028-01-01]})
["S12345678", "CA", "20280101"]

iex> HL7v2.Type.DLN.encode(%HL7v2.Type.DLN{license_number: "S12345678"})
["S12345678"]

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

parse(components)

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

Parses a DLN from a list of components.

Examples

iex> HL7v2.Type.DLN.parse(["S12345678", "CA", "20280101"])
%HL7v2.Type.DLN{license_number: "S12345678", issuing_state_province_country: "CA", expiration_date: ~D[2028-01-01]}

iex> HL7v2.Type.DLN.parse(["S12345678", "CA"])
%HL7v2.Type.DLN{license_number: "S12345678", issuing_state_province_country: "CA"}

iex> HL7v2.Type.DLN.parse(["S12345678"])
%HL7v2.Type.DLN{license_number: "S12345678"}

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