I have the following :
type MSH = { val1: string } type EVN = { val2: string } type PID = { val3: string } type Segment = MSH | EVN | PID type Segmen