HL7v2.Type.PL (HL7v2 v3.10.1)

Copy Markdown View Source

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 &

Summary

Functions

Encodes a PL to a list of component strings.

Parses a PL from a list of components.

Types

t()

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

Functions

encode(pl)

@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(components)

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