HL7v2.Type.PTA (HL7v2 v3.10.1)

Copy Markdown View Source

Policy Type and Amount (PTA) -- HL7v2 composite data type.

Specifies a policy type, amount class, and money/percentage value for insurance.

3 components:

  1. Policy Type (IS) -- Table 0147: e.g., "ANC" (ancillary), "2ANC" (second ancillary)
  2. Amount Class (IS) -- Table 0193: e.g., "LM" (limit), "PC" (percentage), "UP" (unlimited)
  3. Money or Percentage Quantity (NM) -- the numeric value

Summary

Functions

Encodes a PTA to a list of component strings.

Parses a PTA from a list of components.

Types

t()

@type t() :: %HL7v2.Type.PTA{
  amount_class: binary() | nil,
  money_or_percentage_quantity: HL7v2.Type.NM.t() | nil,
  policy_type: binary() | nil
}

Functions

encode(pta)

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

Encodes a PTA to a list of component strings.

Examples

iex> HL7v2.Type.PTA.encode(%HL7v2.Type.PTA{policy_type: "ANC", amount_class: "LM", money_or_percentage_quantity: %HL7v2.Type.NM{value: "1000", original: "1000"}})
["ANC", "LM", "1000"]

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

parse(components)

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

Parses a PTA from a list of components.

Examples

iex> HL7v2.Type.PTA.parse(["ANC", "LM", "1000"])
%HL7v2.Type.PTA{policy_type: "ANC", amount_class: "LM", money_or_percentage_quantity: %HL7v2.Type.NM{value: "1000", original: "1000"}}

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