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

Version Identifier (VID) -- HL7v2 composite data type.

Used in MSH-12 to identify the HL7 version.

3 components:
1. Version ID (ID) -- Table 0104: 2.5, 2.5.1, etc.
2. Internationalization Code (CE)
3. International Version ID (CE)

# `t`

```elixir
@type t() :: %HL7v2.Type.VID{
  international_version_id: HL7v2.Type.CE.t() | nil,
  internationalization_code: HL7v2.Type.CE.t() | nil,
  version_id: binary() | nil
}
```

# `encode`

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

Encodes a VID to a list of component strings.

## Examples

    iex> HL7v2.Type.VID.encode(%HL7v2.Type.VID{version_id: "2.5.1"})
    ["2.5.1"]

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

# `parse`

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

Parses a VID from a list of components.

Components 2 and 3 are CE types, which when embedded use `&` sub-components.

## Examples

    iex> HL7v2.Type.VID.parse(["2.5.1"])
    %HL7v2.Type.VID{version_id: "2.5.1"}

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

---

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