stupidedi 1.2.16 → 1.2.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -12
  3. data/bin/edi-pp +2 -12
  4. data/lib/stupidedi/builder/generation.rb +2 -6
  5. data/lib/stupidedi/builder/states/failure_state.rb +5 -13
  6. data/lib/stupidedi/config.rb +5 -0
  7. data/lib/stupidedi/editor.rb +1 -0
  8. data/lib/stupidedi/guides/005010/X279-HB271.rb +832 -0
  9. data/lib/stupidedi/guides/005010/X279-HS270.rb +594 -0
  10. data/lib/stupidedi/guides/005010/X279A1-HB271.rb +845 -0
  11. data/lib/stupidedi/guides/005010/X279A1-HS270.rb +594 -0
  12. data/lib/stupidedi/guides/005010.rb +9 -0
  13. data/lib/stupidedi/version.rb +1 -1
  14. data/lib/stupidedi/versions/functional_groups/005010/element_defs.rb +619 -9
  15. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/AAA.rb +22 -0
  16. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/EB.rb +34 -0
  17. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/EQ.rb +25 -0
  18. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/HSD.rb +29 -0
  19. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/III.rb +31 -0
  20. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/MPI.rb +27 -0
  21. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/MSG.rb +23 -0
  22. data/lib/stupidedi/versions/functional_groups/005010/segment_defs.rb +22 -4
  23. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HB271.rb +14 -13
  24. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/HS270.rb +13 -12
  25. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs.rb +4 -4
  26. metadata +12 -1
