1 {-# LANGUAGE OverloadedStrings #-}
3 module Text.Edifact.Common.Segments.UNH
7 import Text.Edifact.Common.Composites (compositeS009, compositeS010)
8 import Text.Edifact.Common.Simples (simple0062, simple0068)
10 import Text.Edifact.Parsing
11 import Text.Edifact.Types (Value)
13 -- | Derived from this specification:
15 -- > Change indicators
17 -- > UNH MESSAGE HEADER
19 -- > Function: To head, identify and specify a message.
21 -- > 010 0062 MESSAGE REFERENCE NUMBER M an..14
23 -- > 020 S009 MESSAGE IDENTIFIER M
24 -- > 0065 Message type M an..6
25 -- > 0052 Message version number M an..3
26 -- > 0054 Message release number M an..3
27 -- > 0051 Controlling agency M an..2
28 -- > 0057 Association assigned code C an..6
30 -- > 030 0068 COMMON ACCESS REFERENCE C an..35
32 -- > 040 S010 STATUS OF THE TRANSFER C
33 -- > 0070 Sequence of transfers M n..2
34 -- > 0073 First and last transfer C a1
36 -- Dependencies: 'compositeS009', 'compositeS010', 'simple0062', 'simple0068'.
37 segmentUNH :: Parser Value
40 [ "010" .@ mandatory simple0062
41 , "020" .@ mandatory compositeS009
42 , "030" .@ optional simple0068
43 , "040" .@ optional compositeS010