HL7v2.Type.PIP (HL7v2 v3.10.1)

Copy Markdown View Source

Practitioner Institutional Privileges (PIP) -- HL7v2 composite data type.

Defines institutional privileges granted to a practitioner.

5 components:

  1. Privilege (CE) -- sub-components
  2. Privilege Class (CE) -- sub-components
  3. Expiration Date (DT)
  4. Activation Date (DT)
  5. Facility (EI) -- sub-components

Summary

Functions

Encodes a PIP to a list of component strings.

Parses a PIP from a list of components.

Types

t()

@type t() :: %HL7v2.Type.PIP{
  activation_date: Date.t() | HL7v2.Type.DT.t() | nil,
  expiration_date: Date.t() | HL7v2.Type.DT.t() | nil,
  facility: HL7v2.Type.EI.t() | nil,
  privilege: HL7v2.Type.CE.t() | nil,
  privilege_class: HL7v2.Type.CE.t() | nil
}

Functions

encode(pip)

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

Encodes a PIP to a list of component strings.

Examples

iex> HL7v2.Type.PIP.encode(%HL7v2.Type.PIP{privilege: %HL7v2.Type.CE{identifier: "SURG"}, expiration_date: ~D[2028-12-31]})
["SURG", "", "20281231"]

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

parse(components)

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

Parses a PIP from a list of components.

Examples

iex> HL7v2.Type.PIP.parse(["SURG&Surgery&LOCAL", "A&Active", "20281231", "20260101"])
%HL7v2.Type.PIP{
  privilege: %HL7v2.Type.CE{identifier: "SURG", text: "Surgery", name_of_coding_system: "LOCAL"},
  privilege_class: %HL7v2.Type.CE{identifier: "A", text: "Active"},
  expiration_date: ~D[2028-12-31],
  activation_date: ~D[2026-01-01]
}

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