HL7v2.Type.DLD (HL7v2 v3.10.1)

Copy Markdown View Source

Discharge to Location and Date (DLD) -- HL7v2 composite data type.

Used to convey the location where a patient is discharged to and the effective date of discharge.

2 components:

  1. Discharge to Location (IS) -- Table 0113
  2. Effective Date (TS) -- sub-components delimited by &

Summary

Functions

Encodes a DLD to a list of component strings.

Parses a DLD from a list of components.

Types

t()

@type t() :: %HL7v2.Type.DLD{
  discharge_to_location: binary() | nil,
  effective_date: HL7v2.Type.TS.t() | nil
}

Functions

encode(dld)

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

Encodes a DLD to a list of component strings.

Examples

iex> HL7v2.Type.DLD.encode(%HL7v2.Type.DLD{discharge_to_location: "HOME"})
["HOME"]

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

parse(components)

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

Parses a DLD from a list of components.

Examples

iex> HL7v2.Type.DLD.parse(["HOME"])
%HL7v2.Type.DLD{discharge_to_location: "HOME"}

iex> HL7v2.Type.DLD.parse(["HOME", "20260322"])
%HL7v2.Type.DLD{discharge_to_location: "HOME", effective_date: %HL7v2.Type.TS{time: %HL7v2.Type.DTM{year: 2026, month: 3, day: 22}}}

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