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

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

# `t`

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

# `encode`

```elixir
@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`

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

---

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