Module: Stupidedi::Versions::FunctionalGroups::FortyTen::SegmentDefs

Defined in:
lib/stupidedi/versions/functional_groups/004010/segment_defs.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/N9.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/N4.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/M7.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/L5.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/N7.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/GE.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/S5.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/N1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/B2.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/B1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/LQ.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/N3.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/N2.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/L3.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/ST.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/LX.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/SE.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/HL.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/K1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/GS.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W01.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/BEG.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/DTM.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AK1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/FST.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W03.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/PLD.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/L11.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/G61.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W17.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AT8.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/NTE.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AK4.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/SN1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/MEA.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AK2.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/B10.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/BSN.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/NM1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/BSS.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/TD1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/MOA.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/MIA.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W12.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/LIN.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AK3.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/UIT.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W08.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/MS3.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/G69.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/PER.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/PLB.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/LH1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/SHP.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/CLP.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/TS2.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/CTT.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/QTY.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/B2A.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W07.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/JIT.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W27.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AT7.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/LFH.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/MS2.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W76.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/BFR.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/TD3.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/CUR.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/SDP.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/G62.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/PID.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/TRN.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W06.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/MS1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W20.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/PO1.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/REF.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/TD5.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/TS3.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/CAS.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W05.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AK9.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W66.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/LH2.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/MAN.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/BPR.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/PO4.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AMT.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W04.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/W14.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/LH3.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/SVC.rb,
lib/stupidedi/versions/functional_groups/004010/segment_defs/AK5.rb

Constant Summary

