The Encounter State Machine enforces valid ADT transitions — admitted,
transferred, discharged — rejecting illegal jumps that would corrupt census.
- Validates trigger against current state before any Encounter Repository write.
- Illegal transitions return a structured error to ingestion so the hospital can reconcile.
- Emits transition metadata to the Event Publisher.