diff options
Diffstat (limited to 'core/src/Text/Edifact/Common/Segments/UNB.hs')
-rw-r--r-- | core/src/Text/Edifact/Common/Segments/UNB.hs | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/core/src/Text/Edifact/Common/Segments/UNB.hs b/core/src/Text/Edifact/Common/Segments/UNB.hs new file mode 100644 index 0000000..55f1eea --- /dev/null +++ b/core/src/Text/Edifact/Common/Segments/UNB.hs | |||
@@ -0,0 +1,63 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | ||
2 | |||
3 | module Text.Edifact.Common.Segments.UNB | ||
4 | ( segmentUNB | ||
5 | ) where | ||
6 | |||
7 | import Text.Edifact.Common.Composites (compositeS001, compositeS002, | ||
8 | compositeS003, compositeS004, | ||
9 | compositeS005) | ||
10 | import Text.Edifact.Common.Simples (simple0020, simple0026, | ||
11 | simple0029, simple0031, | ||
12 | simple0032, simple0035) | ||
13 | |||
14 | import Text.Edifact.Parsing | ||
15 | import Text.Edifact.Types (Value) | ||
16 | |||
17 | -- | Derived from this specification: | ||
18 | -- | ||
19 | -- > Pos Segment M/C Repeat Repr. Notes | ||
20 | -- > 010 S001 SYNTAX IDENTIFIER M 1 | ||
21 | -- > 0001 Syntax identifier M a4 | ||
22 | -- > 0002 Syntax version number M an1 | ||
23 | -- > 0080 Service code list directory version number C an..6 | ||
24 | -- > 0133 Character encoding, coded C an..3 | ||
25 | -- > 020 S002 INTERCHANGE SENDER M 1 | ||
26 | -- > 0004 Interchange sender identification M an..35 | ||
27 | -- > 0007 Identification code qualifier C an..4 | ||
28 | -- > 0008 Interchange sender internal identification C an..35 | ||
29 | -- > 0042 Interchange sender internal sub-identification C an..35 | ||
30 | -- > 030 S003 INTERCHANGE RECIPIENT M 1 | ||
31 | -- > 0010 Interchange recipient identification M an..35 | ||
32 | -- > 0007 Identification code qualifier C an..4 | ||
33 | -- > 0014 Interchange recipient internal identification C an..35 | ||
34 | -- > 0046 Interchange recipient internal sub-identification C an..35 | ||
35 | -- > 040 S004 DATE AND TIME OF PREPARATION M 1 | ||
36 | -- > 0017 Date M n8 | ||
37 | -- > 0019 Time M n4 | ||
38 | -- > 050 0020 Interchange control reference M 1 an..14 | ||
39 | -- > 060 S005 RECIPIENT'S REFERENCE/PASSWORD DETAILS C 1 | ||
40 | -- > 0022 Recipient reference/password M an..14 | ||
41 | -- > 0025 Recipient reference/password qualifier C an2 | ||
42 | -- > 070 0026 Application reference C 1 an..14 | ||
43 | -- > 080 0029 Processing priority code C 1 a1 | ||
44 | -- > 090 0031 Acknowledgement request C 1 n1 | ||
45 | -- > 100 0032 Interchange agreement identifier C 1 an..35 | ||
46 | -- > 110 0035 Test indicator C 1 n1 | ||
47 | -- | ||
48 | -- Dependencies: 'compositeS001', 'compositeS002', 'compositeS003', 'compositeS004', 'compositeS005', 'simple0020', 'simple0026', 'simple0029', 'simple0031', 'simple0032', 'simple0035'. | ||
49 | segmentUNB :: Parser Value | ||
50 | segmentUNB = | ||
51 | segment "UNB" | ||
52 | [ "010" .@ mandatory compositeS001 | ||
53 | , "020" .@ mandatory compositeS002 | ||
54 | , "030" .@ mandatory compositeS003 | ||
55 | , "040" .@ mandatory compositeS004 | ||
56 | , "050" .@ mandatory simple0020 | ||
57 | , "060" .@ optional compositeS005 | ||
58 | , "070" .@ optional simple0026 | ||
59 | , "080" .@ optional simple0029 | ||
60 | , "090" .@ optional simple0031 | ||
61 | , "100" .@ optional simple0032 | ||
62 | , "110" .@ optional simple0035 | ||
63 | ] | ||