N9 =
s::SegmentDef.build(:N9 , "Reference Identification",
"To transmit identifying information as specified by the Reference Identification Qualifier",
e::E128 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E369 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E623 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::C040 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(2, 3),
SyntaxNotes::C.build(6, 5))
N4 =
s::SegmentDef.build(:N4, "Geographic Location",
"To specify the goegraphic place of the named party",
e::E19 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E156.simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E116.simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E26 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E309.simple_use(r::Relational,s::RepeatCount.bounded(1)),
e::E310.simple_use(r::Optional,  s::RepeatCount.bounded(1)),

SyntaxNotes::C.build(6, 5))
M7 =
s::SegmentDef.build(:M7 , "Seal Numbers",
"To record seal numbers used and the organization that applied the seals",
e::E225 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E225 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E225 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E225 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E98  .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
L5 =
s::SegmentDef.build(:L5 , "Description, Marks and Numbers",
"To specify the line item in terms of description, quantity, packaging, and marks and numbers",
e::E213.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E79 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E22 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E23 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E103.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E87 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E88 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E23 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E22 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E595.simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(3, 4),
SyntaxNotes::C.build(7, 6),
SyntaxNotes::P.build(8, 9))
N7 =
s::SegmentDef.build(:N7 , "Equipment Details",
"To identify the equipment",
e::E206.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E207.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E81 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E187.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E167.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E232.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E205.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E183.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E184.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E102.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E40 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E140.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E319.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E219.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E567.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E571.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E188.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E761.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E56 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E65 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E189.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E24 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E140.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E301.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
SyntaxNotes::P.build(3,  4),
SyntaxNotes::P.build(5, 16),
SyntaxNotes::P.build(8,  9))
GE =
s::SegmentDef.build(:GE, "Functional Group Trailer",
"To indicate the end of a functional group and provider control information",
e::E97  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E28  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
S5 =
s::SegmentDef.build(:S5 , "Stop Off Details",
"To specify stop-off detail reference numbers and stop reason",
e::E165 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E163 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E382 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E183 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E184 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E352 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E154 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E190 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(3, 4),
SyntaxNotes::P.build(5, 6),
SyntaxNotes::P.build(7, 8))
N1 =
s::SegmentDef.build(:N1, "Name",
"To identify a party by type of organization, name, and code",
e::E98  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E93  .simple_use(r::Optional, s::RepeatCount.bounded(1)),
e::E66  .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E67  .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E706 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E98  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(3, 4),
SyntaxNotes::R.build(2, 3))
B2 =
s::SegmentDef.build(:B2, "Beginning Segment for Shipment Information Transaction",
"To transmit basic data relating to shipment information",
e::E375 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E140 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E154 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E145 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E146 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E147 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E86  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E460 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E501 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E335 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E591 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
B1 =
s::SegmentDef.build(:B1, "Beginning Segment for Booking or Pick-up/Delivery",
"To transmit identifying numbers, dates, and other basic data relating to the transaction set",
e::E140 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E145 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E558 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
LQ =
s::SegmentDef.build(:LQ, "Industry Code Identification",
"To identify standard industry codes",
e::E1270.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1271.simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::C.build(1, 2))
N3 =
s::SegmentDef.build(:N3 , "Address Information",
"To specify the location of the named party",
e::E166 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E166 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
N2 =
s::SegmentDef.build(:N2, "Additional Name Information",
"Additional Name Information",
e::E93  .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E93  .simple_use(r::Optional,  s::RepeatCount.bounded(1)))
L3 =
s::SegmentDef.build(:L3 , "Total Weight and Charges",
"To specify the total shipment in terms of weight, volume, rates, charges, advances, and prepaid amounts applicable to one or more line items",
e::E81 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E187.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E60 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E122.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E58 .simple_use(r::Optional  , s::RepeatCount.bounded(1)),
e::E191.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E117.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E150.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E183.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E184.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E80 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E188.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E171.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E74 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E122.simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build( 1,  2),
SyntaxNotes::P.build( 3,  4),
SyntaxNotes::P.build( 9, 10),
SyntaxNotes::C.build(12,  1),
SyntaxNotes::P.build(14, 15))
ST =
s::SegmentDef.build(:ST, "Transaction Set Header",
"To indicate the start of a transaction set and assign a control number",
e::E143 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E329 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
LX =
s::SegmentDef.build(:LX, "Assigned Numbers",
"To reference a line number in a transaction set",
e::E554.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
SE =
s::SegmentDef.build(:SE, "Transaction Set Trailer",
"To indicate the end of the transaction set and provide the count of the transmitted segments (including the beginning (ST) and ending (SE) segments)",
e::E96  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E329 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
HL =
s::SegmentDef.build(:HL, "Hierarchical Level",
"To identify dependencies among the content of hierarchically related groups of data segments",
e::E628 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E734 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E735 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E736 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
K1 =
s::SegmentDef.build(:K1 , "Remarks",
"To transmit information in a free-form format for comment or special instruction",
e::E61.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E61.simple_use(r::Optional ,  s::RepeatCount.bounded(1)))
GS =
s::SegmentDef.build(:GS, "Functional Group Header",
"To indicate the beginning of a functional group and to provider control information",
e::E479 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E142 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E124 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E28  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),

e::E455 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E480 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
W01 =
s::SegmentDef.build(:W01, "Line Item Detail",
"Line Item Detail",
e::E380 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E438 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E59  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E121 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E23  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E22  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E416 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E451 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E286 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E560 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::R.build( 3,  4),
SyntaxNotes::P.build( 4,  5),
SyntaxNotes::P.build( 6,  7),
SyntaxNotes::P.build(10, 11),
SyntaxNotes::P.build(15, 16))
BEG =
s::SegmentDef.build(:BEG, "Beginning Segment for Purchase Order",
"To indicate the beginning of the Purchase Order Transaction Set and transmit identifying numbers and dates",
e::E353 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E92  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E324 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E328 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E367 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E587 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1019.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1166.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1232.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E786 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E640 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
DTM =
s::SegmentDef.build(:DTM, "Date/Time Reference",
"To specify pertinent dates and times",
e::E374 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E623 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1250.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1251.simple_use(r::Relational,   s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(2, 3, 5),
SyntaxNotes::C.build(4, 3),
SyntaxNotes::P.build(5, 6))
AK1 =
s::SegmentDef.build(:AK1, "Functional Group Response Header",
"To start acknowledgement of a functional group",
e::E479 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E28  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
FST =
s::SegmentDef.build(:FST, "Forecast Schedule",
"To specify the forecasted dates and quantities",
e::E380 .simple_use(r::Mandatory,   s::RepeatCount.bounded(1)),
e::E680 .simple_use(r::Mandatory,   s::RepeatCount.bounded(1)),
e::E681 .simple_use(r::Mandatory,   s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,   s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Optional,    s::RepeatCount.bounded(1)),
e::E374 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E128 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Relational,  s::RepeatCount.bounded(1)))
W03 =
s::SegmentDef.build(:W03, "Total Shipment Information",
"To provide totals relating to the shipment",
e::E382 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E183 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E80  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(2, 3),
SyntaxNotes::P.build(4, 5),
SyntaxNotes::P.build(6, 7))
PLD =
s::SegmentDef.build(:PLD, "Pallet Information",
"To specify pallet information including quantity, exchange, and weight",
e::E406 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E399 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(3, 4))
L11 =
s::SegmentDef.build(:L11, "Business Instructions and Reference Number",
"To specify instructions in this business relationship or a reference number",
e::E127 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E128 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E352 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(1,3),
SyntaxNotes::P.build(1,2))
G61 =
s::SegmentDef.build(:G61, "Contact",
"To identify a person or office to whom communications should be directed",
e::E366 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E93  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E365 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E364 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E443 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(3, 4))
W17 =
s::SegmentDef.build(:W17, "Warehouse Receipt Identification",
"To provide identifying numbers and date",
e::E514 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E394 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E285 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E145 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E176 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E474 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E472 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(6, 7),
SyntaxNotes::P.build(8, 9))
AT8 =
s::SegmentDef.build(:AT8, "Shipment Weight, Packaging and Quantity Data",
"To specify shipment details in terms of weight, and quantity of handling units",
e::E187 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E80  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E80  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E184 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E183 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(6, 7),
SyntaxNotes::P.build(1, 2, 3))
NTE =
s::SegmentDef.build(:NTE, "Note/Special Instruction",
"To transmit information in a free-form format, if necessary, for comment or special instruction",
e::E363 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E352 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
AK4 =
s::SegmentDef.build(:AK4, "Data Segement Note",
"To report errors in a data segment, and identify the location of a data segment.",
e::C030 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E725 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E723 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E724 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
SN1 =

Definition might be outdated, working from ANSI X12 2001 specification

s::SegmentDef.build(:SN1, "Item Detail (Shipment)",
"To specify line-item detail relative to shipment",
e::E350 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E382 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E646 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E330 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E728 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E668 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
MEA =
s::SegmentDef.build(:MEA, "Measurements",
"To specify physical measurements or counts, including dimensions, tolerances, variances, and weights(See Figures Appendix for example of use of C001)",
e::E737 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E738 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E738 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::C001 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E740 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E741 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E935 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E936 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E752 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1373.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1270.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1271.simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::R.build( 3,  5,  6,  8),
SyntaxNotes::E.build( 4, 12),
SyntaxNotes::L.build( 5,  4, 12),
SyntaxNotes::L.build( 6,  4, 12),
SyntaxNotes::L.build( 7,  3,  5,  6),
SyntaxNotes::E.build( 8,  3),
SyntaxNotes::P.build(11, 12))
AK2 =
s::SegmentDef.build(:AK2, "Transaction Set Response Header",
"To start acknowledgement of a single transaction set",
e::E143 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E329 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
B10 =
s::SegmentDef.build(:B10, "Beginning Segment for Transportation Carrier Shipment Status Message",
"To transmit identifying numbers and other basic data relating to the transaction set",
e::E127 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E145 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E140 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E71  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E128 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1073.simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(1, 6),
SyntaxNotes::E.build(1, 5),
SyntaxNotes::P.build(5, 6))
BSN =
s::SegmentDef.build(:BSN, "Beginning Segment for Ship Notice",
"To transmit identifying numbers, dates, and other basic data relating to the transaction set",
e::E353 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E396 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E1005.simple_use(r::Optional,   s::RepeatCount.bounded(1)))
NM1 =
s::SegmentDef.build(:NM1, "Individual or Organizational Name",
"To supply the full name of an individual or organizational entity",
e::E98  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E1065.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E1035.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1036.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1037.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1038.simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E1039.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E66  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E67  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E706 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E98  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build( 8,  9),
SyntaxNotes::C.build(11, 10))
BSS =
s::SegmentDef.build(:BSS, "Beginning Segment for Shipping Schedule/Production Sequence",
"To transmit identifying numbers, dates, and other basic data relating to the transaction set",
e::E353.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E127.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E675.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E328.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E127.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E367.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E324.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E676.simple_use(r::Optional,   s::RepeatCount.bounded(1)))
TD1 =

Definition might be outdated, working from ANSI X12 2001 specification

s::SegmentDef.build(:TD1, "Carrier Details (Quantity and Weight)",
"To specify the transportation details relative to commodity, weight, and quantity",
e::E103 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
           #e::C103 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E80  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
MOA =
s::SegmentDef.build(:MOA, "Medicare Outpatient Adjudication",
"To convey claim-level data related to the adjudication of Medicare claims not related to an inpatient setting",
e::E954 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
MIA =
s::SegmentDef.build(:MIA, "Medicare Inpatient Adjudication",
"To provide claim-level data related to the adjudication of Medicare inpatient claims",
e::E380 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
W12 =
s::SegmentDef.build(:W12, "Warehouse Item Detail",
"To designate those line items that were shipped.",
e::E368 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E382 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E383 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E438 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E451 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E187 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E187 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E438 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E892 .simple_use(r::Optional  , s::RepeatCount.bounded(1)),
e::E893 .simple_use(r::Optional  , s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::R.build( 6,  7),
SyntaxNotes::P.build( 7,  8),
SyntaxNotes::P.build(10, 11, 12),
SyntaxNotes::P.build(13, 14, 15),
SyntaxNotes::P.build(17, 18),
SyntaxNotes::P.build(21, 22))
LIN =

Definition might be outdated, working from ANSI X12 2001 specification

s::SegmentDef.build(:LIN, "Item Identification",
"To specify basic item identification data",
e::E350 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)))
AK3 =
s::SegmentDef.build(:AK3, "Data Segement Note",
"To report errors in a data segment, and identify the location of a data segment.",
e::E721 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E719 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E447 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E720 .simple_use(r::Optional,  s::RepeatCount.bounded(1)))
UIT =
s::SegmentDef.build(:UIT, "Unit Detail",
"To specify item unit data",
e::C001 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E212 .simple_use(r::Relational, s::RepeatCount.bounded(1)))
W08 =
s::SegmentDef.build(:W08, "Receipt Carrier Information",
"To identify carrier equipment and condition.",
e::E91  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E140 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E387 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E206 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E207 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E225 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E225 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E407 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E400 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(2, 4),
SyntaxNotes::P.build(4, 5))
MS3 =
s::SegmentDef.build(:MS3, "Interline Information",
"To identify the interline carrier and relevant data",
e::E140 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E133 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E19  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E91  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E156 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::C.build(5,3))
G69 =
s::SegmentDef.build(:G69, "Line Item Detail - Description",
"To describe an item in free-form format",
e::E369.simple_use(r::Mandatory, s::RepeatCount.bounded(1)))
PER =
s::SegmentDef.build(:PER, "Administrative Communications Contact",
"To identify a person or office to whom administrative communications should be directed",
e::E366 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E93  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E365 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E364 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E365 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E364 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E365 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E364 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E443 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(3, 4),
SyntaxNotes::P.build(5, 6),
SyntaxNotes::P.build(7, 8))
PLB =
s::SegmentDef.build(:PLB, "Provider Level Adjustment",
"To convey provider level adjustment information for debit or credit transactions such as, accelerated payments, cost report settlements for a fiscal year, and timeliness report penalties unrelated to a specific claim or service",
e::E127 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::C042 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::C042 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::C042 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::C042 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::C042 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::C042 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build( 5,  6),
SyntaxNotes::P.build( 7,  8),
SyntaxNotes::P.build( 9, 10),
SyntaxNotes::P.build(11, 12),
SyntaxNotes::P.build(13, 14))
LH1 =
s::SegmentDef.build(:LH1, "Hazardous Identification Information",
"To specify the hazardous commodity identification reference number and quantity",
e::E355 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E80  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E277 .simple_use(r::Optional ,  s::RepeatCount.bounded(1)),
e::E200 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E22  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E595 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E665 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E254 .simple_use(r::Optional ,  s::RepeatCount.bounded(1)),
e::E1375.simple_use(r::Optional ,  s::RepeatCount.bounded(1)),
e::E1271.simple_use(r::Optional ,  s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(6 ,7))
SHP =
s::SegmentDef.build(:SHP, "Shipped/ReceivedInformationhip/Delivery Pattern",
"",
e::E673 .simple_use(r::Optional,    s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E374 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational,  s::RepeatCount.bounded(1)))
CLP =
s::SegmentDef.build(:CLP, "Claim Level Data",
"To supply information common to all services of a claim",
e::E1028.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E1029.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1032.simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1331.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1325.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1352.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1354.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E954 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
TS2 =
s::SegmentDef.build(:TS2, "Transaction Supplemental Statistics",
"To supply supplemental summary control information by provider fiscal year and bill type",
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
CTT =
s::SegmentDef.build(:CTT, "Transaction Totals",
"To transmit a hash total for a specific element in the transaction set",
e::E354 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E347 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E183 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E352 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(3, 4),
SyntaxNotes::P.build(5, 6))
QTY =
s::SegmentDef.build(:QTY, "Quantity Information",
"To specify quantity information",
e::E673.simple_use(r::Mandatory,   s::RepeatCount.bounded(1)),
e::E380.simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::C001.simple_use(r::Optional,    s::RepeatCount.bounded(1)),
e::E61 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(2, 4),
SyntaxNotes::E.build(2, 4))
B2A =
s::SegmentDef.build(:B2A, "Set Purpose",
"To allow for positive identification of transaction set purpose",
e::E353.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E346.simple_use(r::Optional,   s::RepeatCount.bounded(1)))
W07 =
s::SegmentDef.build(:W07, "Item Detail For Stock Receipt",
"To indicate quantity and condition of product received",
e::E380 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E438 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E451 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E893 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::R.build( 3,  4),
SyntaxNotes::P.build( 4,  5),
SyntaxNotes::P.build( 6,  7),
SyntaxNotes::P.build(10, 11))
JIT =
s::SegmentDef.build(:JIT, "Just-In-Time Schedule",
"To identify the specific shipping/delivery time in terms of a 24-hour clock and identify the associated quantity",
e::E380 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
W27 =
s::SegmentDef.build(:W27, "Carrier Detail",
"To specify details of the transportation equipment and carrier routing details",
e::E91  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E140 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E387 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E146 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E40  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E206 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E207 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E368 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E152 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E890 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(2, 3))
AT7 =
s::SegmentDef.build(:AT7, "Shipment Status Detail",
"To specify the status of a shipment, the reason for that status, the date and time of the status and the date and time of any appointments scheduled.",
e::E1650.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1651.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1652.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1651.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E623 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::E.build(1, 3),
SyntaxNotes::P.build(1, 2),
SyntaxNotes::P.build(3, 4),
SyntaxNotes::C.build(6, 5),
SyntaxNotes::C.build(7, 6))
LFH =
s::SegmentDef.build(:LFH, "Hazardous Material Shipping Name",
"To specify the hazardous material shipping name and additional descriptive requirements",
e::E808. simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E809. simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E809 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1023.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(5, 6))
MS2 =
s::SegmentDef.build(:MS2, "Equipment or Container Owner and Type",
"To specify the owner, the identification number assigned by that owner, and the type of equipment",
e::E140 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E207 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E40  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E761 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(1, 2),
SyntaxNotes::C.build(4, 2))
W76 =
s::SegmentDef.build(:W76, "Total Shipping Order",
"Total Shipping Order",
e::E380 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E183 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E398 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(2, 3),
SyntaxNotes::P.build(4, 5),
SyntaxNotes::C.build(6, 3))
BFR =
s::SegmentDef.build(:BFR, "Beginning Segment for Planning Schedule",
"To indicate the beginning of a planning schedule transaction set; whether a ship or delivery based forecast; and related forecast envelope dates",
e::E353 .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Relational,s::RepeatCount.bounded(1)),
e::E328 .simple_use(r::Relational,s::RepeatCount.bounded(1)),
e::E675 .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E676 .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory, s::RepeatCount.bounded(1)),
e::E367 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E324 .simple_use(r::Optional,  s::RepeatCount.bounded(1)))
TD3 =

Definition might be outdated, working from ANSI X12 2001 specification

s::SegmentDef.build(:TD3, "Carrier Details (Equipment)",
"To specify transportation details relating to the equipment used by the carrier",
e::E40  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E206 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E207 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E187 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)))
CUR =
s::SegmentDef.build(:CUR, "Currency",
"To specify the currency (dollars, pounds, francs, etc) used in a transaction",
e::E98  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E100 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E280 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E98  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E100 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E669 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E374 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E374 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E374 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E374 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E374 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::C.build( 8,  7),
SyntaxNotes::C.build( 9,  7),
SyntaxNotes::L.build(10, 11, 12),
SyntaxNotes::C.build(11, 10),
SyntaxNotes::C.build(12, 10),
SyntaxNotes::L.build(13, 14, 15),
SyntaxNotes::C.build(14, 13),
SyntaxNotes::C.build(15, 13),
SyntaxNotes::L.build(16, 17, 18),
SyntaxNotes::C.build(17, 16),
SyntaxNotes::C.build(18, 16),
SyntaxNotes::L.build(19, 20, 21),
SyntaxNotes::C.build(20, 19),
SyntaxNotes::C.build(21, 19))
SDP =
s::SegmentDef.build(:SDP, "Ship/Delivery Pattern",
"To identify specific ship/delivery requirements",
e::E678 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E679 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)))
G62 =
s::SegmentDef.build(:G62, "Date/Time",
"To specify pertinent dates and times",
e::E432 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E176 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E337 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E623 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(1, 2),
SyntaxNotes::P.build(3, 4))
PID =
s::SegmentDef.build(:PID, "Product/Item Description",
"To describe a product or process in coded or free-form format",
e::E349 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E750 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E559 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E751 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E352 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E752 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E822 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1073.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E819 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::C.build(4, 3),
SyntaxNotes::R.build(4, 5),
SyntaxNotes::C.build(7, 3),
SyntaxNotes::C.build(8, 4),
SyntaxNotes::C.build(9, 5))
TRN =
s::SegmentDef.build(:TRN, "Trace",
"To uniquely identify a transaction to an application",
e::E481 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E509 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
W06 =
s::SegmentDef.build(:W06, "Warehouse Shipment Identification",
"To provide identifying numbers, dates, and other basic data for this transaction set",
e::E514 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E285 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E145 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E531 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E324 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E474 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E472 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E152 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E891 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E640 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E306 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(7, 8))
MS1 =
s::SegmentDef.build(:MS1, "Equipment, Shipment, or Real Property Location",
"To specify the location of a piece of equipment, a shipment, or real property in terms of city and state for the stop location that relates to the AT7 shipment status details.",
e::E19  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E156 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E26  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1654.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1655.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1280.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1280.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E116 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::L.build(1, 2, 3),
SyntaxNotes::E.build(1, 4),
SyntaxNotes::C.build(2, 1),
SyntaxNotes::C.build(3, 1),
SyntaxNotes::P.build(4, 5),
SyntaxNotes::C.build(6, 4),
SyntaxNotes::C.build(7, 4),
SyntaxNotes::C.build(8, 1))
W20 =
s::SegmentDef.build(:W20, "Packing",
"To specify packing details of the items shipped",
e::E356 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E357 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E81  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E187 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E395 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E183 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E397 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(2, 3),
SyntaxNotes::P.build(4, 5, 6),
SyntaxNotes::P.build(8, 9))
PO1 =
s::SegmentDef.build(:PO1, "Baseline Item Data",
"To specify basic and most frequently used line item data",
e::E350 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Optional, s::RepeatCount.bounded(1)),
e::E212 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E639 .simple_use(r::Optional, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::C.build( 3,  2),
SyntaxNotes::C.build( 5,  4),
SyntaxNotes::P.build( 6,  7),
SyntaxNotes::P.build( 8,  9),
SyntaxNotes::P.build(10, 11),
SyntaxNotes::P.build(12, 13),
SyntaxNotes::P.build(14, 15),
SyntaxNotes::P.build(16, 17),
SyntaxNotes::P.build(18, 19),
SyntaxNotes::P.build(20, 21),
SyntaxNotes::P.build(22, 23),
SyntaxNotes::P.build(24, 25))
REF =
s::SegmentDef.build(:REF, "Reference Identification",
"To specify identifying information",
e::E128 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E127 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E352 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::C040 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::R.build(2, 3))
TD5 =
s::SegmentDef.build(:TD5, "Carrier Details (Routing Sequence/Transit Time)",
"To specify the carrier and sequence of routing and provide transit time information",
e::E133.simple_use(r::Optional,  s::RepeatCount.bounded(1)),
e::E66 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E67 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E91 .simple_use(r::Relational, s::RepeatCount.bounded(1)))
TS3 =
s::SegmentDef.build(:TS3, "Transaction Statistics",
"To supply provider-level control information",
e::E127 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E1331.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
CAS =
s::SegmentDef.build(:CAS, "Claims Adjustment",
"To supply adjustment reason codes and amounts as needed for an entire claim or for a particular service within the claim being paid",
e::E1033.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E1034.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E1034.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1034.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1034.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1034.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E1034.simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E380 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::L.build( 5,  6,  7),
SyntaxNotes::C.build( 6,  5),
SyntaxNotes::C.build( 7,  5),
SyntaxNotes::L.build( 8,  9, 10),
SyntaxNotes::C.build( 9,  8),
SyntaxNotes::C.build(10,  8),
SyntaxNotes::L.build(11, 12, 13),
SyntaxNotes::C.build(12, 11),
SyntaxNotes::C.build(13, 11),
SyntaxNotes::L.build(14, 15, 16),
SyntaxNotes::C.build(15, 14),
SyntaxNotes::C.build(16, 14),
SyntaxNotes::L.build(17, 18, 19),
SyntaxNotes::C.build(18, 17),
SyntaxNotes::C.build(19, 17))
W05 =
s::SegmentDef.build(:W05, "Shipping Order Identification",
"Shipping Order Identification",
e::E473. simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E285. simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E324. simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E472. simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E474. simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E640 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E306 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E92  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(4, 5))
AK9 =
s::SegmentDef.build(:AK9, "Functional Group Response Trailer",
"To acknowledge acceptance or rejection of a functional group and report the number of included transaction sets from the original trailer, the accepted sets, and the received sets in this functional group",
e::E715 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E97  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E123 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E2   .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E716 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E716 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E716 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E716 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E716 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
W66 =
s::SegmentDef.build(:W66, "Warehouse Carrier Information",
"Warehouse Carrier Information",
e::E146 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E91  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E399 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E400 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E387 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E433 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E434 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E625 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E610 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E140 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(8, 9))
LH2 =
s::SegmentDef.build(:LH2, "Hazardous Classification Information",
"To specify the hazadous notation and endorsement information",
e::E215. simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E983. simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E218 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E222 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E759 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E408 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E408 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E408 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E188 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E267 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build( 6,  7),
SyntaxNotes::P.build( 8,  9),
SyntaxNotes::P.build(10, 11),
SyntaxNotes::P.build(12, 13))
MAN =
s::SegmentDef.build(:MAN, "Marks and Numbers",
"To indicate identifying marks and numbers for shipping containers",
e::E88  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E87  .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E87  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E88  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E87  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E87  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(4, 5),
SyntaxNotes::C.build(6, 5))
BPR =
s::SegmentDef.build(:BPR, "Financial Information",
"To indicate the beginning of a Payment Order/Remittance Advice Transaction Set and total payment amount, or to enable related transfer of funds and/or information from payer to payee to occur",
e::E305 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E478 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E591 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E812 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E506 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E507 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E569 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E508 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E509 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E510 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E506 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E507 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E569 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E508 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E373 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E1048.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E506 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

e::E507 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E569 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E508 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::P.build( 6,  7),
SyntaxNotes::C.build( 8,  9),
SyntaxNotes::P.build(12, 13),
SyntaxNotes::C.build(14, 15),
SyntaxNotes::P.build(18, 19),
SyntaxNotes::C.build(20, 21))
PO4 =

Definition might be outdated, working from ANSI X12 2001 specification

s::SegmentDef.build(:PO4, "Item Physical Details",
"To specify the physical qualities, packaging, weights, and dimensions relating to the item",
e::E356 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E357 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Relational, s::RepeatCount.bounded(1)))
AMT =
s::SegmentDef.build(:AMT, "Monetary Amount Information",
"To indicate the total monetary amount",
e::E522 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E478 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
W04 =
s::SegmentDef.build(:W04, "Item Detail Total",
"To designate those line items that were shipped",
e::E382 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E355 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E438 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E59  .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E121 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E23  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E22  .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E416 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E844 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E235 .simple_use(r::Relational, s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Relational, s::RepeatCount.bounded(1)),

SyntaxNotes::R.build( 3,  4),
SyntaxNotes::P.build( 4,  5),
SyntaxNotes::P.build( 6,  7),
SyntaxNotes::P.build(10, 11),
SyntaxNotes::P.build(14, 15))
W14 =
s::SegmentDef.build(:W14, "Total Receipt Information",
"To indicate total received quantity",
e::E380.simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E380.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380.simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380.simple_use(r::Optional,   s::RepeatCount.bounded(1)))
LH3 =
s::SegmentDef.build(:LH3, "Hazardous Material Shipping Name",
"To specify the hazardous material shipping name and additional descriptive requirements",
e::E224 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E984 .simple_use(r::Relational,  s::RepeatCount.bounded(1)),
e::E985 .simple_use(r::Optional,    s::RepeatCount.bounded(1)),
e::E1073.simple_use(r::Optional,    s::RepeatCount.bounded(1)),

SyntaxNotes::P.build(1, 2))
SVC =
s::SegmentDef.build(:SVC, "Service Payment Information",
"To supply payment and control information to a provider for a particular service",
e::C003 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E782 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E234 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::C003 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),

e::E380 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))
AK5 =
s::SegmentDef.build(:AK5, "Transaction Set Response Trailer",
"To acknowledge acceptance or rejection and report errors in a transaction set",
e::E717 .simple_use(r::Mandatory,  s::RepeatCount.bounded(1)),
e::E718 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E718 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E718 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E718 .simple_use(r::Optional,   s::RepeatCount.bounded(1)),
e::E718 .simple_use(r::Optional,   s::RepeatCount.bounded(1)))