-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.go
124 lines (114 loc) · 2.88 KB
/
global.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package edx12
const (
isaSegmentId = "ISA"
ieaSegmentId = "IEA"
gsSegmentId = "GS"
geSegmentId = "GE"
stSegmentId = "ST"
seSegmentId = "SE"
//lsSegmentId = "LS"
//lsSegmentLoopIdIndex = 1
//leSegmentLoopIdIndex = 1
//leSegmentId = "LE"
hlSegmentId = "HL"
functionalGroupName = "GS_LOOP"
transactionSetName = "ST_LOOP"
transactionSpecDescription = "Transaction set spec"
transactionSetCodeSpecLabel = "transactionSetCode"
transactionVersionSpecLabel = "versionCode"
transactionSpecLabel = "transactionSets"
basicCharacterSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 !\"&'()+*,-./:;?="
extendedCharacterSet = basicCharacterSet + "abcdefghijklmnopqrstuvwxyz%~@[]_{}\\|<>^`#$"
isaElementCount = 17
isaByteCount = 106
isaElementSeparatorIndex = 3
x12PathSeparator = "/"
compositeTypeName = "Composite"
elementTypeName = "Element"
)
const (
isaIndexSegmentId = iota
isaIndexAuthInfoQualifier
isaIndexAuthInfo
isaIndexSecurityInfoQualifier
isaIndexSecurityInfo
isaIndexSenderIdQualifier
isaIndexSenderId
isaIndexReceiverIdQualifier
isaIndexReceiverId
isaIndexDate
isaIndexTime
isaIndexRepetitionSeparator
isaIndexVersion
isaIndexControlNumber
isaIndexAckRequested
isaIndexUsageIndicator
isaIndexComponentElementSeparator
)
const (
ieaIndexFunctionalGroupCount = iota + 1
ieaIndexControlNumber
)
const (
gsIndexFunctionalIdentifierCode = iota + 1
gsIndexSenderCode
gsIndexReceiverCode
gsIndexDate
gsIndexTime
gsIndexControlNumber
gsIndexResponsibleAgencyCode
gsIndexVersion
)
const (
geIndexNumberOfIncludedTransactionSets = iota + 1
geIndexControlNumber
)
const (
stIndexTransactionSetCode = iota + 1
stIndexControlNumber
stIndexVersionCode
)
const (
seIndexNumberOfIncludedSegments = iota + 1
seIndexControlNumber
)
// isaLen* consts indicate the length of elements in the ISA
// header (no more, no less, whitespace padded on the left)
const (
//isaLenSegmentId = 3
isaLenAuthInfoQualifier = 2
isaLenAuthInfo = 10
isaLenSecurityInfoQualifier = 2
isaLenSecurityInfo = 10
isaLenSenderIdQualifier = 2
isaLenSenderId = 15
isaLenReceiverIdQualifier = 2
isaLenReceiverId = 15
isaLenDate = 6
isaLenTime = 4
//isaLenRepetitionSeparator = 1
isaLenVersion = 5
isaLenControlNumber = 9
isaLenAckRequested = 1
isaLenUsageIndicator = 1
//isaLenComponentElementSeparator = 1
)
const (
hlIndexHierarchicalId = iota + 1
hlIndexParentId
hlIndexLevelCode
hlIndexChildCode
)
var functionalIdentifierCodes = map[string]string{
"270": "HS",
"271": "HB",
"276": "HR",
"277": "HN",
"278": "HI",
"820": "RA",
"834": "HP",
"835": "HP",
"837": "HC",
"997": "FA",
"999": "FA",
}