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

Person Location (PL) -- HL7v2 composite data type.

Used to specify patient location (point of care, room, bed, facility, etc.).

11 components:
1. Point of Care (IS) -- Table 0302
2. Room (IS) -- Table 0303
3. Bed (IS) -- Table 0304
4. Facility (HD) -- sub-components delimited by `&`
5. Location Status (IS) -- Table 0306
6. Person Location Type (IS) -- Table 0305: C=Clinic, N=Nursing, etc.
7. Building (IS) -- Table 0307
8. Floor (IS) -- Table 0308
9. Location Description (ST)
10. Comprehensive Location Identifier (EI) -- sub-components delimited by `&`
11. Assigning Authority for Location (HD) -- sub-components delimited by `&`

# `t`

```elixir
@type t() :: %HL7v2.Type.PL{
  assigning_authority_for_location: HL7v2.Type.HD.t() | nil,
  bed: binary() | nil,
  building: binary() | nil,
  comprehensive_location_identifier: HL7v2.Type.EI.t() | nil,
  facility: HL7v2.Type.HD.t() | nil,
  floor: binary() | nil,
  location_description: binary() | nil,
  location_status: binary() | nil,
  person_location_type: binary() | nil,
  point_of_care: binary() | nil,
  room: binary() | nil
}
```

# `encode`

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

Encodes a PL to a list of component strings.

## Examples

    iex> HL7v2.Type.PL.encode(%HL7v2.Type.PL{point_of_care: "ICU", facility: %HL7v2.Type.HD{namespace_id: "HOSP"}})
    ["ICU", "", "", "HOSP"]

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

# `parse`

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

Parses a PL from a list of components.

## Examples

    iex> HL7v2.Type.PL.parse(["ICU", "101", "A", "HOSP&2.16.840.1.113883.19.4.6&ISO", "", "N"])
    %HL7v2.Type.PL{
      point_of_care: "ICU",
      room: "101",
      bed: "A",
      facility: %HL7v2.Type.HD{namespace_id: "HOSP", universal_id: "2.16.840.1.113883.19.4.6", universal_id_type: "ISO"},
      person_location_type: "N"
    }

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

---

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