@@ -0,0 +1,832 @@
1
+ module Stupidedi
2
+ module Guides
3
+ module FiftyTen
4
+ module X279
5
+
6
+ b = GuideBuilder
7
+ d = Schema
8
+ r = SegmentReqs
9
+ e = ElementReqs
10
+ s = Versions::FunctionalGroups::FiftyTen::SegmentDefs
11
+ t = Versions::FunctionalGroups::FiftyTen::TransactionSetDefs
12
+
13
+ HB271 = b.build(t::HB271,
14
+ d::TableDef.header("Table 1 - Header",
15
+ b::Segment(100, s::ST, "Transaction Set Header",
16
+ r::Required, d::RepeatCount.bounded(1),
17
+ b::Element(e::Required, "Transaction Set Identifier Code", b::Values("271")),
18
+ b::Element(e::Required, "Transaction Set Control Number"),
19
+ b::Element(e::Required, "Implementation Convention Reference", b::Values("005010X279"))),
20
+ b::Segment(200, s::BHT, "Beginning of Hierarchical Transaction",
21
+ r::Required, d::RepeatCount.bounded(1),
22
+ b::Element(e::Required, "Hierarchical Structure Code", b::Values("0022")),
23
+ b::Element(e::Required, "Transaction Set Purpose Code", b::Values("06", "11")),
24
+ b::Element(e::Situational, "Submitter Transaction Identifier"),
25
+ b::Element(e::Required, "Transaction Set Creation Date"),
26
+ b::Element(e::Required, "Transaction Set Creation Time"),
27
+ b::Element(e::NotUsed, "Transaction Type Code"))),
28
+
29
+ d::TableDef.detail("Table 2 - Information Source Detail",
30
+ d::LoopDef.build("2000A INFORMATION SOURCE LEVEL",
31
+ d::RepeatCount.bounded(1),
32
+ b::Segment(100, s::HL, "Information Source Level",
33
+ r::Required, d::RepeatCount.bounded(1),
34
+ b::Element(e::Required, "Hierarchical ID Number"),
35
+ b::Element(e::NotUsed, "Hierarchical Parent ID Number"),
36
+ b::Element(e::Required, "Hierarchical Level Code", b::Values("20")),
37
+ b::Element(e::Required, "Hierarchical Child Code", b::Values("0", "1"))),
38
+ b::Segment(250, s::AAA, "Request Validation",
39
+ r::Situational, d::RepeatCount.bounded(9),
40
+ b::Element(e::Required, "Valid Request Indicator", b::Values("Y", "N")),
41
+ b::Element(e::NotUsed, "Agency Qualifier Code"),
42
+ b::Element(e::Required, "Reject Reason Code", b::Values("04", "41", "42", "79")),
43
+ b::Element(e::Required, "Follow-up Action Code", b::Values("C", "N", "P", "R", "S", "Y"))),
44
+
45
+ d::LoopDef.build("2100A INFORMATION SOURCE NAME",
46
+ d::RepeatCount.bounded(1),
47
+ b::Segment(300, s::NM1, "Information Source Name",
48
+ r::Required, d::RepeatCount.bounded(1),
49
+ b::Element(e::Required, "Entity Identifier Code", b::Values("2B", "36", "GP", "P5", "PR")),
50
+ b::Element(e::Required, "Entity Type Qualifier", b::Values("1", "2")),
51
+ b::Element(e::Required, "Name Last or Organization Name"),
52
+ b::Element(e::Situational, "Name First"),
53
+ b::Element(e::Situational, "Name Middle"),
54
+ b::Element(e::NotUsed, "Name Prefix"),
55
+ b::Element(e::Situational, "Name Suffix"),
56
+ b::Element(e::Required, "Identification Code Qualifier", b::Values("24", "46", "FI", "NI", "PI", "XV", "XX")),
57
+ b::Element(e::Required, "Identification Code"),
58
+ b::Element(e::NotUsed, "Entity Relationship Code"),
59
+ b::Element(e::NotUsed, "Entity Identifier Code"),
60
+ b::Element(e::NotUsed, "Name Last or Organization Name")),
61
+ b::Segment(800, s::PER, "Information Source Contact Information",
62
+ r::Situational, d::RepeatCount.bounded(3),
63
+ b::Element(e::Required, "Contact Function Code", b::Values("IC")),
64
+ b::Element(e::Situational, "Information Source Contact Name"),
65
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "FX", "TE", "UR")),
66
+ b::Element(e::Situational, "Communication Number"),
67
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "EX", "FX", "TE", "UR")),
68
+ b::Element(e::Situational, "Communication Number"),
69
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "EX", "FX", "TE", "UR")),
70
+ b::Element(e::Situational, "Communication Number"),
71
+ b::Element(e::NotUsed, "Contact Inquiry Reference")),
72
+ b::Segment(850, s::AAA, "Request Validation",
73
+ r::Situational, d::RepeatCount.bounded(9),
74
+ b::Element(e::Required, "Valid Request Indicator", b::Values("N", "Y")),
75
+ b::Element(e::NotUsed, "Agency Qualifier Code"),
76
+ b::Element(e::Required, "Reject Reason Code", b::Values("04", "41", "42", "79", "80", "T4")),
77
+ b::Element(e::Required, "Follow-up Action Code", b::Values("C", "N", "P", "R", "S", "W", "X", "Y")))))),
78
+
79
+ d::TableDef.detail("Table 2 - Information Receiver Detail",
80
+ d::LoopDef.build("2000B INFORMATION RECEIVER LEVEL",
81
+ d::RepeatCount.bounded(1),
82
+ b::Segment(100, s::HL, "Information Receiver Level",
83
+ r::Situational, d::RepeatCount.bounded(1),
84
+ b::Element(e::Required, "Hierarchical ID Number"),
85
+ b::Element(e::Required, "Hierarchical Parent ID Number"),
86
+ b::Element(e::Required, "Hierarchical Level Code", b::Values("21")),
87
+ b::Element(e::Required, "Hierarchical Child Code", b::Values("0", "1"))),
88
+
89
+ d::LoopDef.build("2100B INFORMATION RECEIVER NAME",
90
+ d::RepeatCount.unbounded,
91
+ b::Segment(300, s::NM1, "Information Receiver Name",
92
+ r::Required, d::RepeatCount.bounded(1),
93
+ b::Element(e::Required, "Entity Identifier Code", b::Values("1P", "2B", "36", "80", "FA", "GP", "P5", "PR")),
94
+ b::Element(e::Required, "Entity Type Qualifier", b::Values("1", "2")),
95
+ b::Element(e::Situational, "Information Receiver Last or Organization Name"),
96
+ b::Element(e::Situational, "Information Receiver First Name"),
97
+ b::Element(e::Situational, "Information Receiver Name Middle"),
98
+ b::Element(e::NotUsed, "Name Prefix"),
99
+ b::Element(e::Situational, "Information Receiver Name Suffix"),
100
+ b::Element(e::Required, "Identification Code Qualifier", b::Values("24", "34", "FI", "PI", "PP", "SV", "XV", "XX")),
101
+ b::Element(e::Required, "Identification Code"),
102
+ b::Element(e::NotUsed, "Entity Relationship Code"),
103
+ b::Element(e::NotUsed, "Entity Identifier Code"),
104
+ b::Element(e::NotUsed, "Name Last or Organization Name")),
105
+ b::Segment(400, s::REF, "Information Receiver Additional Identification",
106
+ r::Situational, d::RepeatCount.bounded(9),
107
+ b::Element(e::Required, "Reference Identification Qualifier", b::Values("0B", "1C", "1D", "1J", "4A", "CT", "EL", "EO", "HPI", "JD", "N5", "N7", "Q4", "SY", "TJ")),
108
+ b::Element(e::Required, "Reference Identification"),
109
+ b::Element(e::Situational, "Information Receiver Addtional Identifier State"),
110
+ b::Element(e::NotUsed, "REFERENCE IDENTIFIER")),
111
+ b::Segment(850, s::AAA, "Information Receiver Request Validation",
112
+ r::Situational, d::RepeatCount.bounded(9),
113
+ b::Element(e::Required, "Valid Request Indicator", b::Values("N", "Y")),
114
+ b::Element(e::NotUsed, "Agency Qualifier Code"),
115
+ b::Element(e::Required, "Reject Reason Code", b::Values("15", "41", "43", "44", "45", "46", "47", "48", "50", "51", "79", "97", "T4")),
116
+ b::Element(e::Required, "Follow-up Action Code", b::Values("C", "N", "R", "S", "W", "X", "Y"))),
117
+ b::Segment(900, s::PRV, "Information Receiver Provider Information",
118
+ r::Situational, d::RepeatCount.bounded(1),
119
+ b::Element(e::Required, "Provider Code", b::Values("AD", "AT", "BI", "CO", "CV", "H", "HH", "LA", "OT", "P1", "P2", "PC", "PE", "R", "RF", "SB", "SK", "SU")),
120
+ b::Element(e::Situational, "Reference Identification Qualifier", b::Values("PXC")),
121
+ b::Element(e::Situational, "Receiver Provider Specialty Code"),
122
+ b::Element(e::NotUsed, "State or Province Code"),
123
+ b::Element(e::NotUsed, "PROVIDER SPECIALTY INFORMATION"),
124
+ b::Element(e::NotUsed, "Provider Organization Code"))))),
125
+
126
+ d::TableDef.detail("Table 2 - Subscriber Detail",
127
+ d::LoopDef.build("2000C SUBSCRIBER LEVEL",
128
+ d::RepeatCount.bounded(1),
129
+ b::Segment(100, s::HL, "Subscriber Level",
130
+ r::Situational, d::RepeatCount.bounded(1),
131
+ b::Element(e::Required, "Hierarchical ID Number"),
132
+ b::Element(e::Required, "Hierarchical Parent ID Number"),
133
+ b::Element(e::Required, "Hierarchical Level Code", b::Values("22")),
134
+ b::Element(e::Required, "Hierarchical Child Code", b::Values("0", "1"))),
135
+ b::Segment(200, s::TRN, "Subscriber Trace Number",
136
+ r::Situational, d::RepeatCount.bounded(3),
137
+ b::Element(e::Required, "Trace Type Code", b::Values("1", "2")),
138
+ b::Element(e::Required, "Trace Number"),
139
+ b::Element(e::Required, "Trace Assigning Entity Identifier"),
140
+ b::Element(e::Situational, "Trace Assigning Entity Additional Identifier")),
141
+
142
+ d::LoopDef.build("2100C SUBSCRIBER NAME",
143
+ d::RepeatCount.bounded(1),
144
+ b::Segment(300, s::NM1, "Subscriber Name",
145
+ r::Required, d::RepeatCount.bounded(1),
146
+ b::Element(e::Required, "Entity Identifier Code", b::Values("IL")),
147
+ b::Element(e::Required, "Entity Type Qualifier", b::Values("1")),
148
+ b::Element(e::Situational, "Subscriber Last Name"),
149
+ b::Element(e::Situational, "Subscriber First Name"),
150
+ b::Element(e::Situational, "Subscriber Middle Name or Initial"),
151
+ b::Element(e::NotUsed, "Name Prefix"),
152
+ b::Element(e::Situational, "Subscriber Name Suffix"),
153
+ b::Element(e::Situational, "Identification Code Qualifier", b::Values("II", "MI")),
154
+ b::Element(e::Situational, "Subscriber Primary Identifier"),
155
+ b::Element(e::NotUsed, "Entity Relationship Code"),
156
+ b::Element(e::NotUsed, "Entity Identifier Code"),
157
+ b::Element(e::NotUsed, "Name Last or Organization Name")),
158
+ b::Segment(400, s::REF, "Subscriber Additional Information",
159
+ r::Situational, d::RepeatCount.bounded(9),
160
+ b::Element(e::Required, "Reference Identification Qualifier", b::Values("18", "1L", "1W", "3H", "49", "6P", "CT", "EA", "EJ", "F6", "GH", "HJ", "IF", "IG", "N6", "NQ", "Q4", "SY", "Y4")),
161
+ b::Element(e::Required, "Subscriber Supplemental Identifier"),
162
+ b::Element(e::Situational, "Plan, Group or Plan Network Name"),
163
+ b::Element(e::NotUsed, "REFERENCE IDENTIFIER")),
164
+ b::Segment(600, s::N3, "Subscriber Address",
165
+ r::Situational, d::RepeatCount.bounded(1),
166
+ b::Element(e::Required, "Subscriber Address Line"),
167
+ b::Element(e::Situational, "Subscriber Address Line")),
168
+ b::Segment(700, s::N4, "Subscriber City, State, ZIP Code",
169
+ r::Situational, d::RepeatCount.bounded(1),
170
+ b::Element(e::Required, "Subscriber City Name"),
171
+ b::Element(e::Situational, "Subscriber State Code"),
172
+ b::Element(e::Situational, "Subscriber Postal Zone or ZIP Code"),
173
+ b::Element(e::Situational, "Subscriber Country Code"),
174
+ b::Element(e::NotUsed, "Location Qualifier"),
175
+ b::Element(e::NotUsed, "Location Identifier"),
176
+ b::Element(e::Situational, "Subscriber Country Subdivision Code")),
177
+ b::Segment(850, s::AAA, "Subscriber Request Validation",
178
+ r::Situational, d::RepeatCount.bounded(9),
179
+ b::Element(e::Required, "Valid Request Indicator", b::Values("N", "Y")),
180
+ b::Element(e::NotUsed, "Agency Qualifier Code"),
181
+ b::Element(e::Required, "Reject Reason Code", b::Values("15", "35", "42", "43", "45", "47", "48", "49", "51", "52", "56", "57", "58", "60", "61", "62", "63", "71", "72", "73", "74", "75", "76", "78")),
182
+ b::Element(e::Required, "Follow-up Action Code", b::Values("C", "N", "R", "S", "W", "X", "Y"))),
183
+ b::Segment(900, s::PRV, "Provider Information",
184
+ r::Situational, d::RepeatCount.bounded(1),
185
+ b::Element(e::Required, "Provider Code", b::Values("AD", "AT", "BI", "CO", "CV", "H", "HH", "LA", "OT", "P1", "P2", "PC", "PE", "R", "RF", "SK", "SU")),
186
+ b::Element(e::Situational, "Reference Identifier", b::Values("PXC")),
187
+ b::Element(e::Situational, "Provider Identifier"),
188
+ b::Element(e::NotUsed, "State or Province Code"),
189
+ b::Element(e::NotUsed, "PROVIDER SPECIALTY INFORMATION"),
190
+ b::Element(e::NotUsed, "Provider Organization Code")),
191
+ b::Segment(1000, s::DMG, "Subscriber Demographic Information",
192
+ r::Situational, d::RepeatCount.bounded(1),
193
+ b::Element(e::Situational, "Date Time Period Format Qualifier"),
194
+ b::Element(e::Situational, "Subscriber Birth Date"),
195
+ b::Element(e::Situational, "Subscriber Gender Code", b::Values("F", "M", "U")),
196
+ b::Element(e::NotUsed, "Marital Status Code"),
197
+ b::Element(e::NotUsed, "COMPOSITE RACE OR ETHNICITY INFORMATION"),
198
+ b::Element(e::NotUsed, "Citizenship Status Code"),
199
+ b::Element(e::NotUsed, "Country Code"),
200
+ b::Element(e::NotUsed, "Basis of Verification Code"),
201
+ b::Element(e::NotUsed, "Quantity"),
202
+ b::Element(e::NotUsed, "Code List Qualifier Code"),
203
+ b::Element(e::NotUsed, "Industry Code")),
204
+ b::Segment(1100, s::INS, "Subscriber Relationship",
205
+ r::Situational, d::RepeatCount.bounded(1),
206
+ b::Element(e::Required, "Insured Indicator", b::Values("Y")),
207
+ b::Element(e::Required, "Individual Relationsihp Code", b::Values("18")),
208
+ b::Element(e::Situational, "Maintenance Type Code", b::Values("001")),
209
+ b::Element(e::Situational, "Maintenance Reason Code", b::Values("25")),
210
+ b::Element(e::NotUsed, "Benefit Status Code"),
211
+ b::Element(e::NotUsed, "MEDICARE STATUS CODE"),
212
+ b::Element(e::NotUsed, "Consolidated Omnibus Budget Reconciliation Act (CORBA) Qualifying"),
213
+ b::Element(e::NotUsed, "Employment Status Code"),
214
+ b::Element(e::NotUsed, "Student Status Code"),
215
+ b::Element(e::NotUsed, "Yes/No Condition or Response"),
216
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
217
+ b::Element(e::NotUsed, "Date Time Period"),
218
+ b::Element(e::NotUsed, "Confidentiality Code"),
219
+ b::Element(e::NotUsed, "City Name"),
220
+ b::Element(e::NotUsed, "State or Province Code"),
221
+ b::Element(e::NotUsed, "Country Code"),
222
+ b::Element(e::Situational, "Birth Sequence Number")),
223
+ b::Segment(1150, s::HI, "Subscriber Health Care Diagnosis Code",
224
+ r::Situational, d::RepeatCount.bounded(1),
225
+ b::Element(e::Required, "HEALTH CARE CODE INFORMATION",
226
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABK", "BK")),
227
+ b::Element(e::Required, "Diagnosis Code"),
228
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
229
+ b::Element(e::NotUsed, "Date Time Period"),
230
+ b::Element(e::NotUsed, "Monetary Amount"),
231
+ b::Element(e::NotUsed, "Quantity"),
232
+ b::Element(e::NotUsed, "Version Identifier"),
233
+ b::Element(e::NotUsed, "Industry Code"),
234
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
235
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
236
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABF", "BF")),
237
+ b::Element(e::Required, "Diagnosis Code"),
238
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
239
+ b::Element(e::NotUsed, "Date Time Period"),
240
+ b::Element(e::NotUsed, "Monetary Amount"),
241
+ b::Element(e::NotUsed, "Quantity"),
242
+ b::Element(e::NotUsed, "Version Identifier"),
243
+ b::Element(e::NotUsed, "Industry Code"),
244
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
245
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
246
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABF", "BF")),
247
+ b::Element(e::Required, "Diagnosis Code"),
248
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
249
+ b::Element(e::NotUsed, "Date Time Period"),
250
+ b::Element(e::NotUsed, "Monetary Amount"),
251
+ b::Element(e::NotUsed, "Quantity"),
252
+ b::Element(e::NotUsed, "Version Identifier"),
253
+ b::Element(e::NotUsed, "Industry Code"),
254
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
255
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
256
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABF", "BF")),
257
+ b::Element(e::Required, "Diagnosis Code"),
258
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
259
+ b::Element(e::NotUsed, "Date Time Period"),
260
+ b::Element(e::NotUsed, "Monetary Amount"),
261
+ b::Element(e::NotUsed, "Quantity"),
262
+ b::Element(e::NotUsed, "Version Identifier"),
263
+ b::Element(e::NotUsed, "Industry Code"),
264
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
265
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
266
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABF", "BF")),
267
+ b::Element(e::Required, "Diagnosis Code"),
268
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
269
+ b::Element(e::NotUsed, "Date Time Period"),
270
+ b::Element(e::NotUsed, "Monetary Amount"),
271
+ b::Element(e::NotUsed, "Quantity"),
272
+ b::Element(e::NotUsed, "Version Identifier"),
273
+ b::Element(e::NotUsed, "Industry Code"),
274
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
275
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
276
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABF", "BF")),
277
+ b::Element(e::Required, "Diagnosis Code"),
278
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
279
+ b::Element(e::NotUsed, "Date Time Period"),
280
+ b::Element(e::NotUsed, "Monetary Amount"),
281
+ b::Element(e::NotUsed, "Quantity"),
282
+ b::Element(e::NotUsed, "Version Identifier"),
283
+ b::Element(e::NotUsed, "Industry Code"),
284
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
285
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
286
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABF", "BF")),
287
+ b::Element(e::Required, "Diagnosis Code"),
288
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
289
+ b::Element(e::NotUsed, "Date Time Period"),
290
+ b::Element(e::NotUsed, "Monetary Amount"),
291
+ b::Element(e::NotUsed, "Quantity"),
292
+ b::Element(e::NotUsed, "Version Identifier"),
293
+ b::Element(e::NotUsed, "Industry Code"),
294
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
295
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
296
+ b::Element(e::Required, "Diagnosis Code Type", b::Values("ABF", "BF")),
297
+ b::Element(e::Required, "Diagnosis Code"),
298
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
299
+ b::Element(e::NotUsed, "Date Time Period"),
300
+ b::Element(e::NotUsed, "Monetary Amount"),
301
+ b::Element(e::NotUsed, "Quantity"),
302
+ b::Element(e::NotUsed, "Version Identifier"),
303
+ b::Element(e::NotUsed, "Industry Code"),
304
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code")),
305
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFORMATION"),
306
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFORMATION"),
307
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFORMATION"),
308
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFORMATION")),
309
+ b::Segment(1200, s::DTP, "Subscriber Date",
310
+ r::Situational, d::RepeatCount.bounded(9),
311
+ b::Element(e::Required, "Date Time Qualifier", b::Values("096", "102", "152", "291", "307", "318", "340", "341", "342", "343", "346", "347", "356", "357", "382", "435", "442", "458", "472", "539", "540", "636", "771")),
312
+ b::Element(e::Required, "Date Time Period Format Qualifier", b::Values("D8", "RD8")),
313
+ b::Element(e::Required, "Date Time Period")),
314
+ b::Segment(1275, s::MPI, "Subscriber Military Personnel Information",
315
+ r::Situational, d::RepeatCount.bounded(9),
316
+ b::Element(e::Required, "Information Status Code", b::Values("A", "C", "L", "O", "P", "S", "T")),
317
+ b::Element(e::Required, "Employment Status Code", b::Values("AE", "AO", "AS", "AT", "AU", "CC", "DD", "HD", "IR", "LX", "PE", "RE", "RM", "RR", "RU")),
318
+ b::Element(e::Required, "Government Service Affiliation Code", b::Values("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "Q", "R", "S", "U", "W")),
319
+ b::Element(e::Situational, "Descrption"),
320
+ b::Element(e::Situational, "Military Service Rank", b::Values("A1", "A2", "A3", "B1", "B2", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "E1", "F1", "F2", "F3", "F4", "G1", "G4", "L1", "L2", "L3", "L4", "L5", "L6", "M1", "M2", "M3", "M4", "M5", "M6", "P1", "P2", "P3", "P4", "P5", "R1", "R2", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "SA", "SB", "SC", "T1", "V1", "W1")),
321
+ b::Element(e::Situational, "Date Time Period Format Qualifier", b::Values("D8", "RD8")),
322
+ b::Element(e::Situational, "Date Time Period")),
323
+
324
+ d::LoopDef.build("2110C SUBSCRIBER ELIGIBILITY OR BENEFIT INFORMATION",
325
+ d::RepeatCount.unbounded,
326
+ b::Segment(1300, s::EB, "Subscriber Eligibility or Benefit Information",
327
+ r::Situational, d::RepeatCount.bounded(1),
328
+ b::Element(e::Required, "Eligibility or Benefit Information", b::Values("1", "2", "3", "4", "5", "6", "7", "8", "A", "B", "C", "CB", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "MC", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y")),
329
+ b::Element(e::Situational, "Benefit Coverage Level Code", b::Values("CHD", "DEP", "ECH", "EMP", "ESP", "FAM", "IND", "SPC", "SPO")),
330
+ b::Element(e::Situational, "Service Type Code", b::Values("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AQ", "AR", "B1", "B2", "B3", "BA", "BB", "BC", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BK", "BL", "BM", "BN", "BP", "BQ", "BR", "BS", "BT", "BU", "BV", "BW", "BX", "BY", "BZ", "C1", "CA", "CB", "CC", "CD", "CE", "CF", "CG", "CH", "CI", "CJ", "CK", "CL", "CM", "CN", "CO", "CP", "CQ", "DG", "DM", "DS", "GF", "GN", "IC", "MH", "NI", "ON", "PT", "PU", "RN", "RT", "TC", "TN", "UC")),
331
+ b::Element(e::Situational, "Insurance Type Code", b::Values("12", "13", "14", "15", "16", "41", "42", "43", "47", "AP", "C1", "CO", "CP", "D", "DB", "EP", "FF", "GP", "HM", "HN", "HS", "IN", "IP", "LC", "LD", "LI", "LT", "MA", "MB", "MC", "MH", "MI", "MP", "OT", "PE", "PL", "PP", "PR", "PS", "QM", "RP", "SP", "TF", "WC", "WU")),
332
+ b::Element(e::Situational, "Plan Coverage Description"),
333
+ b::Element(e::Situational, "Time Period Qualifier", b::Values("6", "7", "13", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36")),
334
+ b::Element(e::Situational, "Monetary Amount"),
335
+ b::Element(e::Situational, "Benefit Percent"),
336
+ b::Element(e::Situational, "Quantity Qualifier", b::Values("8H", "99", "CA", "CE", "D3", "DB", "DY", "HS", "LA", "LE", "M2", "MN", "P6", "QA", "S7", "S8")),
337
+ b::Element(e::Situational, "Benefit Quantity"),
338
+ b::Element(e::Situational, "Authorization or Certification Indicator", b::Values("N", "U", "Y")),
339
+ b::Element(e::Situational, "In Plan Network Indicator", b::Values("N", "U", "W", "Y")),
340
+ b::Element(e::Situational, "COMPOSITE MEDICAL PROCEDURE IDENTIFIER",
341
+ b::Element(e::Required, "Product or Service ID Qualifier", b::Values("AD", "CJ", "HC", "ID", "IV", "N4", "ZZ")),
342
+ b::Element(e::Required, "Procedure Code"),
343
+ b::Element(e::Situational, "Procedure Modifier"),
344
+ b::Element(e::Situational, "Procedure Modifier"),
345
+ b::Element(e::Situational, "Procedure Modifier"),
346
+ b::Element(e::Situational, "Procedure Modifier"),
347
+ b::Element(e::NotUsed, "Description"),
348
+ b::Element(e::Situational, "Product or Service ID")),
349
+ b::Element(e::Situational, "COMPOSITE DIAGNOSIS CODE POINTER",
350
+ b::Element(e::Required, "Diagnosis Code Pointer"),
351
+ b::Element(e::Situational, "Diagnosis Code Pointer"),
352
+ b::Element(e::Situational, "Diagnosis Code Pointer"),
353
+ b::Element(e::Situational, "Diagnosis Code Pointer"))),
354
+ b::Segment(1350, s::HSD, "Health Care Services Delivery",
355
+ r::Situational, d::RepeatCount.bounded(9),
356
+ b::Element(e::Situational, "Quantity Qualifier", b::Values("DY", "FL", "HS", "MN", "VS")),
357
+ b::Element(e::Situational, "Benefit Quantity"),
358
+ b::Element(e::Situational, "Unit or Basis for Measurement Code", b::Values("DA", "MO", "VS", "WK", "YR")),
359
+ b::Element(e::Situational, "Sample Selection Modulus"),
360
+ b::Element(e::Situational, "Time Period Qualifier", b::Values("6", "7", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35")),
361
+ b::Element(e::Situational, "Period Count"),
362
+ b::Element(e::Situational, "Delivery Frequency Code", b::Values("1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "SG", "SL", "SP", "SX", "SY", "SZ", "T", "U", "V", "W", "X", "Y")),
363
+ b::Element(e::Situational, "Delivery Pattern Time Code", b::Values("A", "B", "C", "D", "E", "F", "G", "Y"))),
364
+ b::Segment(1400, s::REF, "Subscriber Additional Identification",
365
+ r::Situational, d::RepeatCount.bounded(9),
366
+ b::Element(e::Required, "Reference Identifier Qualifier", b::Values("18", "1L", "1W", "49", "6P", "9F", "ALS", "CLI", "F6", "FO", "G1", "IG", "M7", "N6", "NQ")),
367
+ b::Element(e::Required, "Subscriber Eligibility or Benefit Identifier"),
368
+ b::Element(e::Situational, "Plan, Group or Plan Network Name"),
369
+ b::Element(e::NotUsed, "REFERENCE IDENTIFIER")),
370
+ b::Segment(1500, s::DTP, "Subscriber Eligibility/Benefit Date",
371
+ r::Situational, d::RepeatCount.bounded(20),
372
+ b::Element(e::Required, "Date Time Qualifier", b::Values("096", "193", "194", "198", "290", "291", "292", "295", "304", "307", "318", "346", "348", "349", "356", "357", "435", "472", "636", "771")),
373
+ b::Element(e::Required, "Date Time Period Qualifier", b::Values("D8", "RD8")),
374
+ b::Element(e::Required, "Eligibility or Benefit Date Time Period")),
375
+ b::Segment(1600, s::AAA, "Subscriber Request Validation",
376
+ r::Situational, d::RepeatCount.bounded(9),
377
+ b::Element(e::Required, "Valid Request Indicator", b::Values("N", "Y")),
378
+ b::Element(e::NotUsed, "Agency Qualifier Code"),
379
+ b::Element(e::Required, "Reject Reason Code", b::Values("15", "33", "52", "53", "54", "55", "56", "57", "60", "61", "62", "63", "69", "70", "98", "AA", "AE", "AF", "AG", "AO", "CI", "E8", "IA", "MA")),
380
+ b::Element(e::Required, "Follow-up Action Code", b::Values("C", "N", "R", "W", "X", "Y"))),
381
+ b::Segment(2500, s::MSG, "Message Text",
382
+ r::Situational, d::RepeatCount.bounded(10),
383
+ b::Element(e::Required, "Free Form Message Text"),
384
+ b::Element(e::NotUsed, "Printer Carriage Control Code"),
385
+ b::Element(e::NotUsed, "Number")),
386
+
387
+ d::LoopDef.build("2115C SUBSCRIBER ELEGIBILITY OR BENEFIT ADDITIONAL INFORMATION",
388
+ d::RepeatCount.bounded(10),
389
+ b::Segment(2600, s::III, "Subscriber Elegibility or Benefit Additional Information",
390
+ r::Situational, d::RepeatCount.bounded(1),
391
+ b::Element(e::Situational, "Code List Qualifier Code", b::Values("GR", "NI", "ZZ")),
392
+ b::Element(e::Situational, "Industry Code"),
393
+ b::Element(e::Situational, "Code Category", b::Values("44")),
394
+ b::Element(e::Situational, "Injured Body Part Name"),
395
+ b::Element(e::NotUsed, "Quantity"),
396
+ b::Element(e::NotUsed, "COMPOSITE UNIT OF MEASURE"),
397
+ b::Element(e::NotUsed, "Surface/Layer/Position Code"),
398
+ b::Element(e::NotUsed, "Surface/Layer/Position Code"),
399
+ b::Element(e::NotUsed, "Surface/Layer/Position Code"))),
400
+
401
+ # The X12 standard and X279 specification place the LS and LE segments
402
+ # at the same depth as 2115C and 2120C loops. This is not supported by
403
+ # stupidedi -- loops must be contain zero or more header segments, followed
404
+ # by zero or more child loops, finally followed by zero or more trailer
405
+ # segments.
406
+ #
407
+ # To work around this issue, we've constructed the "2120C LOOP HEADER"
408
+ # merely to serve as a container for the LS and LE segments.
409
+ #
410
+ d::LoopDef.build("2120C LOOP HEADER",
411
+ d::RepeatCount.bounded(1),
412
+ b::Segment(3300, s::LS, "Loop Header",
413
+ r::Situational, d::RepeatCount.bounded(1),
414
+ b::Element(e::Required, "Loop Identifier Code", b::Values("2120"))),
415
+
416
+ d::LoopDef.build("2120C SUBSCRIBER BENEFIT RELATED ENTITY NAME",
417
+ d::RepeatCount.bounded(23),
418
+ b::Segment(3400, s::NM1, "Subscriber Benefit Related Entity Name",
419
+ r::Situational, d::RepeatCount.bounded(1),
420
+ b::Element(e::Required, "Entity Code Identifier", b::Values("13", "1I", "1P", "2B", "36", "73", "FA", "GP", "GW", "I3", "IL", "LR", "OC", "P3", "P4", "P5", "PR", "PRP", "SEP", "TTP", "VN", "VY", "X3")),
421
+ b::Element(e::Required, "Entity Type Qualifier", b::Values("1", "2")),
422
+ b::Element(e::Situational, "Benefit Related Entity Last or Organization Name"),
423
+ b::Element(e::Situational, "Benefit Related Entity First Name"),
424
+ b::Element(e::Situational, "Benefit Related Entity Middle Name"),
425
+ b::Element(e::NotUsed, "Name Prefix"),
426
+ b::Element(e::Situational, "Benefit Related Entity Name Suffix"),
427
+ b::Element(e::Situational, "Identification Code Qualifier", b::Values("24", "34", "46", "FA", "FI", "II", "MI", "NI", "PI", "PP", "SV", "XV", "XX")),
428
+ b::Element(e::Situational, "Identification Code"),
429
+ b::Element(e::Situational, "Benefit Related Entity Relationsihp Code", b::Values("01", "02", "27", "41", "48", "65", "72")),
430
+ b::Element(e::NotUsed, "Entity Identifier Code"),
431
+ b::Element(e::NotUsed, "Name Last or Organization Name")),
432
+ b::Segment(3600, s::N3, "Subscriber Benefit Related Entity Address",
433
+ r::Situational, d::RepeatCount.bounded(1),
434
+ b::Element(e::Required, "Benefit Related Entity Address Line"),
435
+ b::Element(e::Situational, "Benefit Related Entity Address Line")),
436
+ b::Segment(3700, s::N4, "Subscriber Benefit Related Entity City, State, ZIP Code",
437
+ r::Situational, d::RepeatCount.bounded(1),
438
+ b::Element(e::Required, "Benefit Related Entity City Name"),
439
+ b::Element(e::Situational, "Benefit Related Entity State Code"),
440
+ b::Element(e::Situational, "Benefit Related Entity Postal Zone or ZIP Code"),
441
+ b::Element(e::Situational, "Benefit Related Entity Country Code"),
442
+ b::Element(e::Situational, "Benefit Related Entity Location Qualifier", b::Values("RJ")),
443
+ b::Element(e::Situational, "Benefit Related Entity DOD Health Service Region"),
444
+ b::Element(e::Situational, "Benefit Related Entity Country Subdivision Code")),
445
+ b::Segment(3800, s::PER, "Subscriber Benefit Related Entity Contact Information",
446
+ r::Situational, d::RepeatCount.bounded(3),
447
+ b::Element(e::Required, "Contact Function Code", b::Values("IC")),
448
+ b::Element(e::Situational, "Benefit Related Entity Contact Name"),
449
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "FX", "TE", "UR", "WP")),
450
+ b::Element(e::Situational, "Benefit Related Entity Communication Number"),
451
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "EX", "FX", "TE", "UR", "WP")),
452
+ b::Element(e::Situational, "Communication Number"),
453
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "EX", "FX", "TE", "UR", "WP")),
454
+ b::Element(e::Situational, "Communication Number"),
455
+ b::Element(e::NotUsed, "Contact Inquiry Reference")),
456
+ b::Segment(3900, s::PRV, "Subscriber Benefit Related Provider Information",
457
+ r::Situational, d::RepeatCount.bounded(1),
458
+ b::Element(e::Required, "Provider Code", b::Values("AD", "AT", "BI", "CO", "CV", "H", "HH", "LA", "OT", "P1", "P2", "PC", "PE", "R", "RF", "SB", "SK", "SU")),
459
+ b::Element(e::Situational, "Reference Identification Qualifier", b::Values("PXC")),
460
+ b::Element(e::Situational, "Provider Identifier"),
461
+ b::Element(e::NotUsed, "State or Province Code"),
462
+ b::Element(e::NotUsed, "PROVIDER SPECIALTY INFORMATION"),
463
+ b::Element(e::NotUsed, "Provider Organization Code"))),
464
+
465
+ b::Segment(4000, s::LE, "Loop Trailer",
466
+ r::Situational, d::RepeatCount.bounded(1),
467
+ b::Element(e::Required, "Loop Identifier Code", b::Values("2120")))))))),
468
+
469
+ d::TableDef.detail("Table 2 - Dependent Detail",
470
+ d::LoopDef.build("2000D DEPENDENT DETAIL",
471
+ d::RepeatCount.bounded(1),
472
+ b::Segment(100, s::HL, "Dependent Level",
473
+ r::Required, d::RepeatCount.bounded(1),
474
+ b::Element(e::Required, "Hierarchical ID Number"),
475
+ b::Element(e::Required, "Hierarchical Parent ID Number"),
476
+ b::Element(e::Required, "Hierarchical Level Code", b::Values("23")),
477
+ b::Element(e::Required, "Hierarchical Child Code", b::Values("0"))),
478
+ b::Segment(200, s::TRN, "Dependent Trace Number",
479
+ r::Situational, d::RepeatCount.bounded(3),
480
+ b::Element(e::Required, "Trace Type Code", b::Values("1", "2")),
481
+ b::Element(e::Required, "Trace Number"),
482
+ b::Element(e::Required, "Trace Assigning Entity Identifier"),
483
+ b::Element(e::Situational, "Trace Assigning Entity Additional Identifier")),
484
+ d::LoopDef.build("2100D DEPENDENT NAME",
485
+ d::RepeatCount.unbounded,
486
+ b::Segment(300, s::NM1, "Dependent Name",
487
+ r::Required, d::RepeatCount.bounded(1),
488
+ b::Element(e::Required, "Entity Identifier Code", b::Values("03")),
489
+ b::Element(e::Required, "Entity Type Qualifier", b::Values("1")),
490
+ b::Element(e::Situational, "Dependent Last Name"),
491
+ b::Element(e::Situational, "Dependent First Name"),
492
+ b::Element(e::Situational, "Dependent Middle Name"),
493
+ b::Element(e::NotUsed, "Name Prefix"),
494
+ b::Element(e::Situational, "Dependent Name Suffix"),
495
+ b::Element(e::NotUsed, "Identification Code Qualifier"),
496
+ b::Element(e::NotUsed, "Identification Code"),
497
+ b::Element(e::NotUsed, "Entity Relationship Code"),
498
+ b::Element(e::NotUsed, "Entity Identifier Code"),
499
+ b::Element(e::NotUsed, "Name Last or Organization Name")),
500
+ b::Segment(400, s::REF, "Dependent Additional Identification",
501
+ r::Situational, d::RepeatCount.bounded(9),
502
+ b::Element(e::Required, "Reference Identification Qualifier", b::Values("18", "1L", "49", "6P", "CT", "EA", "EJ", "F6", "GH", "HJ", "IF", "IG", "MRC", "N6", "NQ", "Q4", "SY", "Y4")),
503
+ b::Element(e::Required, "Dependent Supplemental Identfier"),
504
+ b::Element(e::Situational, "Plan, Group or Plan Network Name"),
505
+ b::Element(e::NotUsed, "REFERENCE IDENTIFIER")),
506
+ b::Segment(600, s::N3, "Dependent Address",
507
+ r::Situational, d::RepeatCount.bounded(1),
508
+ b::Element(e::Required, "Dependent Address Line"),
509
+ b::Element(e::Situational, "Dependent Address Line")),
510
+ b::Segment(700, s::N4, "Dependent City, State, ZIP Code",
511
+ r::Situational, d::RepeatCount.bounded(1),
512
+ b::Element(e::Required, "Dependent City Name"),
513
+ b::Element(e::Situational, "Dependent State Code"),
514
+ b::Element(e::Situational, "Dependent Postal Zone or ZIP Code"),
515
+ b::Element(e::Situational, "Dependent Country Code"),
516
+ b::Element(e::NotUsed, "Location Qualifier"),
517
+ b::Element(e::NotUsed, "Location Identifier"),
518
+ b::Element(e::Situational, "Dependent Country Subdivision Code")),
519
+ b::Segment(850, s::AAA, "Dependent Request Validation",
520
+ r::Situational, d::RepeatCount.bounded(9),
521
+ b::Element(e::Required, "Valid Request Indicator", b::Values("Y", "N")),
522
+ b::Element(e::NotUsed, "Agency Qualifier Code"),
523
+ b::Element(e::Required, "Reject Reason Code", b::Values("15", "35", "42", "43", "45", "47", "48", "49", "51", "52", "56", "57", "58", "60", "61", "62", "63", "64", "65", "66", "67", "68", "71", "77")),
524
+ b::Element(e::Required, "Follow-up Action Code", b::Values("C", "N", "R", "S", "W", "X", "Y"))),
525
+ b::Segment(900, s::PRV, "Provider Information",
526
+ r::Situational, d::RepeatCount.bounded(1),
527
+ b::Element(e::Required, "Provider Code", b::Values("AD", "AT", "BI", "CO", "CV", "H", "HH", "LA", "OT", "P1", "P2", "PC", "PE", "R", "SK", "SU")),
528
+ b::Element(e::Situational, "Reference Identification Qualifier", b::Values("PXC")),
529
+ b::Element(e::Situational, "Provider Identifier"),
530
+ b::Element(e::NotUsed, "State or Province Code"),
531
+ b::Element(e::NotUsed, "PROVIDER SPECIALTY INFORMATION"),
532
+ b::Element(e::NotUsed, "Provider Organization Code")),
533
+ b::Segment(1000, s::DMG, "Dependent Demographic Information",
534
+ r::Situational, d::RepeatCount.bounded(1),
535
+ b::Element(e::Situational, "Date Time Period Format Qualifier", b::Values("D8")),
536
+ b::Element(e::Situational, "Dependent Birth Date"),
537
+ b::Element(e::Situational, "Dependent Gender Code", b::Values("F", "M", "U")),
538
+ b::Element(e::NotUsed, "Marital Status Code"),
539
+ b::Element(e::NotUsed, "COMPOSITE RACE OR ETHNICITY INFORMATION"),
540
+ b::Element(e::NotUsed, "Citizenship Status Code"),
541
+ b::Element(e::NotUsed, "Country Code"),
542
+ b::Element(e::NotUsed, "Basis of Verification Code"),
543
+ b::Element(e::NotUsed, "Quantity"),
544
+ b::Element(e::NotUsed, "Code List Qualifier Code"),
545
+ b::Element(e::NotUsed, "Industry Code")),
546
+ b::Segment(1100, s::INS, "Dependent Relationship",
547
+ r::Situational, d::RepeatCount.bounded(1),
548
+ b::Element(e::Required, "Insured Indicator", b::Values("N")),
549
+ b::Element(e::Required, "Individual Relationship Code", b::Values("01", "19", "20", "21", "39", "40", "53", "G8")),
550
+ b::Element(e::Situational, "Maintenance Type Code", b::Values("001")),
551
+ b::Element(e::Situational, "Maintenance Reason Code", b::Values("25")),
552
+ b::Element(e::NotUsed, "Benefit Status Code"),
553
+ b::Element(e::NotUsed, "MEDICARE STATUS CODE"),
554
+ b::Element(e::NotUsed, "Consolidated Omnibus Budget Reconciliation Act (CORBA) Qualifying"),
555
+ b::Element(e::NotUsed, "Employment Status Code"),
556
+ b::Element(e::NotUsed, "Student Status Code"),
557
+ b::Element(e::NotUsed, "Yes/No Condition or Response Code"),
558
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
559
+ b::Element(e::NotUsed, "Date TIme Period"),
560
+ b::Element(e::NotUsed, "Confidentiality Code"),
561
+ b::Element(e::NotUsed, "City Name"),
562
+ b::Element(e::NotUsed, "State or Province Code"),
563
+ b::Element(e::NotUsed, "Country Code"),
564
+ b::Element(e::Situational, "Birth Sequence Number")),
565
+ b::Segment(1150, s::HI, "Dependent Health Care Diagnosis Code",
566
+ r::Situational, d::RepeatCount.bounded(1),
567
+ b::Element(e::Required, "HEALTH CARE CODE INFORMATION",
568
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABK", "BK")),
569
+ b::Element(e::Required, "Diagnosis Code"),
570
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
571
+ b::Element(e::NotUsed, "Date Time Period"),
572
+ b::Element(e::NotUsed, "Monetary Amount"),
573
+ b::Element(e::NotUsed, "Quantity"),
574
+ b::Element(e::NotUsed, "Version Identifier"),
575
+ b::Element(e::NotUsed, "Industry Code"),
576
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
577
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
578
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABF", "BF")),
579
+ b::Element(e::Required, "Diagnosis Code"),
580
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
581
+ b::Element(e::NotUsed, "Date Time Period"),
582
+ b::Element(e::NotUsed, "Monetary Amount"),
583
+ b::Element(e::NotUsed, "Quantity"),
584
+ b::Element(e::NotUsed, "Version Identifier"),
585
+ b::Element(e::NotUsed, "Industry Code"),
586
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
587
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
588
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABF", "BF")),
589
+ b::Element(e::Required, "Diagnosis Code"),
590
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
591
+ b::Element(e::NotUsed, "Date Time Period"),
592
+ b::Element(e::NotUsed, "Monetary Amount"),
593
+ b::Element(e::NotUsed, "Quantity"),
594
+ b::Element(e::NotUsed, "Version Identifier"),
595
+ b::Element(e::NotUsed, "Industry Code"),
596
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
597
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
598
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABF", "BF")),
599
+ b::Element(e::Required, "Diagnosis Code"),
600
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
601
+ b::Element(e::NotUsed, "Date Time Period"),
602
+ b::Element(e::NotUsed, "Monetary Amount"),
603
+ b::Element(e::NotUsed, "Quantity"),
604
+ b::Element(e::NotUsed, "Version Identifier"),
605
+ b::Element(e::NotUsed, "Industry Code"),
606
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
607
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
608
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABF", "BF")),
609
+ b::Element(e::Required, "Diagnosis Code"),
610
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
611
+ b::Element(e::NotUsed, "Date Time Period"),
612
+ b::Element(e::NotUsed, "Monetary Amount"),
613
+ b::Element(e::NotUsed, "Quantity"),
614
+ b::Element(e::NotUsed, "Version Identifier"),
615
+ b::Element(e::NotUsed, "Industry Code"),
616
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
617
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
618
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABF", "BF")),
619
+ b::Element(e::Required, "Diagnosis Code"),
620
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
621
+ b::Element(e::NotUsed, "Date Time Period"),
622
+ b::Element(e::NotUsed, "Monetary Amount"),
623
+ b::Element(e::NotUsed, "Quantity"),
624
+ b::Element(e::NotUsed, "Version Identifier"),
625
+ b::Element(e::NotUsed, "Industry Code"),
626
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
627
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
628
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABF", "BF")),
629
+ b::Element(e::Required, "Diagnosis Code"),
630
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
631
+ b::Element(e::NotUsed, "Date Time Period"),
632
+ b::Element(e::NotUsed, "Monetary Amount"),
633
+ b::Element(e::NotUsed, "Quantity"),
634
+ b::Element(e::NotUsed, "Version Identifier"),
635
+ b::Element(e::NotUsed, "Industry Code"),
636
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
637
+ b::Element(e::Situational, "HEALTH CARE CODE INFORMATION",
638
+ b::Element(e::Required, "Diagnosis Type Code", b::Values("ABF", "BF")),
639
+ b::Element(e::Required, "Diagnosis Code"),
640
+ b::Element(e::NotUsed, "Date Time Period Format Qualifier"),
641
+ b::Element(e::NotUsed, "Date Time Period"),
642
+ b::Element(e::NotUsed, "Monetary Amount"),
643
+ b::Element(e::NotUsed, "Quantity"),
644
+ b::Element(e::NotUsed, "Version Identifier"),
645
+ b::Element(e::NotUsed, "Industry Code"),
646
+ b::Element(e::NotUsed, "Yes/No Condition or Response")),
647
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFROMATION"),
648
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFROMATION"),
649
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFROMATION"),
650
+ b::Element(e::NotUsed, "HEALTH CARE CODE INFROMATION")),
651
+ b::Segment(1200, s::DTP, "Dependent Date",
652
+ r::Situational, d::RepeatCount.bounded(9),
653
+ b::Element(e::Required, "Date Time Qualifier", b::Values("096", "102", "152", "291", "307", "318", "340", "341", "342", "343", "346", "347", "356", "357", "382", "435", "442", "458", "472", "539", "540", "636", "771")),
654
+ b::Element(e::Required, "Date Time Period Format Qualifier", b::Values("D8", "RD8")),
655
+ b::Element(e::Required, "Date Time Period")),
656
+ b::Segment(1275, s::MPI, "Dependent Military Personnel Information",
657
+ r::Situational, d::RepeatCount.bounded(1),
658
+ b::Element(e::Required, "Information Status Code", b::Values("A", "C", "L", "O", "P", "S", "T")),
659
+ b::Element(e::Required, "Employment Status Code", b::Values("AE", "AO", "AS", "AT", "AU", "CC", "DD", "HD", "IR", "LX", "PE", "RE", "RM", "RR", "RU")),
660
+ b::Element(e::Required, "Government Service Affilition Code", b::Values("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "Q", "R", "S", "U", "W")),
661
+ b::Element(e::Situational, "Description"),
662
+ b::Element(e::Situational, "Military Service Rank", b::Values("A1", "A2", "A3", "B1", "B2", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "E1", "F1", "F2", "F3", "F4", "G1", "G4", "L1", "L2", "L3", "L4", "L5", "L6", "M1", "M2", "M3", "M4", "M5", "M6", "P1", "P2", "P3", "P4", "P5", "R1", "R2", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "SA", "SB", "SC", "T1", "V1", "W1")),
663
+ b::Element(e::Situational, "Date Time Period Format Qualifier", b::Values("D8", "RD8")),
664
+ b::Element(e::Situational, "Date Time Period")),
665
+
666
+ d::LoopDef.build("2110D DEPENDENT ELIGIBILITY OR BENEFIT INFORMATION",
667
+ d::RepeatCount.unbounded,
668
+ b::Segment(1300, s::EB, "Dependent Eligibility or Benefit Information",
669
+ r::Situational, d::RepeatCount.bounded(1),
670
+ b::Element(e::Required, "Eligibility or Benefit Information", b::Values("1", "2", "3", "4", "5", "6", "7", "8", "A", "B", "C", "CB", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "MC", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y")),
671
+ b::Element(e::Situational, "Benefit Coverage Level Code", b::Values("CHD", "DEP", "ECH", "ESP", "FAM", "IND", "SPC", "SPO")),
672
+ b::Element(e::Situational, "Service Type Code", b::Values("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "3", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AQ", "AR", "B1", "B2", "B3", "BA", "BB", "BC", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BK", "BL", "BM", "BN", "BQ", "BR", "BS", "BT", "BU", "BV", "BW", "BX", "BY", "BZ", "C1", "CA", "CB", "CC", "CD", "CE", "CF", "CG", "CH", "CI", "CJ", "CK", "CL", "CM", "CN", "CO", "CP", "CQ", "DG", "DM", "DS", "GF", "GN", "IC", "MH", "NI", "ON", "PT", "PU", "RN", "RT", "TN", "UC")),
673
+ b::Element(e::Situational, "Insurance Type Code", b::Values("12", "13", "14", "15", "16", "41", "42", "43", "47", "AP", "C1", "CO", "CP", "D", "DB", "EP", "FF", "GP", "HM", "HN", "HS", "IN", "IP", "LC", "LD", "LI", "LT", "MA", "MB", "MC", "MH", "MI", "MP", "OT", "PE", "PL", "PP", "PR", "PS", "QM", "RP", "SP", "TF", "WC", "WU")),
674
+ b::Element(e::Situational, "Plan Coverage Description"),
675
+ b::Element(e::Situational, "Time Period Qualifier", b::Values("6", "7", "13", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36")),
676
+ b::Element(e::Situational, "Benefit Amount"),
677
+ b::Element(e::Situational, "Benefit Percent"),
678
+ b::Element(e::Situational, "Quantity Qualifier", b::Values("8H", "99", "CA", "CE", "D3", "DB", "DY", "HS", "LA", "LE", "M2", "MN", "P6", "QA", "S7", "S8", "VS", "YY")),
679
+ b::Element(e::Situational, "Benefit Quantity"),
680
+ b::Element(e::Situational, "Authorization or Certification Indicator", b::Values("N", "U", "Y")),
681
+ b::Element(e::Situational, "In Plan Network Indicator", b::Values("N", "U", "W", "Y")),
682
+ b::Element(e::Situational, "COMPOSITE MEDICAL PROCEDURE IDENTIFIER",
683
+ b::Element(e::Required, "Produce or Service ID Qualifier", b::Values("AD", "CJ", "HC", "ID", "IV", "N4", "ZZ")),
684
+ b::Element(e::Required, "Procedure Code"),
685
+ b::Element(e::Situational, "Procedure Modifier"),
686
+ b::Element(e::Situational, "Procedure Modifier"),
687
+ b::Element(e::Situational, "Procedure Modifier"),
688
+ b::Element(e::Situational, "Procedure Modifier"),
689
+ b::Element(e::NotUsed, "Description"),
690
+ b::Element(e::Situational, "Product or Service ID")),
691
+ b::Element(e::Situational, "COMPOSITE DIAGNOSIS CODE POINTER",
692
+ b::Element(e::Required, "Diagnosis Code Pointer"),
693
+ b::Element(e::Situational, "Diagnosis Code Pointer"),
694
+ b::Element(e::Situational, "Diagnosis Code Pointer"),
695
+ b::Element(e::Situational, "Diagnosis Code Pointer"))),
696
+ b::Segment(1350, s::HSD, "Health Care Services Delivery",
697
+ r::Situational, d::RepeatCount.bounded(9),
698
+ b::Element(e::Situational, "Quantity Qualifier", b::Values("DY", "FL", "HS", "MN", "VS")),
699
+ b::Element(e::Situational, "Benefit Quantity"),
700
+ b::Element(e::Situational, "Unit or Basis for Measurement Code", b::Values("DA", "MO", "VS", "WK", "YR")),
701
+ b::Element(e::Situational, "Sample Selection Modulus"),
702
+ b::Element(e::Situational, "Time Period Qualifier", b::Values("6", "7", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35")),
703
+ b::Element(e::Situational, "Period Count"),
704
+ b::Element(e::Situational, "Delivery Frequency Code", b::Values("1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "SG", "SL", "SP", "SX", "SY", "SZ", "T", "U", "V", "W", "X", "Y")),
705
+ b::Element(e::Situational, "Delivery Pattern Time Code", b::Values("A", "B", "C", "D", "E", "F", "G", "Y"))),
706
+ b::Segment(1400, s::REF, "Dependent Additional Identification",
707
+ r::Situational, d::RepeatCount.bounded(9),
708
+ b::Element(e::Required, "Reference Identification Qualifier", b::Values("18", "1L", "1W", "49", "6P", "9F", "ALS", "CLI", "F6", "FO", "G1", "IG", "N6", "NQ")),
709
+ b::Element(e::Required, "Dependent Eligibility or Benefit Identifier"),
710
+ b::Element(e::Situational, "Plan, Group or Plan Network Name"),
711
+ b::Element(e::NotUsed, "REFERENCE IDENTIFIER")),
712
+ b::Segment(1500, s::DTP, "Dependent Eligibility/Benefit Date",
713
+ r::Situational, d::RepeatCount.bounded(20),
714
+ b::Element(e::Required, "Date Time Qualifier", b::Values("096", "193", "194", "198", "290", "291", "292", "295", "304", "307", "318", "346", "348", "349", "356", "357", "435", "472", "636", "771")),
715
+ b::Element(e::Required, "Date Time Period Format Qualifier", b::Values("D8", "RD8")),
716
+ b::Element(e::Required, "Eligibility or Benefit Date Time Period")),
717
+ b::Segment(1600, s::AAA, "Dependent Request Validation",
718
+ r::Situational, d::RepeatCount.bounded(9),
719
+ b::Element(e::Required, "Valid Request Indicator", b::Values("N", "Y")),
720
+ b::Element(e::NotUsed, "Agency Qualifier Code"),
721
+ b::Element(e::Required, "Reject Reason Code", b::Values("15", "33", "52", "53", "54", "55", "56", "57", "60", "61", "62", "63", "69", "70", "98", "AA", "AE", "AF", "AG", "AO", "CI", "E8", "IA", "MA")),
722
+ b::Element(e::Required, "Follow-up Action Code", b::Values("C", "N", "R", "W", "X", "Y"))),
723
+ b::Segment(2500, s::MSG, "Message Text",
724
+ r::Situational, d::RepeatCount.bounded(10),
725
+ b::Element(e::Required, "Free Form Message Text"),
726
+ b::Element(e::NotUsed, "Printer Carriage Control Code"),
727
+ b::Element(e::NotUsed, "Number")),
728
+
729
+ d::LoopDef.build("2115D DEPENDENT ELIGIBILITY OR BENEFIT ADDITIONAL INFORMATION",
730
+ d::RepeatCount.unbounded,
731
+ b::Segment(2600, s::III, "Dependent Eligibility or Benefit Additional Information",
732
+ r::Situational, d::RepeatCount.bounded(1),
733
+ b::Element(e::Situational, "Code List Qualifier", b::Values("GR", "NI", "ZZ")),
734
+ b::Element(e::Situational, "Industry Code"),
735
+ b::Element(e::Situational, "Code Category", b::Values("44")),
736
+ b::Element(e::Situational, "Injured Body Part Name"),
737
+ b::Element(e::NotUsed, "Quantity"),
738
+ b::Element(e::NotUsed, "COMPOSITE UNIT OF MEASURE"),
739
+ b::Element(e::NotUsed, "Surface/Layer/Position Code"),
740
+ b::Element(e::NotUsed, "Surface/Layer/Position Code"),
741
+ b::Element(e::NotUsed, "Surface/Layer/Position Code"))),
742
+
743
+ # The X12 standard and X279 specification place the LS and LE segments
744
+ # at the same depth as 2115D and 2120D loops. This is not supported by
745
+ # stupidedi -- loops must be contain zero or more header segments, followed
746
+ # by zero or more child loops, finally followed by zero or more trailer
747
+ # segments.
748
+ #
749
+ # To work around this issue, we've constructed the "2120D LOOP HEADER"
750
+ # merely to serve as a container for the LS and LE segments.
751
+ #
752
+ d::LoopDef.build("2120D LOOP HEADER",
753
+ d::RepeatCount.bounded(1),
754
+ b::Segment(3300, s::LS, "Loop Header",
755
+ r::Situational, d::RepeatCount.bounded(1),
756
+ b::Element(e::Required, "Loop Identifier Code", b::Values("2120"))),
757
+
758
+ d::LoopDef.build("2120D DEPENDENT BENEFIT RELATED ENTITY NAME",
759
+ d::RepeatCount.unbounded,
760
+ b::Segment(3400, s::NM1, "Dependent Benefit Related Entity Name",
761
+ r::Situational, d::RepeatCount.bounded(1),
762
+ b::Element(e::Required, "Entity Identifier Code", b::Values("13", "1I", "1P", "2B", "36", "73", "FA", "GP", "GW", "I3", "IL", "LR", "OC", "P3", "P4", "P5", "PR", "PRP", "SEP", "TTP", "VN", "VY", "X3")),
763
+ b::Element(e::Required, "Entity Type Qualifier", b::Values("1", "2")),
764
+ b::Element(e::Situational, "Benefit Related Entity Last or Organization Name"),
765
+ b::Element(e::Situational, "Benefit Related Entity First Name"),
766
+ b::Element(e::Situational, "Benefit Related Entity Middle Name"),
767
+ b::Element(e::Situational, "Benefit Related Entity Name Suffix"),
768
+ b::Element(e::NotUsed, "Name Prefix"),
769
+ b::Element(e::Situational, "Identification Code Qualifier", b::Values("24", "34", "46", "FA", "FI", "II", "MI", "NI", "PI", "PP", "SV", "XV", "XX")),
770
+ b::Element(e::Situational, "Benefit Related Entity Identifier"),
771
+ b::Element(e::Situational, "Benefit Related Entity Relationship Code", b::Values("01", "02", "27", "41", "48", "65", "72")),
772
+ b::Element(e::NotUsed, "Entity Identifier Code"),
773
+ b::Element(e::NotUsed, "Name Last or Organization Name")),
774
+ b::Segment(3600, s::N3, "Dependent Benefit Related Entity Address",
775
+ r::Situational, d::RepeatCount.bounded(1),
776
+ b::Element(e::Required, "Benefit Related Entity Address Line"),
777
+ b::Element(e::Situational, "Benefit Related Entity Address Line")),
778
+ b::Segment(3700, s::N4, "Dependent Benefit Related Entity City, State, ZIP Code",
779
+ r::Situational, d::RepeatCount.bounded(1),
780
+ b::Element(e::Required, "Benefit Related Entity City Name"),
781
+ b::Element(e::Situational, "Benefit Related Entity State Code"),
782
+ b::Element(e::Situational, "Benefit Related Entity Postal Zone or ZIP Code"),
783
+ b::Element(e::Situational, "Benefit Related Entity Country Code"),
784
+ b::Element(e::Situational, "Benefit Related Entity Location Qualifier", b::Values("RJ")),
785
+ b::Element(e::Situational, "Benefit Related Entity DOD Health Service Region"),
786
+ b::Element(e::Situational, "Benefit Related Entity Country Subdivision Code")),
787
+ b::Segment(3800, s::PER, "Dependent Benefit Related Entity Contact Information",
788
+ r::Situational, d::RepeatCount.bounded(3),
789
+ b::Element(e::Required, "Contact Function Code", b::Values("IC")),
790
+ b::Element(e::Situational, "Benefit Related Entity Contact Name"),
791
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "FX", "TE", "UR", "WP")),
792
+ b::Element(e::Situational, "Benefit Related Entity Communication Number"),
793
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "EX", "FX", "TE", "UR", "WP")),
794
+ b::Element(e::Situational, "Benefit Related Entity Communication Number"),
795
+ b::Element(e::Situational, "Communication Number Qualifier", b::Values("ED", "EM", "EX", "FX", "TE", "UR", "WP")),
796
+ b::Element(e::Situational, "Benefit Related Entity Communication Number"),
797
+ b::Element(e::NotUsed, "Contact Inquiry Reference")),
798
+ b::Segment(3900, s::PRV, "Dependent Benefit Related Provider Information",
799
+ r::Situational, d::RepeatCount.bounded(1),
800
+ b::Element(e::Required, "Provider Code", b::Values("AD", "AT", "BI", "CO", "CV", "H", "HH", "LA", "OT", "P1", "P2", "PC", "PE", "R", "RF", "SB", "SK", "SU")),
801
+ b::Element(e::Situational, "Reference Identification Qualifier", b::Values("PXC")),
802
+ b::Element(e::Situational, "Provider Identifier"),
803
+ b::Element(e::NotUsed, "State or Province Code"),
804
+ b::Element(e::NotUsed, "PROVIDER SPECIALTY INFORMATION"),
805
+ b::Element(e::NotUsed, "Provider Organization Code"))),
806
+
807
+ b::Segment(4000, s::LE, "Loop Trailer",
808
+ r::Situational, d::RepeatCount.bounded(1),
809
+ b::Element(e::Required, "Loop Identifier Code", b::Values("2120")))))))),
810
+
811
+ # The X12 standard and X222 specification place the SE segment at what
812
+ # appears to be the end of Table 2 - Patient Detail. This doesn't make
813
+ # sense because Table 2 - Patient Detail doesn't occur if the patient
814
+ # is the subscriber.
815
+ #
816
+ # If we placed it in both Table 2 - Subscriber Detail and Table 2 -
817
+ # Patient Detail, it would incorrectly allow the segment to occur in
818
+ # each table.
819
+ #
820
+ # This structure doesn't match the specification, but it does ensure
821
+ # that the first occurrence of SE terminates the transaction set.
822
+ d::TableDef.summary("Table 3 - Summary",
823
+ b::Segment(4100, s::SE, "Transaction Set Trailer",
824
+ r::Required, d::RepeatCount.bounded(1),
825
+ b::Element(e::Required, "Transaction Segment Count"),
826
+ b::Element(e::Required, "Transaction Set Control Number")
827
+ )))
828
+
829
+ end
830
+ end
831
+ end
832
+ end