stupidedi 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -5
- data/Rakefile +4 -4
- data/bin/edi-obfuscate +1 -1
- data/lib/stupidedi/config.rb +2 -0
- data/lib/stupidedi/editor/004010.rb +1 -1
- data/lib/stupidedi/editor/implementation_ack.rb +3 -3
- data/lib/stupidedi/interchanges/00501/element_defs.rb +3 -3
- data/lib/stupidedi/parser/builder_dsl.rb +4 -1
- data/lib/stupidedi/schema/abstract_element_use.rb +9 -0
- data/lib/stupidedi/schema/component_element_use.rb +2 -0
- data/lib/stupidedi/schema/composite_element_use.rb +6 -1
- data/lib/stupidedi/schema/segment_use.rb +4 -4
- data/lib/stupidedi/schema/simple_element_use.rb +2 -0
- data/lib/stupidedi/transaction_sets/004010/implementations/IN810.rb +162 -0
- data/lib/stupidedi/transaction_sets/004010/implementations.rb +1 -0
- data/lib/stupidedi/transaction_sets/004010/standards/IN810.rb +38 -0
- data/lib/stupidedi/transaction_sets/004010/standards/PR855.rb +2 -1
- data/lib/stupidedi/transaction_sets/004010/standards.rb +1 -0
- data/lib/stupidedi/transaction_sets/005010/implementations/X212-HN277.rb +552 -0
- data/lib/stupidedi/transaction_sets/005010/implementations/X220A1-BE834.rb +3 -3
- data/lib/stupidedi/transaction_sets/005010/implementations/X222A1-HC837.rb +26 -26
- data/lib/stupidedi/transaction_sets/005010/implementations/X223A2-HC837.rb +5 -5
- data/lib/stupidedi/transaction_sets/005010/implementations/X223A3-HC837.rb +5 -5
- data/lib/stupidedi/transaction_sets/005010/implementations/X279-HB271.rb +14 -14
- data/lib/stupidedi/transaction_sets/005010/implementations/X279-HS270.rb +1 -1
- data/lib/stupidedi/transaction_sets/005010/implementations/X279A1-HB271.rb +3 -3
- data/lib/stupidedi/transaction_sets/005010/implementations/X279A1-HS270.rb +1 -1
- data/lib/stupidedi/transaction_sets/005010/implementations.rb +1 -0
- data/lib/stupidedi/transaction_sets/builder/dsl.rb +192 -0
- data/lib/stupidedi/transaction_sets/builder.rb +5 -1
- data/lib/stupidedi/values/composite_element_val.rb +9 -2
- data/lib/stupidedi/values/repeated_element_val.rb +1 -1
- data/lib/stupidedi/version.rb +1 -1
- data/lib/stupidedi/versions/003010/element_defs.rb +5 -2
- data/lib/stupidedi/versions/004010/element_defs.rb +72 -2
- data/lib/stupidedi/versions/004010/segment_defs/ACK.rb +43 -0
- data/lib/stupidedi/versions/004010/segment_defs/BIG.rb +25 -0
- data/lib/stupidedi/versions/004010/segment_defs/IT1.rb +39 -0
- data/lib/stupidedi/versions/004010/segment_defs/ITD.rb +29 -0
- data/lib/stupidedi/versions/004010/segment_defs/SAC.rb +31 -0
- data/lib/stupidedi/versions/004010/segment_defs/TDS.rb +18 -0
- data/lib/stupidedi/versions/004010/segment_defs/TXI.rb +24 -0
- data/lib/stupidedi/versions/004010/segment_defs.rb +7 -0
- data/lib/stupidedi/versions/005010/element_defs.rb +170 -5
- data/lib/stupidedi/versions/common/element_types/id.rb +1 -1
- data/lib/stupidedi/versions/common/element_types/r.rb +3 -1
- metadata +16 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65b0a1eb140015425ec5a93242e9deb9c8bff5022ab029f4f9e274bd08225237
|
4
|
+
data.tar.gz: 9f8dc7f0d565c3a718c75d14625f0c217f496200b85ae5e42998da10e487ccda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5272dfffe350f51c79b91ada058a03afb831d58975450e8d762e487c4082ff362cd422b44133abb4014d2ce43da6e2bf8470323cb3d2ae7783a4b498b5f67178
|
7
|
+
data.tar.gz: 8e3b24ec2a7f2ff320a3db67d84637e34787c42e38d772a933314d6ca15a0a961ccd0efcd2969e7e77a139f2b4b75f9e1bc31ccc1c7eca22041176c02c36f529
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
* [GitHub project](http://github.com/irobayna/stupidedi)
|
8
8
|
* [Human Documentation](https://github.com/irobayna/stupidedi/tree/master/doc)
|
9
|
-
* [API Documentation](http://rubydoc.info/github/
|
9
|
+
* [API Documentation](http://rubydoc.info/github/kputnam/stupidedi/master/frames)
|
10
10
|
|
11
11
|
Stupidedi is a high-quality library for parsing, generating, validating,
|
12
12
|
and manipulating ASC X12 EDI documents. Very roughly, it's jQuery for
|
@@ -76,10 +76,16 @@ to understand, assuming a reasonable familiarity with EDI.
|
|
76
76
|
### Efficient parsing and traversing
|
77
77
|
|
78
78
|
The parser is designed using immutable data structures, making it thread-safe
|
79
|
-
for runtimes that can utilize multiple cores.
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
for runtimes that can utilize multiple cores. In some cases, immutability places
|
80
|
+
higher demand on garbage collection, this has been somewhat mitigated with careful
|
81
|
+
optimization.
|
82
|
+
|
83
|
+
**Note:** Further optimizations are planned for late 2021. Until then, modestly large
|
84
|
+
files can consume excessive memory to the point all CPU time is spent in garbage
|
85
|
+
collection. In more than ten years since this library was put into production, this
|
86
|
+
seems to rarely happen in practice (as X12 files are most often very small), but until
|
87
|
+
these improvements are merged, it can be difficult to work around. See [#65](https://github.com/irobayna/stupidedi/issues/65) for
|
88
|
+
more discussion. The current work in progress is in the [`gh-65.3`](https://github.com/irobayna/stupidedi/tree/gh-65.3) branch.
|
83
89
|
|
84
90
|
![Benchmark](https://raw.github.com/irobayna/stupidedi/master/notes/benchmark/throughput.png)
|
85
91
|
|
data/Rakefile
CHANGED
@@ -7,12 +7,12 @@ task :default => :spec
|
|
7
7
|
require "rspec/core/rake_task"
|
8
8
|
RSpec::Core::RakeTask.new do |t|
|
9
9
|
t.verbose = false
|
10
|
-
t.rspec_opts =
|
10
|
+
t.rspec_opts = "-w -rspec_helper"
|
11
11
|
|
12
|
-
if ENV.include?("CI")
|
13
|
-
t.rspec_opts +=
|
12
|
+
if ENV.include?("CI")
|
13
|
+
t.rspec_opts += " --format progress"
|
14
14
|
else
|
15
|
-
t.rspec_opts +=
|
15
|
+
t.rspec_opts += " --format documentation"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
data/bin/edi-obfuscate
CHANGED
data/lib/stupidedi/config.rb
CHANGED
@@ -106,6 +106,7 @@ module Stupidedi
|
|
106
106
|
x.register("005010", "FA", "999") { Stupidedi::TransactionSets::FiftyTen::Standards::FA999 }
|
107
107
|
x.register("005010", "RA", "820") { Stupidedi::TransactionSets::FiftyTen::Standards::RA820 }
|
108
108
|
x.register("005010X212", "HR", "276") { Stupidedi::TransactionSets::FiftyTen::Implementations::X212::HR276 }
|
109
|
+
x.register("005010X212", "HN", "277") { Stupidedi::TransactionSets::FiftyTen::Implementations::X212::HN277 }
|
109
110
|
x.register("005010X214", "HN", "277") { Stupidedi::TransactionSets::FiftyTen::Implementations::X214::HN277 }
|
110
111
|
x.register("005010X220", "BE", "834") { Stupidedi::TransactionSets::FiftyTen::Implementations::X220::BE834 }
|
111
112
|
x.register("005010X221", "HP", "835") { Stupidedi::TransactionSets::FiftyTen::Implementations::X221::HP835 }
|
@@ -153,6 +154,7 @@ module Stupidedi
|
|
153
154
|
x.register("003050", "PO", "850") { Stupidedi::TransactionSets::ThirtyFifty::Standards::PO850 }
|
154
155
|
x.register("004010", "PO", "850") { Stupidedi::TransactionSets::FortyTen::Standards::PO850 }
|
155
156
|
x.register("004010", "PR", "855") { Stupidedi::TransactionSets::FortyTen::Standards::PR855 }
|
157
|
+
x.register("004010", "IN", "810") { Stupidedi::TransactionSets::FortyTen::Standards::IN810 }
|
156
158
|
x.register("004010", "OW", "940") { Stupidedi::TransactionSets::FortyTen::Standards::OW940 }
|
157
159
|
x.register("004010", "AR", "943") { Stupidedi::TransactionSets::FortyTen::Standards::AR943 }
|
158
160
|
x.register("004010", "RE", "944") { Stupidedi::TransactionSets::FortyTen::Standards::RE944 }
|
@@ -138,11 +138,11 @@ module Stupidedi
|
|
138
138
|
# A: Accepted
|
139
139
|
# E: Accepted, but errors were found
|
140
140
|
# P: Partially accepted, at least one transaction set was rejected
|
141
|
-
# R:
|
141
|
+
# R: Rejected
|
142
142
|
#
|
143
|
-
# 1:
|
143
|
+
# 1: Functional group not supported
|
144
144
|
# 2: Functional group version not supported
|
145
|
-
# 3:
|
145
|
+
# 3: Functional group trailer missing
|
146
146
|
# 4: Group control number in the functional group header and trailer do not agree
|
147
147
|
# 5: Number of included transaction sets does not match actual count
|
148
148
|
# 6: Group control number violates syntax
|
@@ -14,7 +14,7 @@ module Stupidedi
|
|
14
14
|
"02" => "EDX Communications ID",
|
15
15
|
"03" => "Additional Data Identification",
|
16
16
|
"04" => "Rail Communication ID",
|
17
|
-
"05" => "
|
17
|
+
"05" => "Department of Defense (DoD) Communication Identifier",
|
18
18
|
"06" => "United States Federal Government Communication Identifier"))
|
19
19
|
I02 = c::SpecialAN.new(:I02, "Authorization Information", 10, 10)
|
20
20
|
I03 = t::ID.new(:I03, "Security Information Qualifier", 2, 2,
|
@@ -34,7 +34,7 @@ module Stupidedi
|
|
34
34
|
"10" => s::CodeList.external("350"),
|
35
35
|
"11" => "DEA (Drug Enforcement Administration)",
|
36
36
|
"12" => "Phone (Telephone Companies)",
|
37
|
-
"13" => "UCS Code (The UCS Code is a Code Used for UCS Transmissions; it includes the Area Code and Telephone Number of a Modem; it Does Not Include
|
37
|
+
"13" => "UCS Code (The UCS Code is a Code Used for UCS Transmissions; it includes the Area Code and Telephone Number of a Modem; it Does Not Include Punctuation, Blanks, or the Access Code)",
|
38
38
|
"14" => "Duns Plus Suffix",
|
39
39
|
"15" => "Petroleum Accountants Society of Canada Company Code",
|
40
40
|
"16" => "Duns Number With 4-Character Suffix",
|
@@ -52,7 +52,7 @@ module Stupidedi
|
|
52
52
|
"28" => "Fiscal Intermediary Identification Number as assigned by Health Care Financing Administration (HCFA)",
|
53
53
|
"29" => "Medicare Provider and Supplier Identification Number as assigned by Health Care Financing Administration (HCFA)",
|
54
54
|
"30" => "US Federal Tax Identification Number",
|
55
|
-
"31" => "Jurisdiction Identification Number Plus 4 as assigned by the
|
55
|
+
"31" => "Jurisdiction Identification Number Plus 4 as assigned by the International Association of Industrial Accident Boards and Commissions (IAIABC)",
|
56
56
|
"32" => "US Federal Employer Identification Number (FEIN)",
|
57
57
|
"33" => "National Association of Insurance Commissioners Company Code (NAIC)",
|
58
58
|
"34" => "Medicaid Provider and Supplier Identification Number as assigned by individual State Medicaid Agencies in conjunction with Health Care Financing Administration (HCFA)",
|
@@ -136,8 +136,11 @@ module Stupidedi
|
|
136
136
|
elsif zipper.node.composite?
|
137
137
|
if zipper.node.blank?
|
138
138
|
if zipper.node.usage.required?
|
139
|
+
# GH-194: Normally the position of a composit element is the
|
140
|
+
# position of it's first child; but an empty composit element
|
141
|
+
# doesn't have children. So the closest position is of the parent
|
139
142
|
raise Exceptions::ParseError,
|
140
|
-
"required
|
143
|
+
"required #{zipper.node.descriptor} is blank at #{zipper.parent.node.position.inspect}"
|
141
144
|
end
|
142
145
|
elsif zipper.node.usage.forbidden?
|
143
146
|
raise Exceptions::ParseError,
|
@@ -10,6 +10,15 @@ module Stupidedi
|
|
10
10
|
|
11
11
|
def_delegators :definition, :code_lists
|
12
12
|
|
13
|
+
# @return [Symbol]
|
14
|
+
abstract :id
|
15
|
+
|
16
|
+
# @return [String]
|
17
|
+
abstract :name
|
18
|
+
|
19
|
+
# @return [String]
|
20
|
+
abstract :description
|
21
|
+
|
13
22
|
# @return [ElementReq]
|
14
23
|
abstract :requirement
|
15
24
|
|
@@ -7,7 +7,7 @@ module Stupidedi
|
|
7
7
|
# @return [CompositeElementDef]
|
8
8
|
attr_reader :definition
|
9
9
|
|
10
|
-
def_delegators :definition, :id
|
10
|
+
def_delegators :definition, :id, :name, :description
|
11
11
|
|
12
12
|
# @return [ElementReq]
|
13
13
|
attr_reader :requirement
|
@@ -38,6 +38,11 @@ module Stupidedi
|
|
38
38
|
changes.fetch(:parent, @parent)
|
39
39
|
end
|
40
40
|
|
41
|
+
def descriptor
|
42
|
+
n = parent.element_uses.index{|u| u.eql?(self) } + 1
|
43
|
+
"element #{parent.id}#{"%02d" % n} #{definition.name}".strip
|
44
|
+
end
|
45
|
+
|
41
46
|
def repeatable?
|
42
47
|
@repeat_count.try{|r| r.include?(2) }
|
43
48
|
end
|
@@ -17,11 +17,15 @@ module Stupidedi
|
|
17
17
|
# @return [SegmentDef]
|
18
18
|
attr_reader :definition
|
19
19
|
|
20
|
+
def_delegators :definition, :id, :name, :descriptor, :code_lists
|
21
|
+
|
20
22
|
# @see X222 B.1.1.3.12.6 Data Segment Requirement Designators
|
21
23
|
#
|
22
24
|
# @return [SegmentReq]
|
23
25
|
attr_reader :requirement
|
24
26
|
|
27
|
+
def_delegators :requirement, :required?, :optional?
|
28
|
+
|
25
29
|
# @see X222 B.1.3.12.3 Repeated Occurrences of Single Data Segments
|
26
30
|
# @see X222 B.1.3.12.8 Data Segment Occurrence
|
27
31
|
#
|
@@ -31,10 +35,6 @@ module Stupidedi
|
|
31
35
|
# @return [LoopDef, TableDef]
|
32
36
|
attr_reader :parent
|
33
37
|
|
34
|
-
def_delegators :definition, :descriptor, :id, :name, :code_lists
|
35
|
-
|
36
|
-
def_delegators :requirement, :required?, :optional?
|
37
|
-
|
38
38
|
def initialize(definition, position, requirement, repeat_count, parent)
|
39
39
|
@definition, @position, @requirement, @repeat_count, @parent =
|
40
40
|
definition, position, requirement, repeat_count, parent
|
@@ -0,0 +1,162 @@
|
|
1
|
+
module Stupidedi
|
2
|
+
module TransactionSets
|
3
|
+
module FortyTen
|
4
|
+
module Implementations
|
5
|
+
b = Builder
|
6
|
+
d = Schema
|
7
|
+
r = SegmentReqs
|
8
|
+
e = ElementReqs
|
9
|
+
s = SegmentDefs
|
10
|
+
IN810 = b.build("IN", "810", "Invoice",
|
11
|
+
d::TableDef.header("Heading",
|
12
|
+
b::Segment(10, s:: ST, "Transaction Set Header", r::Required, d::RepeatCount.bounded(1),
|
13
|
+
b::Element(e::Required, "Transaction Set Identifier Code", b::Values("810")),
|
14
|
+
b::Element(e::Required, "Transaction Set Control Number")),
|
15
|
+
b::Segment(20, s::BIG, "Beginning Segment for Invoice", r::Required, d::RepeatCount.bounded(1),
|
16
|
+
b::Element(e::Required, "Date"),
|
17
|
+
b::Element(e::Required, "Invoice Number"),
|
18
|
+
b::Element(e::Situational, "Date"),
|
19
|
+
b::Element(e::Situational, "Purchase Order Number"),
|
20
|
+
b::Element(e::Situational, "Release Number"),
|
21
|
+
b::Element(e::Situational, "Change Order Sequence Number"),
|
22
|
+
b::Element(e::Situational, "Transaction Type Code"),
|
23
|
+
b::Element(e::Situational, "Transaction Set Purpose Code"),
|
24
|
+
b::Element(e::Situational, "Action Code"),
|
25
|
+
b::Element(e::Situational, "Invoice Number")),
|
26
|
+
d::LoopDef.build("N1", d::RepeatCount.bounded(200),
|
27
|
+
b::Segment(110, s:: N1, "Name", r::Situational, d::RepeatCount.bounded(1),
|
28
|
+
b::Element(e::Required, "Entity Identifier Code"),
|
29
|
+
b::Element(e::Situational, "Name"),
|
30
|
+
b::Element(e::Situational, "Identification Code Qualifier"),
|
31
|
+
b::Element(e::Situational, "Identification Code"),
|
32
|
+
b::Element(e::Situational, "Code describing entity relationship"),
|
33
|
+
b::Element(e::Situational, "Code identifying an organizational entity, a physical location, property or an individual")),
|
34
|
+
b::Segment(120, s:: N2, "Address Information", r::Situational, d::RepeatCount.bounded(2),
|
35
|
+
b::Element(e::Situational, "Name"),
|
36
|
+
b::Element(e::Situational, "Name")),
|
37
|
+
b::Segment(130, s:: N3, "Address Information", r::Situational, d::RepeatCount.bounded(2),
|
38
|
+
b::Element(e::Situational, "Address Information"),
|
39
|
+
b::Element(e::Situational, "Address Information")),
|
40
|
+
b::Segment(140, s:: N4, "Geographic Location", r::Situational, d::RepeatCount.unbounded,
|
41
|
+
b::Element(e::Situational, "City Name"),
|
42
|
+
b::Element(e::Situational, "State or Province Code"),
|
43
|
+
b::Element(e::Situational, "Postal Code"),
|
44
|
+
b::Element(e::Situational, "Country Code"),
|
45
|
+
b::Element(e::Situational, "Location Qualifier"),
|
46
|
+
b::Element(e::Situational, "Location Identifier"))), #end LoopDef N1, Segment 140
|
47
|
+
b::Segment(200, s:: ITD, "Terms of Sale or Deferred Terms of Sale", r::Situational, d::RepeatCount.unbounded,
|
48
|
+
b::Element(e::Situational, "Terms Type Code"),
|
49
|
+
b::Element(e::Situational, "Terms Basis Date Code"),
|
50
|
+
b::Element(e::Situational, "Terms Discount Percent"),
|
51
|
+
b::Element(e::Situational, "Terms Discount Due Date"),
|
52
|
+
b::Element(e::Situational, "Terms Discount Days Due"),
|
53
|
+
b::Element(e::Situational, "Terms Net Due Date"),
|
54
|
+
b::Element(e::Situational, "Terms Net Days"),
|
55
|
+
b::Element(e::Situational, "Terms Discount Amount"),
|
56
|
+
b::Element(e::Situational, "Terms Deferred Due Date"),
|
57
|
+
b::Element(e::Situational, "Deferred Amount Due"),
|
58
|
+
b::Element(e::Situational, "Percent of Invoice Payable"),
|
59
|
+
b::Element(e::Situational, "Description"),
|
60
|
+
b::Element(e::Situational, "Day of Month"),
|
61
|
+
b::Element(e::Situational, "Payment Method Code"),
|
62
|
+
b::Element(e::Situational, "Percent"))), #end TableDef HEADING, Segment 200
|
63
|
+
d::TableDef.header("Detail",
|
64
|
+
d::LoopDef.build("IT1", d::RepeatCount.bounded(100000),
|
65
|
+
b::Segment(10, s::IT1, "Baseline Item Data (Invoice)", r::Required, d::RepeatCount.bounded(1),
|
66
|
+
b::Element(e::Situational, "Assigned Identification"),
|
67
|
+
b::Element(e::Situational, "Quantity"),
|
68
|
+
b::Element(e::Situational, "UOM"),
|
69
|
+
b::Element(e::Situational, "Unit Price"),
|
70
|
+
b::Element(e::Situational, "Basis of Unit Price Code"),
|
71
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
72
|
+
b::Element(e::Situational, "Product/Service ID"),
|
73
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
74
|
+
b::Element(e::Situational, "Product/Service ID"),
|
75
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
76
|
+
b::Element(e::Situational, "Product/Service ID"),
|
77
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
78
|
+
b::Element(e::Situational, "Product/Service ID"),
|
79
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
80
|
+
b::Element(e::Situational, "Product/Service ID"),
|
81
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
82
|
+
b::Element(e::Situational, "Product/Service ID"),
|
83
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
84
|
+
b::Element(e::Situational, "Product/Service ID"),
|
85
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
86
|
+
b::Element(e::Situational, "Product/Service ID"),
|
87
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
88
|
+
b::Element(e::Situational, "Product/Service ID"),
|
89
|
+
b::Element(e::Situational, "Product/Service ID Qualifier"),
|
90
|
+
b::Element(e::Situational, "Product/Service ID")), #end Segment 10
|
91
|
+
b::Segment(20, s::TXI, "Tax Information", r::Situational, d::RepeatCount.bounded(10),
|
92
|
+
b::Element(e::Situational, "Tax Type Code"),
|
93
|
+
b::Element(e::Situational, "Monetary Amount"),
|
94
|
+
b::Element(e::Situational, "Percent"),
|
95
|
+
b::Element(e::Situational, "Tax Jurisdiction Code Qualifier"),
|
96
|
+
b::Element(e::Situational, "Tax Jurisdiction Code"),
|
97
|
+
b::Element(e::Situational, "Tax Exempt Code"),
|
98
|
+
b::Element(e::Situational, "Relationship Code"),
|
99
|
+
b::Element(e::Situational, "Dollar Basis For Percent"),
|
100
|
+
b::Element(e::Situational, "Tax Identification Number"),
|
101
|
+
b::Element(e::Situational, "Assigned Identification")), #end Segment 20
|
102
|
+
d::LoopDef.build("PID", d::RepeatCount.bounded(1000),
|
103
|
+
b::Segment(30, s::PID, "Product/Item Description", r::Situational, d::RepeatCount.bounded(1),
|
104
|
+
b::Element(e::Situational, "Item Description Type"),
|
105
|
+
b::Element(e::Situational, "Process Characteristic Code"),
|
106
|
+
b::Element(e::Situational, "Agency Qualifier Code"),
|
107
|
+
b::Element(e::Situational, "Product Description Code"),
|
108
|
+
b::Element(e::Situational, "Description"),
|
109
|
+
b::Element(e::Situational, "Surface/Layer/Position Code"),
|
110
|
+
b::Element(e::Situational, "Source Subqualifier"),
|
111
|
+
b::Element(e::Situational, "Yes/No Condition or Response Code"),
|
112
|
+
b::Element(e::Situational, "Language Code"))))), #end TableDef Detail, LoopDef IT1, LoopDef PID, Segment 30
|
113
|
+
d::TableDef.header("Summary",
|
114
|
+
b::Segment(10, s::TDS, "Total Monetary Value Summary", r::Required, d::RepeatCount.bounded(1),
|
115
|
+
b::Element(e::Situational, "Amount"),
|
116
|
+
b::Element(e::Situational, "Amount"),
|
117
|
+
b::Element(e::Situational, "Amount"),
|
118
|
+
b::Element(e::Situational, "Amount")), #end Segment 10
|
119
|
+
b::Segment(20, s::TXI, "Tax Information", r::Situational, d::RepeatCount.bounded(10),
|
120
|
+
b::Element(e::Situational, "Tax Type Code"),
|
121
|
+
b::Element(e::Situational, "Monetary Amount"),
|
122
|
+
b::Element(e::Situational, "Percent"),
|
123
|
+
b::Element(e::Situational, "Tax Jurisdiction Code Qualifier"),
|
124
|
+
b::Element(e::Situational, "Tax Jurisdiction Code"),
|
125
|
+
b::Element(e::Situational, "Tax Exempt Code"),
|
126
|
+
b::Element(e::Situational, "Relationship Code"),
|
127
|
+
b::Element(e::Situational, "Dollar Basis For Percent"),
|
128
|
+
b::Element(e::Situational, "Tax Identification Number"),
|
129
|
+
b::Element(e::Situational, "Assigned Identification")), #end Segment 20
|
130
|
+
d::LoopDef.build("SAC", d::RepeatCount.bounded(25),
|
131
|
+
b::Segment(30, s::SAC, "Service, Promotion, Allowance, or Charge Information", r::Situational, d::RepeatCount.bounded(1),
|
132
|
+
b::Element(e::Situational, "Allowance or Charge Indicator"),
|
133
|
+
b::Element(e::Situational, "Service, Promotion, Allowance, or Charge Code"),
|
134
|
+
b::Element(e::Situational, "Agency Qualifier Code"),
|
135
|
+
b::Element(e::Situational, "Agency Service, Promotion, Allowance, or Charge Code"),
|
136
|
+
b::Element(e::Situational, "Amount"),
|
137
|
+
b::Element(e::Situational, "Allowance/Charge Percent Qualifier"),
|
138
|
+
b::Element(e::Situational, "Percent"),
|
139
|
+
b::Element(e::Situational, "Rate"),
|
140
|
+
b::Element(e::Situational, "Unit or Basis for Measurement Code"),
|
141
|
+
b::Element(e::Situational, "Quantity"),
|
142
|
+
b::Element(e::Situational, "Quantity"),
|
143
|
+
b::Element(e::Situational, "Allowance or Charge Method of Handling Code"),
|
144
|
+
b::Element(e::Situational, "Reference Identification"),
|
145
|
+
b::Element(e::Situational, "Option Number"),
|
146
|
+
b::Element(e::Situational, "Description"),
|
147
|
+
b::Element(e::Situational, "Language Code"))), #end LoopDef SAC, Segment 30
|
148
|
+
b::Segment(40, s::CTT, "Transaction Totals", r::Situational, d::RepeatCount.bounded(10),
|
149
|
+
b::Element(e::Situational, "Number of Line Items"),
|
150
|
+
b::Element(e::Situational, "Hash Total"),
|
151
|
+
b::Element(e::Situational, "Weight"),
|
152
|
+
b::Element(e::Situational, "Unit or Basis for Measurement Code"),
|
153
|
+
b::Element(e::Situational, "Volume"),
|
154
|
+
b::Element(e::Situational, "Unit or Basis for Measurement Code"),
|
155
|
+
b::Element(e::Situational, "Description")), #end Segment 40
|
156
|
+
b::Segment(50, s:: SE, "Transaction Set Trailer", r::Required, d::RepeatCount.bounded(1),
|
157
|
+
b::Element(e::Required, "Number of Included Segments"),
|
158
|
+
b::Element(e::Required, "Transaction Set Control Number")))) #end build IN, TableDef Summary, Segment 50
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
@@ -28,6 +28,7 @@ module Stupidedi
|
|
28
28
|
#utoload :SQ866, "stupidedi/transaction_sets/004010/implementations/SQ866"
|
29
29
|
autoload :SS862, "stupidedi/transaction_sets/004010/implementations/SS862"
|
30
30
|
#utoload :SW945, "stupidedi/transaction_sets/004010/implementations/SW945"
|
31
|
+
autoload :IN810, "stupidedi/transaction_sets/004010/implementations/IN810"
|
31
32
|
|
32
33
|
module X091A1
|
33
34
|
autoload :HP835, "stupidedi/transaction_sets/004010/implementations/X091A1-HP835"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Stupidedi
|
2
|
+
module TransactionSets
|
3
|
+
module FortyTen
|
4
|
+
module Standards
|
5
|
+
b = Builder
|
6
|
+
d = Schema
|
7
|
+
r = SegmentReqs
|
8
|
+
s = SegmentDefs
|
9
|
+
|
10
|
+
IN810 = b.build("IN", "810", "Invoice",
|
11
|
+
d::TableDef.header("1 - Header",
|
12
|
+
s::ST.use( 10, r::Mandatory, d::RepeatCount.bounded(1)),
|
13
|
+
s::BIG.use( 20, r::Mandatory, d::RepeatCount.bounded(1)),
|
14
|
+
s::REF.use( 30, r::Optional, d::RepeatCount.bounded(1)),
|
15
|
+
d::LoopDef.build("N1", d::RepeatCount.bounded(200),
|
16
|
+
s:: N1.use( 110, r::Optional, d::RepeatCount.bounded(1)),
|
17
|
+
s:: N2.use( 120, r::Optional, d::RepeatCount.bounded(2)),
|
18
|
+
s:: N3.use( 130, r::Optional, d::RepeatCount.bounded(2)),
|
19
|
+
s:: N4.use( 140, r::Optional, d::RepeatCount.unbounded)), #end LoopDef build N1
|
20
|
+
s::ITD.use( 200, r::Optional, d::RepeatCount.unbounded)), #end TableDef Header
|
21
|
+
d::TableDef.detail("2 - Detail",
|
22
|
+
d::LoopDef.build("IT1", d::RepeatCount.bounded(100000),
|
23
|
+
s::IT1.use( 10, r::Mandatory, d::RepeatCount.bounded(1)),
|
24
|
+
s::TXI.use( 20, r::Optional, d::RepeatCount.bounded(10)),
|
25
|
+
d::LoopDef.build("PID", d::RepeatCount.bounded(1000),
|
26
|
+
s::PID.use( 30, r::Optional, d::RepeatCount.bounded(1))), #end LoopDef build PID
|
27
|
+
s::REF.use( 40, r::Optional, d::RepeatCount.unbounded))), #end TableDef Detail, LoopDef build IT1
|
28
|
+
d::TableDef.summary("3 - Summary",
|
29
|
+
s::TDS.use( 10, r::Mandatory, d::RepeatCount.bounded(1)),
|
30
|
+
s::TXI.use( 20, r::Optional, d::RepeatCount.bounded(10)),
|
31
|
+
d::LoopDef.build("SAC", d::RepeatCount.bounded(25),
|
32
|
+
s:: SAC.use( 30, r::Optional, d::RepeatCount.bounded(1))), #end LoopDef build SAC
|
33
|
+
s:: CTT.use( 40, r::Optional, d::RepeatCount.bounded(10)),
|
34
|
+
s:: SE.use( 50, r::Mandatory, d::RepeatCount.bounded(1)))) #end build IN, TableDef Summary
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -21,7 +21,8 @@ module Stupidedi
|
|
21
21
|
|
22
22
|
d::TableDef.detail("2 - Detail",
|
23
23
|
d::LoopDef.build("PO1", d::RepeatCount.bounded(10000),
|
24
|
-
s::PO1.use( 10, r::Mandatory, d::RepeatCount.bounded(1))
|
24
|
+
s::PO1.use( 10, r::Mandatory, d::RepeatCount.bounded(1)),
|
25
|
+
s::ACK.use( 10, r::Optional, d::RepeatCount.bounded(1)))),
|
25
26
|
|
26
27
|
d::TableDef.summary("3 - Summary",
|
27
28
|
d::LoopDef.build("CTT", d::RepeatCount.bounded(1),
|
@@ -13,6 +13,7 @@ module Stupidedi
|
|
13
13
|
autoload :OW940, "stupidedi/transaction_sets/004010/standards/OW940"
|
14
14
|
autoload :PO850, "stupidedi/transaction_sets/004010/standards/PO850"
|
15
15
|
autoload :PR855, "stupidedi/transaction_sets/004010/standards/PR855"
|
16
|
+
autoload :IN810, "stupidedi/transaction_sets/004010/standards/IN810"
|
16
17
|
autoload :PS830, "stupidedi/transaction_sets/004010/standards/PS830"
|
17
18
|
autoload :QM214, "stupidedi/transaction_sets/004010/standards/QM214"
|
18
19
|
autoload :RE944, "stupidedi/transaction_sets/004010/standards/RE944"
|