Policy Type and Amount (PTA) -- HL7v2 composite data type.
Specifies a policy type, amount class, and money/percentage value for insurance.
3 components:
- Policy Type (IS) -- Table 0147: e.g., "ANC" (ancillary), "2ANC" (second ancillary)
- Amount Class (IS) -- Table 0193: e.g., "LM" (limit), "PC" (percentage), "UP" (unlimited)
- Money or Percentage Quantity (NM) -- the numeric value
Summary
Types
@type t() :: %HL7v2.Type.PTA{ amount_class: binary() | nil, money_or_percentage_quantity: HL7v2.Type.NM.t() | nil, policy_type: binary() | nil }
Functions
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)
[]
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{}