]> git.immae.eu Git - github/fretlink/edi-parser.git/blob - core/src/Text/Edifact/Common/Segments/UNH.hs
Release code as open source
[github/fretlink/edi-parser.git] / core / src / Text / Edifact / Common / Segments / UNH.hs
1 {-# LANGUAGE OverloadedStrings #-}
2
3 module Text.Edifact.Common.Segments.UNH
4 ( segmentUNH
5 ) where
6
7 import Text.Edifact.Common.Composites (compositeS009, compositeS010)
8 import Text.Edifact.Common.Simples (simple0062, simple0068)
9
10 import Text.Edifact.Parsing
11 import Text.Edifact.Types (Value)
12
13 -- | Derived from this specification:
14 --
15 -- > Change indicators
16 -- >
17 -- > UNH MESSAGE HEADER
18 -- >
19 -- > Function: To head, identify and specify a message.
20 -- >
21 -- > 010 0062 MESSAGE REFERENCE NUMBER M an..14
22 -- >
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
29 -- >
30 -- > 030 0068 COMMON ACCESS REFERENCE C an..35
31 -- >
32 -- > 040 S010 STATUS OF THE TRANSFER C
33 -- > 0070 Sequence of transfers M n..2
34 -- > 0073 First and last transfer C a1
35 --
36 -- Dependencies: 'compositeS009', 'compositeS010', 'simple0062', 'simple0068'.
37 segmentUNH :: Parser Value
38 segmentUNH =
39 segment "UNH"
40 [ "010" .@ mandatory simple0062
41 , "020" .@ mandatory compositeS009
42 , "030" .@ optional simple0068
43 , "040" .@ optional compositeS010
44 ]