HL7v2.Type.NDL (HL7v2 v3.10.1)

Copy Markdown View Source

Name with Date and Location (NDL) -- HL7v2 composite data type.

Used in OBR fields 32-35 to identify persons (interpreters, technicians, transcriptionists) along with the time and location of their activity.

11 components per HL7 v2.5.1:

  1. Name (CNN) -- sub-components delimited by &
  2. Start Date/Time (TS) -- sub-components delimited by &
  3. End Date/Time (TS) -- sub-components delimited by &
  4. Point of Care (IS)
  5. Room (IS)
  6. Bed (IS)
  7. Facility (HD) -- sub-components delimited by &
  8. Location Status (IS)
  9. Patient Location Type (IS)
  10. Building (IS)
  11. Floor (IS)

Summary

Functions

Encodes an NDL to a list of component strings.

Parses an NDL from a list of components.

Types

t()

@type t() :: %HL7v2.Type.NDL{
  bed: binary() | nil,
  building: binary() | nil,
  end_date_time: HL7v2.Type.TS.t() | nil,
  facility: HL7v2.Type.HD.t() | nil,
  floor: binary() | nil,
  location_status: binary() | nil,
  name: HL7v2.Type.CNN.t() | nil,
  patient_location_type: binary() | nil,
  point_of_care: binary() | nil,
  room: binary() | nil,
  start_date_time: HL7v2.Type.TS.t() | nil
}

Functions

encode(ndl)

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

Encodes an NDL to a list of component strings.

Examples

iex> HL7v2.Type.NDL.encode(%HL7v2.Type.NDL{name: %HL7v2.Type.CNN{id_number: "12345", family_name: "Smith", given_name: "John"}})
["12345&Smith&John"]

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

iex> HL7v2.Type.NDL.encode(%HL7v2.Type.NDL{})
[]

parse(components)

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

Parses an NDL from a list of components.

Component 1 (Name/CNN), 2-3 (TS), and 7 (HD) contain sub-components delimited by &.

Examples

iex> HL7v2.Type.NDL.parse(["12345&Smith&John"])
%HL7v2.Type.NDL{
  name: %HL7v2.Type.CNN{id_number: "12345", family_name: "Smith", given_name: "John"}
}

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