# `HL7v2.Type.NDL`
[🔗](https://github.com/Balneario-de-Cofrentes/hl7v2/blob/v3.10.1/lib/hl7v2/type/ndl.ex#L1)

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)

# `t`

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

# `encode`

```elixir
@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`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
