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

UB Value Code and Amount (UVC) -- HL7v2 composite data type.

Links a UB value code to its monetary amount for billing segments
(UB1-10, UB2-6).

2 components:
1. Value Code (CNE) -- sub-components, Table 0153
2. Value Amount (MO) -- sub-components (quantity & denomination)

# `t`

```elixir
@type t() :: %HL7v2.Type.UVC{
  value_amount: HL7v2.Type.MO.t() | nil,
  value_code: HL7v2.Type.CNE.t() | nil
}
```

# `encode`

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

Encodes a UVC to a list of component strings.

## Examples

    iex> HL7v2.Type.UVC.encode(%HL7v2.Type.UVC{value_code: %HL7v2.Type.CNE{identifier: "01"}, value_amount: %HL7v2.Type.MO{quantity: "150.00"}})
    ["01", "150.00"]

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

# `parse`

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

Parses a UVC from a list of components.

## Examples

    iex> HL7v2.Type.UVC.parse(["01&Blood deductible&NUBC", "150.00&USD"])
    %HL7v2.Type.UVC{
      value_code: %HL7v2.Type.CNE{identifier: "01", text: "Blood deductible", name_of_coding_system: "NUBC"},
      value_amount: %HL7v2.Type.MO{quantity: "150.00", denomination: "USD"}
    }

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

---

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