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

Location with Address Variation 2 (LA2) -- HL7v2 composite data type.

Specifies a patient location with full address details. Used for
administered-at locations (RXA-11).

14 components:
1. Point of Care (IS)
2. Room (IS)
3. Bed (IS)
4. Facility (HD) -- sub-components
5. Location Status (IS)
6. Patient Location Type (IS)
7. Building (IS)
8. Floor (IS)
9. Street Address (ST)
10. Other Designation (ST)
11. City (ST)
12. State or Province (ST)
13. Zip or Postal Code (ST)
14. Country (ID) -- Table 0399

# `t`

```elixir
@type t() :: %HL7v2.Type.LA2{
  bed: binary() | nil,
  building: binary() | nil,
  city: binary() | nil,
  country: binary() | nil,
  facility: HL7v2.Type.HD.t() | nil,
  floor: binary() | nil,
  location_status: binary() | nil,
  other_designation: binary() | nil,
  patient_location_type: binary() | nil,
  point_of_care: binary() | nil,
  room: binary() | nil,
  state_or_province: binary() | nil,
  street_address: binary() | nil,
  zip_or_postal_code: binary() | nil
}
```

# `encode`

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

Encodes an LA2 to a list of component strings.

## Examples

    iex> HL7v2.Type.LA2.encode(%HL7v2.Type.LA2{point_of_care: "ICU", room: "101", bed: "A"})
    ["ICU", "101", "A"]

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

# `parse`

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

Parses an LA2 from a list of components.

## Examples

    iex> HL7v2.Type.LA2.parse(["ICU", "101", "A"])
    %HL7v2.Type.LA2{point_of_care: "ICU", room: "101", bed: "A"}

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

---

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