HL7v2.Type.DTN (HL7v2 v3.10.1)

Copy Markdown View Source

Day Type and Number (DTN) -- HL7v2 composite data type.

Specifies a day type and the number of days for insurance certification.

2 components:

  1. Day Type (IS) -- Table 0149: e.g., "AP" (approved), "DE" (denied), "PE" (pending)
  2. Number of Days (NM) -- the number of days

Summary

Functions

Encodes a DTN to a list of component strings.

Parses a DTN from a list of components.

Types

t()

@type t() :: %HL7v2.Type.DTN{
  day_type: binary() | nil,
  number_of_days: HL7v2.Type.NM.t() | nil
}

Functions

encode(dtn)

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

Encodes a DTN to a list of component strings.

Examples

iex> HL7v2.Type.DTN.encode(%HL7v2.Type.DTN{day_type: "AP", number_of_days: %HL7v2.Type.NM{value: "10", original: "10"}})
["AP", "10"]

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

parse(components)

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

Parses a DTN from a list of components.

Examples

iex> HL7v2.Type.DTN.parse(["AP", "10"])
%HL7v2.Type.DTN{day_type: "AP", number_of_days: %HL7v2.Type.NM{value: "10", original: "10"}}

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