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

Multiplexed Array (MA) -- HL7v2 composite data type.

Contains a variable number of numeric (NM) sample values from multiple
waveform channels. Used in OBX for waveform data transmission.

Variable components (4+ per HL7 spec):
1. Sample Y From Channel 1 (NM)
2. Sample Y From Channel 2 (NM)
3. Sample Y From Channel 3 (NM)
4. Sample Y From Channel 4 (NM)
... additional channels as needed

# `t`

```elixir
@type t() :: %HL7v2.Type.MA{values: [binary()]}
```

# `encode`

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

Encodes an MA to a list of component strings.

## Examples

    iex> HL7v2.Type.MA.encode(%HL7v2.Type.MA{values: ["1.2", "3.4", "5.6"]})
    ["1.2", "3.4", "5.6"]

    iex> HL7v2.Type.MA.encode(%HL7v2.Type.MA{})
    []

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

# `parse`

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

Parses an MA from a list of components.

All components are stored as a list of string values.

## Examples

    iex> HL7v2.Type.MA.parse(["1.2", "3.4", "5.6"])
    %HL7v2.Type.MA{values: ["1.2", "3.4", "5.6"]}

    iex> HL7v2.Type.MA.parse(["100"])
    %HL7v2.Type.MA{values: ["100"]}

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

---

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