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

Visiting Hours (VH) -- HL7v2 composite data type.

Specifies visiting hours for a location.

4 components:
1. Start Day Range (ID) -- Table 0267: SAT, SUN, MON, TUE, WED, THU, FRI
2. End Day Range (ID) -- Table 0267
3. Start Hour Range (TM) -- HHMM
4. End Hour Range (TM) -- HHMM

# `t`

```elixir
@type t() :: %HL7v2.Type.VH{
  end_day_range: binary() | nil,
  end_hour_range: binary() | nil,
  start_day_range: binary() | nil,
  start_hour_range: binary() | nil
}
```

# `encode`

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

Encodes a VH to a list of component strings.

## Examples

    iex> HL7v2.Type.VH.encode(%HL7v2.Type.VH{start_day_range: "MON", end_day_range: "FRI", start_hour_range: "0800", end_hour_range: "1700"})
    ["MON", "FRI", "0800", "1700"]

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

# `parse`

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

Parses a VH from a list of components.

## Examples

    iex> HL7v2.Type.VH.parse(["MON", "FRI", "0800", "1700"])
    %HL7v2.Type.VH{start_day_range: "MON", end_day_range: "FRI", start_hour_range: "0800", end_hour_range: "1700"}

    iex> HL7v2.Type.VH.parse(["SAT", "SUN"])
    %HL7v2.Type.VH{start_day_range: "SAT", end_day_range: "SUN"}

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

---

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