# `HL7v2.Validation.MessageRules`
[🔗](https://github.com/Balneario-de-Cofrentes/hl7v2/blob/v3.10.1/lib/hl7v2/validation/message_rules.ex#L1)

Message-level validation rules for HL7v2 typed messages.

Checks structural invariants that apply to the message as a whole:
first segment must be MSH, and critical MSH fields must be present.

# `check`

```elixir
@spec check(HL7v2.TypedMessage.t()) :: [map()]
```

Returns a list of message-level validation errors.

Checks:
- First segment is `%HL7v2.Segment.MSH{}`
- `MSH.message_type` is present
- `MSH.message_control_id` is present

---

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