stupidedi 1.2.12 → 1.2.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -4
  3. data/bin/edi-pp +1 -1
  4. data/doc/Generating.md +1 -1
  5. data/lib/ruby/to_d.rb +23 -20
  6. data/lib/stupidedi/config.rb +4 -0
  7. data/lib/stupidedi/guides/005010.rb +11 -3
  8. data/lib/stupidedi/guides/005010/X220-BE834.rb +709 -0
  9. data/lib/stupidedi/guides/005010/X220A1-BE834.rb +709 -0
  10. data/lib/stupidedi/guides/005010/X223-HC837I.rb +2582 -0
  11. data/lib/stupidedi/schema/table_def.rb +2 -2
  12. data/lib/stupidedi/version.rb +1 -1
  13. data/lib/stupidedi/versions/functional_groups/005010/element_defs.rb +471 -14
  14. data/lib/stupidedi/versions/functional_groups/005010/segment_defs.rb +41 -2
  15. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/ACT.rb +33 -0
  16. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/BGN.rb +31 -0
  17. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/COB.rb +24 -0
  18. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/DSB.rb +30 -0
  19. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/EC.rb +26 -0
  20. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/HD.rb +31 -0
  21. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/HLH.rb +27 -0
  22. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/ICM.rb +26 -0
  23. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/IDC.rb +24 -0
  24. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/INS.rb +39 -0
  25. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/LE.rb +20 -0
  26. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/LS.rb +20 -0
  27. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/LUI.rb +28 -0
  28. data/lib/stupidedi/versions/functional_groups/005010/segment_defs/PLA.rb +25 -0
  29. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs.rb +3 -3
  30. data/lib/stupidedi/versions/functional_groups/005010/transaction_set_defs/BE834.rb +163 -0
  31. data/lib/stupidedi/zipper/abstract_cursor.rb +2 -2
  32. data/spec/examples/ruby/symbol.example +22 -18
  33. data/spec/spec_helper.rb +1 -0
  34. metadata +25 -7
@@ -126,10 +126,10 @@ module Stupidedi
126
126
  end
127
127
 
128
128
  # @return [TableDef]
129
- def detail(id, *children)
129
+ def detail(id, *children, repeatable: true)
130
130
  header, children = children.split_when{|x| x.is_a?(LoopDef) }
131
131
  loop_defs, trailer = children.split_when{|x| x.is_a?(SegmentUse) }
132
- new(id, 2, true, header, loop_defs, trailer, nil)
132
+ new(id, 2, repeatable, header, loop_defs, trailer, nil)
133
133
  end
134
134
 
135
135
  # @return [TableDef]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stupidedi
4
- VERSION = "1.2.12"
4
+ VERSION = "1.2.14"
5
5
  end
@@ -18,15 +18,18 @@ module Stupidedi
18
18
 
19
19
  E28 = t::Nn.new(:E28 , "Group Control Number" , 1, 9, 0)
20
20
  E61 = t::AN.new(:E61 , "Free-form Information" , 1, 30)
21
+ E65 = t:: R.new(:E65 , "Height" , 1, 8)
21
22
  E66 = t::ID.new(:E66 , "Identification Code Qualifier" , 1, 2,
22
23
  s::CodeList.build(
23
24
  "1" => s::CodeList.external("16"),
24
25
  "9" => s::CodeList.external("16"),
25
26
  "21" => s::CodeList.external("121"),
27
+ "24" => "Employer’s Identification Number",
26
28
  "34" => "Social Security Number",
27
29
  "38" => s::CodeList.external("5"),
28
30
  "46" => "Electronic Transmitter Identification Number (ETIN)",
29
31
  "51" => s::CodeList.external("51"),
32
+ "94" => "Code assigned by the organization that is the ultimate destination of the transaction set",
30
33
  "AC" => "Attachment Control Number",
31
34
  "AD" => "Blue Cross Blue Shield Associtation Plan Code",
32
35
  "BD" => "Blue Cross Provider Number",
@@ -47,9 +50,11 @@ module Stupidedi
47
50
  "PP" => "Pharmacy Processor Number",
48
51
  "SJ" => s::CodeList.external("22"),
49
52
  "SL" => "State License Number",
53
+ "SV" => "Service Provider Number",
50
54
  "UP" => "Unique Physician Identification Number (UPIN)",
51
55
  "XV" => s::CodeList.external("540"),
52
- "XX" => s::CodeList.external("537")))
56
+ "XX" => s::CodeList.external("537"),
57
+ "ZZ" => "Mutually Defined"))
53
58
 
54
59
  E67 = t::AN.new(:E67 , "Identification Code" , 2, 80)
55
60
  E81 = t:: R.new(:E81 , "Weight" , 1, 10)
@@ -60,47 +65,77 @@ module Stupidedi
60
65
  s::CodeList.build(
61
66
  "03" => "Dependent",
62
67
  "1P" => "Provider",
68
+ "1X" => "Laboratory",
63
69
  "1Z" => "Home Health Care",
70
+ "31" => "Postal Mailing Address",
64
71
  "36" => "Employer",
72
+ "3D" => "Obstetrics and Gynecology Facility",
65
73
  "40" => "Receiver",
66
74
  "41" => "Submitter",
67
75
  "45" => "Drop-off Location",
76
+ "6Y" => "Case Manager",
77
+ "70" => "Prior Incorrect Insured",
68
78
  "71" => "Attending Physician",
69
79
  "72" => "Operating Physician",
70
80
  "73" => "Other Physician",
71
81
  "74" => "Corrected Insured",
82
+ "75" => "Participant",
72
83
  "77" => "Service Location",
84
+ "80" => "Hospital",
73
85
  "82" => "Rendering Provider",
74
86
  "85" => "Billing Provider",
75
87
  "87" => "Pay-to Provider",
76
88
  "98" => "Receiver",
89
+ "9K" => "Key Person",
77
90
  "AY" => "Clearinghouse",
91
+ "BO" => "Broker or Sales Office",
78
92
  "DK" => "Ordering Physician",
79
93
  "DN" => "Referring Provider",
80
94
  "DQ" => "Supervising Physician",
95
+ "E1" => "Person or Other Entity Legally Responsible for a Child",
96
+ "EI" => "Executor of Estate",
97
+ "EXS" => "Ex-spouse",
81
98
  "FA" => "Facility",
82
99
  "GB" => "Other Insured",
100
+ "GD" => "Guardian",
101
+ "GW" => "Group",
83
102
  "HK" => "Subscriber",
84
103
  "IL" => "Insured or Subscriber",
104
+ "IN" => "Insurer",
105
+ "J6" => "Power of Attorney",
85
106
  "LI" => "Independent Lab",
107
+ "LR" => "Legal Representative",
108
+ "M8" => "Educational Institution",
86
109
  "MSC" => "Mammography Screening Center",
110
+ "OD" => "Doctor of Optometry",
87
111
  "P3" => "Primary Care Provider",
112
+ "P5" => "Plan Sponsor",
88
113
  "PE" => "Payee",
89
114
  "PR" => "Payer",
90
115
  "PRP" => "Primary Payer",
91
116
  "PW" => "Pickup Address",
117
+ "QA" => "Pharmacy",
118
+ "QN" => "Dentist",
92
119
  "TT" => "Transfer To",
93
120
  "QB" => "Purchase Service Provider",
94
121
  "QC" => "Patient",
95
122
  "QD" => "Responsible Party",
123
+ "S1" => "Parent",
124
+ "S3" => "Custodial Parent",
96
125
  "SEP" => "Secondary Payer",
97
126
  "TL" => "Testing Laboratory",
127
+ "TZ" => "Significant Other",
98
128
  "TTP" => "Tertiary Payer",
99
- "TU" => "Third Party Repricing Organization (TPO)"))
129
+ "TU" => "Third Party Repricing Organization (TPO)",
130
+ "TV" => "Third Party Administrator (TPA)",
131
+ "Y2" => "Managed Care Organization",
132
+ "X4" => "Spouse",
133
+ "ZZ" => "Mutually Defined"))
100
134
 
101
135
  E100 = t::ID.new(:E100 , "Currency Code" , 3, 3,
102
136
  s::CodeList.external("5"))
103
137
 
138
+ E107 = t::ID.new(:E107 , "Payment Method Type Code" , 1, 2)
104
139
  E116 = t::ID.new(:E116 , "Postal Code" , 3, 15,
105
140
  s::CodeList.external("51"))
106
141
 
@@ -110,9 +145,14 @@ module Stupidedi
110
145
  E127 = t::AN.new(:E127 , "Reference Identification" , 1, 50)
111
146
  E128 = t::ID.new(:E128 , "Reference Identification Qualifier" , 2, 3,
112
147
  s::CodeList.build(
148
+ "00" => "Contracting District Number",
113
149
  "04" => s::CodeList.external("91"),
114
150
  "0B" => "State License Number",
151
+ "0F" => "Subscriber Number",
115
152
  "0K" => "Policy Form Identifying Number",
153
+ "17" => "Client Reporting Category",
154
+ "18" => "Plan Number",
155
+ "19" => "Division Identifier",
116
156
  "1A" => "Blue Cross Provider Number",
117
157
  "1B" => "Blue Shield Provider Number",
118
158
  "1C" => "Medicare Provider Number",
@@ -124,9 +164,18 @@ module Stupidedi
124
164
  "1L" => "Group or Policy Number",
125
165
  "1S" => "Ambulatory Patient Group (APG) Number",
126
166
  "1W" => "Member Identification Number",
167
+ "23" => "Client Number",
168
+ "26" => "Union Number",
127
169
  "28" => "Employee Identification Number",
128
170
  "2U" => "Payer Identification Number",
171
+ "38" => "Master Policy Number",
172
+ "3H" => "Case Number",
173
+ "3L" => "Branch Identifier",
174
+ "4A" => "Personal Identification Number (PIN)",
129
175
  "4N" => "Special Payment Reference Number",
176
+ "60" => "Account Suffix Code",
177
+ "6M" => "Application Number",
178
+ "6O" => "Cross Reference Number",
130
179
  "6P" => "Group Number",
131
180
  "6R" => "Provider Control Number",
132
181
  "9A" => "Repriced Claim Reference Number",
@@ -134,6 +183,9 @@ module Stupidedi
134
183
  "9C" => "Adjusted Repriced Claim Reference Number",
135
184
  "9D" => "Adjusted Repriced Line Item Reference Number",
136
185
  "9F" => "Referral Number",
186
+ "9V" => "Payment Category",
187
+ "9X" => "Account Category",
188
+ "ABB" => "Personal ID Number",
137
189
  "ABY" => s::CodeList.external("540"),
138
190
  "AP" => "Ambulatory Payment Classification",
139
191
  "APC" => s::CodeList.external("468"),
@@ -146,6 +198,8 @@ module Stupidedi
146
198
  "D9" => "Claim Number",
147
199
  "DNS" => s::CodeList.external("16"),
148
200
  "DUN" => s::CodeList.external("16"),
201
+ "DX" => "Department/Agency Number",
202
+ "E8" => "Service Contract (Coverage) Number",
149
203
  "E9" => "Attachment Code",
150
204
  "EA" => "Medical Record Identification Number",
151
205
  "EI" => "Employer's Identification Number",
@@ -155,12 +209,15 @@ module Stupidedi
155
209
  "F2" => "Version Code - Local",
156
210
  "F4" => "Facility Certification Number",
157
211
  "F5" => "Medicare Version Code",
212
+ "F6" => "Health Insurance Claim (HIC) Number",
158
213
  "F8" => "Original Reference Number",
159
214
  "FJ" => "Line Item Control Number",
160
215
  "FY" => "Claim Office Number",
161
216
  "G1" => "Prior Authorization Number",
162
217
  "G2" => "Provider Commercial Number",
163
218
  "G3" => "Predetermination of Benefits Identification Number",
219
+ "G4" => "Peer Review Organization (PRO) Approval Number",
220
+ "GE" => "Geographic Number",
164
221
  "HI" => s::CodeList.external("121"),
165
222
  "HPI" => s::CodeList.external("537"),
166
223
  "ICD" => s::CodeList.external("131"),
@@ -168,11 +225,16 @@ module Stupidedi
168
225
  "LOI" => s::CodeList.external("663"),
169
226
  "LU" => "Location Number",
170
227
  "LX" => "Qualified Products List",
228
+ "M7" => "Medical Assistance Category",
171
229
  "MRC" => s::CodeList.external("844"),
172
230
  "NF" => s::CodeList.external("245"),
173
231
  "P4" => "Project Code",
232
+ "P5" => "Position Code",
233
+ "PID" => "Program Identification Number",
174
234
  "PQ" => "Payee Indentification",
175
235
  "PXC" => s::CodeList.external("682"),
236
+ "Q4" => "Prior Identifier Number",
237
+ "QQ" => "Unit Number",
176
238
  "RB" => "Rate code number",
177
239
  "SY" => "Social Security Number",
178
240
  "T4" => "Signal Code",
@@ -180,12 +242,20 @@ module Stupidedi
180
242
  "VY" => "Link Sequence Number",
181
243
  "Y4" => "Agency Claim Number",
182
244
  "X4" => "Clinical Laboratory Improvement Amendment Number",
183
- "XZ" => "Pharmacy Prescription Number"))
245
+ "X9" => "Internal Control Number",
246
+ "XM" => "Issuer Number",
247
+ "XX1" => "Special Program Code",
248
+ "XX2" => "Service Area Code",
249
+ "XZ" => "Pharmacy Prescription Number",
250
+ "YY" => "Geographic Key",
251
+ "ZX" => "County Code",
252
+ "ZZ" => "Mutually Defined"))
184
253
 
185
254
  E142 = t::AN.new(:E142 , "Application's Sender Code" , 2, 15)
186
255
  E143 = t::ID.new(:E143 , "Transaction Set Identifier Number" , 3, 3,
187
256
  s::CodeList.build(
188
257
  "277" => "Health Care Information Status Notification",
258
+ "834" => "Benefit Enrollment and Maintenance",
189
259
  "835" => "Health Care Claim Payment/Advice",
190
260
  "837" => "Health Care Claim",
191
261
  "999" => "Implementation Acknowledgement"))
@@ -227,7 +297,8 @@ module Stupidedi
227
297
  "UK" => "GTIN 14-digit Data Structure",
228
298
  "UP" => "UCC - 12",
229
299
  "RB" => s::CodeList.external("132"),
230
- "WK" => s::CodeList.external("843")))
300
+ "WK" => s::CodeList.external("843"),
301
+ "ZZ" => "Mutually Defined"))
231
302
 
232
303
  E236 = t::ID.new(:E236 , "Price Identifier Code" , 3, 3)
233
304
  E280 = t:: R.new(:E280 , "Exchange Rate" , 4, 10)
@@ -244,11 +315,17 @@ module Stupidedi
244
315
 
245
316
  E306 = t::ID.new(:E306 , "Action Code" , 1, 2,
246
317
  s::CodeList.build(
318
+ "1" => "Add",
319
+ "2" => "Change (Update)",
320
+ "4" => "Verify",
321
+ "RX" => "Replace",
247
322
  "U" => "Reject",
248
323
  "WQ" => "Accept"))
249
324
 
250
325
  E309 = t::ID.new(:E309 , "Location Qualifier" , 1, 2,
251
326
  s::CodeList.build(
327
+ "60" => "Area",
328
+ "CY" => "County/Parish",
252
329
  "PQ" => s::CodeList.external("51"),
253
330
  "PR" => s::CodeList.external("51"),
254
331
  "PS" => s::CodeList.external("51"),
@@ -265,7 +342,9 @@ module Stupidedi
265
342
  s::CodeList.build(
266
343
  "00" => "Original",
267
344
  "08" => "Status",
268
- "18" => "Reissue"))
345
+ "15" => "Re-Submission",
346
+ "18" => "Reissue",
347
+ "22" => "Information Copy"))
269
348
 
270
349
  E355 = t::ID.new(:E355 , "Unit or Basis for Measurement Code" , 2, 2,
271
350
  s::CodeList.build(
@@ -284,29 +363,53 @@ module Stupidedi
284
363
  E363 = t::ID.new(:E363 , "Note Reference Code" , 3, 3,
285
364
  s::CodeList.build(
286
365
  "ADD" => "Additional Information",
366
+ "ALG" => "Allergies",
287
367
  "CER" => "Certification Narrative",
288
368
  "DCP" => "Goals, Rehabilitation Potential, or Discharge Plans",
289
369
  "DGN" => "Diagnosis Description",
290
- "TPO" => "Third Party Organization Notes"))
370
+ "DME" => "Durable Medical Equipment (DME) and Supplies",
371
+ "MED" => "Medications",
372
+ "NTR" => "Nutritional Requirements",
373
+ "ODT" => "Orders for Disciplines and Treatments",
374
+ "RHB" => "Functional Limitations, Reason Homebound, or Both",
375
+ "RLH" => "Reasons Patient Leaves Home",
376
+ "RNH" => "Times and Reasons Patient Not at Home",
377
+ "SET" => "Unusual Home, Social Environment, or Both",
378
+ "SFM" => "Safety Measures",
379
+ "SPT" => "Supplementary Plan of Treatment",
380
+ "TPO" => "Third Party Organization Notes",
381
+ "UPI" => "Updated Information"))
291
382
 
292
383
  E364 = t::AN.new(:E364 , "Communication Number" , 1, 256)
293
384
  E365 = t::ID.new(:E365 , "Communication Number Qualifier" , 2, 2,
294
385
  s::CodeList.build(
386
+ "AP" => "Alternate Telephone",
387
+ "BN" => "Beeper Number",
388
+ "CP" => "Cellular Phone",
295
389
  "EM" => "Electronic Mail",
296
390
  "EX" => "Telephone Extension",
297
391
  "FX" => "Facsimile",
392
+ "HP" => "Home Phone Number",
298
393
  "TE" => "Telephone",
299
- "UR" => "Uniform Resource Locator (URL)"))
394
+ "UR" => "Uniform Resource Locator (URL)",
395
+ "WP" => "Work Phone Number"))
300
396
 
301
397
  E366 = t::ID.new(:E366 , "Contract Function Code" , 2, 2,
302
398
  s::CodeList.build(
303
399
  "BL" => "Technical Department",
400
+ "CN" => "General Contact",
304
401
  "CX" => "Payers Claim Office",
305
- "IC" => "Information Contact"))
402
+ "EP" => "Employer Contact",
403
+ "IC" => "Information Contact",
404
+ "IP" => "Insured Party",
405
+ "RP" => "Responsible Person",
406
+ "PQ" => "Parent or Guardian",
407
+ "SK" => "School Clerk"))
306
408
 
307
409
  E373 = t::DT.new(:E373 , "Date" , 8, 8)
308
410
  E374 = t::ID.new(:E374 , "Date/Time Qualifier" , 3, 3,
309
411
  s::CodeList.build(
412
+ "007" => "Effective",
310
413
  "009" => "Process",
311
414
  "011" => "Shipped",
312
415
  "036" => "Expiration",
@@ -318,14 +421,41 @@ module Stupidedi
318
421
  "151" => "Service Period End",
319
422
  "232" => "Claim Statement Period Start",
320
423
  "233" => "Claim Statement Period End",
424
+ "286" => "Retirement",
321
425
  "296" => "Initial Disability Period Return To Work",
322
426
  "297" => "Initial Disability Period Last Day Worked",
427
+ "300" => "Enrollment Signature Date",
428
+ "301" => "Consolidated Omnibus Budget Reconciliation Act (COBRA) Qualifying Event",
429
+ "303" => "Maintenance Effective",
323
430
  "304" => "Latest Visit or Consultation",
324
431
  "314" => "Disability",
432
+ "336" => "Employment Begin",
433
+ "337" => "Employment End",
434
+ "338" => "Medicare Begin",
435
+ "339" => "Medicare End",
436
+ "340" => "Consolidated Omnibus Budget Reconciliation Act (COBRA) Begin",
437
+ "341" => "Consolidated Omnibus Budget Reconciliation Act (COBRA) End",
438
+ "343" => "Premium Paid to Date End",
439
+ "344" => "Coordination of Benefits Begin",
440
+ "345" => "Coordination of Benefits End",
441
+ "348" => "Benefit Begin",
442
+ "349" => "Benefit End",
443
+ "350" => "Education Begin",
444
+ "351" => "Education End",
445
+ "356" => "Eligibility Begin",
446
+ "357" => "Eligibility End",
325
447
  "360" => "Initial Disability Period Start",
326
448
  "361" => "Initial Disability Period End",
449
+ "382" => "Enrollment",
450
+ "383" => "Adjusted Hire",
451
+ "385" => "Credited Service Begin",
452
+ "386" => "Credited Service End",
453
+ "388" => "Payment Cancellation",
454
+ "393" => "Plan Participation Suspension",
455
+ "394" => "Rehire",
327
456
  "405" => "Production",
328
457
  "431" => "Onset of Current Symptoms or Illness",
458
+ "434" => "Statement",
329
459
  "435" => "Admission",
330
460
  "439" => "Accident",
331
461
  "444" => "First Visit or Consultation",
@@ -336,9 +466,13 @@ module Stupidedi
336
466
  "463" => "Begin Therapy",
337
467
  "471" => "Prescription",
338
468
  "472" => "Service",
469
+ "473" => "Medicaid Begin",
470
+ "474" => "Medicaid End",
339
471
  "484" => "Last Menstrual Period",
472
+ "543" => "Last Premium Paid Date",
340
473
  "573" => "Date Claim Paid",
341
474
  "607" => "Certification Revision",
475
+ "695" => "Previous Period",
342
476
  "738" => "Most Recent Hemoglobin or Hematocrit or Both",
343
477
  "739" => "Most Recent Serum Creatine"))
344
478
 
@@ -442,15 +576,25 @@ module Stupidedi
442
576
  "A8" => "Noncovered Charges - Actual",
443
577
  "AU" => "Coverage Amount",
444
578
  "B6" => "Allowed Amount",
579
+ "B9" => "Co-insurance - Actual",
580
+ "C1" => "Co-Payment Amount",
445
581
  "D" => "Payor Amount Paid",
582
+ "D2" => "Deductible Amount",
446
583
  "D8" => "Discount Amount",
447
584
  "DY" => "Per Day Limit",
448
585
  "EAF" => "Amount Owed",
586
+ "EBA" => "Expected Expenditure Amount",
587
+ "F3" => "Patient Responsibility - Estimated",
449
588
  "F4" => "Postage Claimed",
450
589
  "F5" => "Patient Amount Paid",
590
+ "FK" => "Other Unlisted Amount",
591
+ "GT" => "Goods and Services Tax",
451
592
  "I" => "Interest",
452
593
  "KH" => "Deduction Amount",
594
+ "N8" => "Miscellaneous Taxes",
453
595
  "NL" => "Negative Ledger Balance",
596
+ "P3" => "Premium Amount",
597
+ "R" => "Spend Down",
454
598
  "T" => "Tax",
455
599
  "T2" => "Total Claim Before Taxes",
456
600
  "YU" => "In Process",
@@ -471,13 +615,34 @@ module Stupidedi
471
615
  "DA" => "Demand Deposit",
472
616
  "SG" => "Savings"))
473
617
 
474
- E584 = t::ID.new(:E584 , "Employment Status Code" , 2, 2)
618
+ E584 = t::ID.new(:E584 , "Employment Status Code" , 2, 2,
619
+ s::CodeList.build(
620
+ "AC" => "Active",
621
+ "AO" => "Active Military - Overseas",
622
+ "AU" => "Active Military - USA",
623
+ "FT" => "Full-time",
624
+ "L1" => "Leave of Absence",
625
+ "PT" => "Part-time",
626
+ "RT" => "Retired",
627
+ "TE" => "Terminated"))
628
+
475
629
  E591 = t::ID.new(:E591 , "Payment Method Code" , 3, 3)
476
630
  E594 = t::ID.new(:E594 , "Frequency Code" , 1, 1,
477
631
  s::CodeList.build(
478
632
  "1" => "Weekly",
633
+ "2" => "Biweekly",
634
+ "3" => "Semimonthly",
479
635
  "4" => "Monthly",
480
- "6" => "Daily"))
636
+ "6" => "Daily",
637
+ "7" => "Annual",
638
+ "8" => "Two Calendar Months",
639
+ "9" => "Lump-Sum Separation Allowance",
640
+ "B" => "Year-to-Date",
641
+ "C" => "Single",
642
+ "H" => "Hourly",
643
+ "Q" => "Quarterly",
644
+ "S" => "Semiannual",
645
+ "U" => "Unknown"))
481
646
 
482
647
  E609 = t::Nn.new(:E609 , "Count" , 1, 9, 0)
483
648
  E618 = t::ID.new(:E618 , "Implementation Transaction Set Syntax Error Code", 1, 3,
@@ -571,6 +736,8 @@ module Stupidedi
571
736
  "AA" => "Unacknowledged Quantity",
572
737
  "CA" => "Covered - Actual",
573
738
  "CD" => "Co-insured - Actual",
739
+ "DT" => "Dependent Total",
740
+ "ET" => "Employee Total",
574
741
  "FL" => "Units",
575
742
  "LA" => "Life-time Reserve - Actual",
576
743
  "LE" => "Life-time Reserve - Estimated",
@@ -581,6 +748,7 @@ module Stupidedi
581
748
  "PT" => "Patients",
582
749
  "QA" => "Quantity Approved",
583
750
  "QC" => "Quantity Disapproved",
751
+ "TO" => "Total",
584
752
  "VS" => "Visits",
585
753
  "ZK" => "Federal Medicare or Medicaid Payment Mandate Category 1",
586
754
  "ZL" => "Federal Medicare or Medicaid Payment Mandate Category 2",
@@ -634,6 +802,7 @@ module Stupidedi
634
802
  "R" => "Rejected",
635
803
  "W" => "Rejected, Assurance Failed Validity Tests",
636
804
  "X" => "Rejected, Content After Decryption Could Not Be Analyzed"))
805
+
637
806
  E718 = t::ID.new(:E718 , "Transaction Set Syntax Error Code" , 1, 3)
638
807
  E719 = t::Nn.new(:E719 , "Segment Position in Transaction Set" , 1, 10, 0)
639
808
 
@@ -759,12 +928,43 @@ module Stupidedi
759
928
 
760
929
  E757 = t::Nn.new(:E757 , "Report Copies Needed" , 1, 2, 0)
761
930
  E782 = t:: R.new(:E782 , "Monetary Amount" , 1, 18)
931
+ E786 = t::ID.new(:E786 , "Security Level Code" , 2, 2,
932
+ s::CodeList.build(
933
+ "00" => "Company Non-Classified",
934
+ "01" => "Company Internal Use Only",
935
+ "02" => "Company Confidential",
936
+ "03" => "Company Confidential, Restricted (Need to Know)",
937
+ "04" => "Company Registered (Signature Required)",
938
+ "05" => "Personal",
939
+ "06" => "Supplier Proprietary",
940
+ "09" => "Company Defined (Trading Partner Level)",
941
+ "11" => "Competition Sensitive",
942
+ "20" => "Court Restricted",
943
+ "21" => "Juvenile Record Restricted",
944
+ "90" => "Government Non-Classified",
945
+ "92" => "Government Confidential",
946
+ "93" => "Government Secret",
947
+ "94" => "Government Top Secret",
948
+ "99" => "Government Defined (Trading Partner Level)",
949
+ "ZZ" => "Mutually Defined"))
950
+
762
951
  E799 = t::AN.new(:E799 , "Version Identifier" , 1, 30)
763
952
  E812 = t::ID.new(:E812 , "Payment Format Code" , 3, 3,
764
953
  s::CodeList.build(
765
954
  "CCP" => "Cash Concentration/Disbursement plus Addenda (CCD+)(ACH)",
766
955
  "CTX" => "Corporate Trade Exchange (CTX) (ACH)"))
767
956
 
957
+ E875 = t::ID.new(:E875 , "Maintenance Type Code" , 3, 3,
958
+ s::CodeList.build(
959
+ "001" => "Change",
960
+ "002" => "Delete",
961
+ "021" => "Addition",
962
+ "024" => "Cancellation or Termination",
963
+ "025" => "Reinstatement",
964
+ "026" => "Correction",
965
+ "030" => "Audit or Compare",
966
+ "032" => "Employee Information Not Applicable"))
967
+
768
968
  E901 = t::ID.new(:E901 , "Reject Reason Code" , 2, 2,
769
969
  s::CodeList.build(
770
970
  "T1" => "Cannot Identify Provider as TPO (Third Party Organization) Participant",
@@ -859,18 +1059,43 @@ module Stupidedi
859
1059
  E1069 = t::ID.new(:E1069, "Individual Relationship Code" , 2, 2,
860
1060
  s::CodeList.build(
861
1061
  "01" => "Spouse",
1062
+ "03" => "Father or Mother",
1063
+ "04" => "Grandfather or Grandmother",
1064
+ "05" => "Grandson or Granddaughter",
1065
+ "06" => "Uncle or Aunt",
1066
+ "07" => "Nephew or Niece",
1067
+ "08" => "Cousin",
1068
+ "09" => "Adopted Child",
1069
+ "10" => "Foster Child",
1070
+ "11" => "Son-in-law or Daughter-in-law",
1071
+ "12" => "Brother-in-law or Sister-in-law",
1072
+ "13" => "Mother-in-law or Father-in-law",
1073
+ "14" => "Brother or Sister",
1074
+ "15" => "Ward",
1075
+ "16" => "Stepparent",
1076
+ "17" => "Stepson or Stepdaughter",
862
1077
  "18" => "Self",
863
1078
  "19" => "Child",
864
1079
  "20" => "Employee",
865
1080
  "21" => "Unknown",
1081
+ "23" => "Sponsored Dependent",
1082
+ "24" => "Dependent of a Minor Dependent",
1083
+ "25" => "Ex-spouse",
1084
+ "26" => "Guardian",
1085
+ "31" => "Court Appointed Guardian",
1086
+ "38" => "Collateral Dependent",
866
1087
  "39" => "Organ Donor",
867
1088
  "40" => "Cadaver Donor",
868
1089
  "53" => "Life Partner",
869
- "G8" => "Other Relationship"))
1090
+ "60" => "Annuitant",
1091
+ "D2" => "Trustee",
1092
+ "G8" => "Other Relationship",
1093
+ "G9" => "Other Relative"))
870
1094
 
871
1095
  E1073 = t::ID.new(:E1073, "Yes/No Condition or Response Code" , 1, 1,
872
1096
  s::CodeList.build(
873
1097
  "N" => "No",
1098
+ "U" => "Unknown",
874
1099
  "Y" => "Yes",
875
1100
  "W" => "Not Applicable"))
876
1101
 
@@ -895,6 +1120,7 @@ module Stupidedi
895
1120
  "E3" => "Spectacle Frames",
896
1121
  "ZZ" => "Mutually Defined"))
897
1122
 
1123
+ E1137 = t::AN.new(:E1137, "Medical Code Value" , 1, 15)
898
1124
  E1138 = t::ID.new(:E1138, "Payer Responsibility Sequence" , 1, 1,
899
1125
  s::CodeList.build(
900
1126
  "P" => "Primary",
@@ -910,7 +1136,27 @@ module Stupidedi
910
1136
  "G" => "Payer Responsibility Ten",
911
1137
  "H" => "Payer Responsibility Eleven"))
912
1138
 
913
- E1143 = t::ID.new(:E1143, "Coordination of Benefits Code" , 1, 1)
1139
+ E1143 = t::ID.new(:E1143, "Coordination of Benefits Code" , 1, 1,
1140
+ s::CodeList.build(
1141
+ "1" => "Coordination of Benefits",
1142
+ "5" => "Unknown",
1143
+ "6" => "No Coordination of Benefits"))
1144
+
1145
+ E1146 = t::ID.new(:E1146, "Disability Type Code" , 1, 1,
1146
+ s::CodeList.build(
1147
+ "1" => "Short Term Disability",
1148
+ "2" => "Long Term Disability",
1149
+ "3" => "Permanent or Total Disability",
1150
+ "4" => "No Disability"))
1151
+
1152
+ E1149 = t::ID.new(:E1149, "Occupation Code" , 4, 6)
1153
+ E1154 = t::ID.new(:E1154, "Work Intensity Code" , 1, 1)
1154
+ E1161 = t::ID.new(:E1161, "Product Option Code" , 1, 2)
1155
+ E1165 = t::ID.new(:E1165, "Confidentiality Code" , 1, 1,
1156
+ s::CodeList.build(
1157
+ "R" => "Restricted Access",
1158
+ "U" => "Unrestricted Access"))
1159
+
914
1160
  E1166 = t::ID.new(:E1166, "Contract Type Code" , 2, 2,
915
1161
  s::CodeList.build(
916
1162
  "01" => "Diagnosis Related Group (DRG)",
@@ -921,9 +1167,184 @@ module Stupidedi
921
1167
  "06" => "Percent",
922
1168
  "09" => "Other"))
923
1169
 
924
- E1220 = t::ID.new(:E1220, "Student Status Code" , 1, 1)
1170
+ E1176 = t::ID.new(:E1176, "Employment Class Code" , 2, 3,
1171
+ s::CodeList.build(
1172
+ "01" => "Union",
1173
+ "02" => "Non-Union",
1174
+ "03" => "Executive",
1175
+ "04" => "Non-Executive",
1176
+ "05" => "Management",
1177
+ "06" => "Non-Management",
1178
+ "07" => "Hourly",
1179
+ "08" => "Salaried",
1180
+ "09" => "Administrative",
1181
+ "10" => "Non-Administrative",
1182
+ "11" => "Exempt",
1183
+ "12" => "Non-Exempt",
1184
+ "17" => "Highly Compensated",
1185
+ "18" => "Key-Employee",
1186
+ "19" => "Bargaining",
1187
+ "20" => "Non-Bargaining",
1188
+ "21" => "Owner",
1189
+ "22" => "President",
1190
+ "23" => "Vice President"))
1191
+
1192
+ E1201 = t::ID.new(:E1201, "Information Status Code" , 1, 1)
1193
+ E1203 = t::ID.new(:E1203, "Maintenance Reason Code" , 2, 3,
1194
+ s::CodeList.build(
1195
+ "01" => "Divorce",
1196
+ "02" => "Birth",
1197
+ "03" => "Death",
1198
+ "04" => "Retirement",
1199
+ "05" => "Adoption",
1200
+ "06" => "Strike",
1201
+ "07" => "Termination of Benefits",
1202
+ "08" => "Termination of Employment",
1203
+ "09" => "Consolidation Omnibus Budget Reconciliation Act (COBRA)",
1204
+ "10" => "Consolidation Omnibus Budget Reconciliation Act (COBRA) Premium Paid",
1205
+ "11" => "Surviving Spouse",
1206
+ "14" => "Voluntary Withdrawal",
1207
+ "15" => "Primary Care Provider (PCP) Change",
1208
+ "16" => "Quit",
1209
+ "17" => "Fired",
1210
+ "18" => "Suspended",
1211
+ "20" => "Active",
1212
+ "21" => "Disability",
1213
+ "22" => "Plan Change",
1214
+ "25" => "Change in Identifying Data Elements",
1215
+ "26" => "Declined Coverage",
1216
+ "27" => "Pre-Enrollment",
1217
+ "28" => "Initial Enrollment",
1218
+ "29" => "Benefit Selection",
1219
+ "31" => "Legal Separation",
1220
+ "32" => "Marriage",
1221
+ "33" => "Personnel Data",
1222
+ "37" => "Leave of Absence with Benefits",
1223
+ "38" => "Leave of Absence without Benefits",
1224
+ "39" => "Lay Off with Benefits",
1225
+ "40" => "Lay Off without Benefits",
1226
+ "41" => "Re-enrollment",
1227
+ "43" => "Change of Location",
1228
+ "46" => "Current Customer Information File in Error",
1229
+ "59" => "Non Payment",
1230
+ "AA" => "Dissatisfaction with Office Staff",
1231
+ "AB" => "Dissatisfaction with Medical Care/Services Rendered",
1232
+ "AC" => "Inconvenient Office Location",
1233
+ "AD" => "Dissatisfaction with Office Hours",
1234
+ "AE" => "Unable to Schedule Appointments in a Timely Manner",
1235
+ "AF" => "Dissatisfaction with Physician's Referral Policy",
1236
+ "AG" => "Less Respect and Attention Time Given than to Other Patients",
1237
+ "AH" => "Patient Moved to a New Location",
1238
+ "AI" => "No Reason Given",
1239
+ "AJ" => "Appointment Times not Met in a Timely Manner",
1240
+ "AL" => "Algorithm Assigned Benefit Selection",
1241
+ "EC" => "Member Benefit Selection",
1242
+ "XN" => "Notification Only",
1243
+ "XT" => "Transfer"))
1244
+
1245
+ E1204 = t::AN.new(:E1204, "Plan Coverage Description" , 1, 50)
1246
+ E1205 = t::ID.new(:E1205, "Insurance Line Code" , 2, 3,
1247
+ s::CodeList.build(
1248
+ "AG" => "Preventative Care/Wellness",
1249
+ "AH" => "24 Hour Care",
1250
+ "AJ" => "Medicare Risk",
1251
+ "AK" => "Mental Health",
1252
+ "DCP" => "Dental Capitation",
1253
+ "DEN" => "Dental",
1254
+ "EPO" => "Exclusive Provider Organization",
1255
+ "FAC" => "Facility",
1256
+ "HE" => "Hearing",
1257
+ "HLT" => "Health",
1258
+ "HMO" => "Health Maintenance Organization",
1259
+ "LTC" => "Long-Term Care",
1260
+ "LTD" => "Long-Term Disability",
1261
+ "MM" => "Major Medical",
1262
+ "MOD" => "Mail Order Drug",
1263
+ "PDG" => "Prescription Drug",
1264
+ "POS" => "Point of Service",
1265
+ "PPO" => "Preferred Provider Organization",
1266
+ "PRA" => "Practitioners",
1267
+ "STD" => "Short-Term Disability",
1268
+ "UR" => "Utilization Review",
1269
+ "VIS" => "Vision"))
1270
+
1271
+ E1207 = t::ID.new(:E1207, "Coverage Level Code" , 3, 3,
1272
+ s::CodeList.build(
1273
+ "CHD" => "Children Only",
1274
+ "DEP" => "Dependents Only",
1275
+ "E1D" => "Employee and One Dependent",
1276
+ "E2D" => "Employee and Two Dependents",
1277
+ "E3D" => "Employee and Three Dependents",
1278
+ "E5D" => "Employee and One or More Dependents",
1279
+ "E6D" => "Employee and Two or More Dependents",
1280
+ "E7D" => "Employee and Three or More Dependents",
1281
+ "E8D" => "Employee and Four or More Dependents",
1282
+ "E9D" => "Employee and Five or More Dependents",
1283
+ "ECH" => "Employee and Children",
1284
+ "EMP" => "Employee Only",
1285
+ "ESP" => "Employee and Spouse",
1286
+ "FAM" => "Family",
1287
+ "IND" => "Individual",
1288
+ "SPC" => "Spouse and Children",
1289
+ "SPO" => "Spouse Only",
1290
+ "TWO" => "Two Party"))
1291
+
1292
+ E1209 = t::ID.new(:E1209, "Underwriting Decision Code" , 1, 1)
1293
+ E1211 = t::ID.new(:E1211, "Drug House Code" , 2, 3)
1294
+ E1212 = t::ID.new(:E1212, "Health-Related Code" , 1, 1,
1295
+ s::CodeList.build(
1296
+ "N" => "None",
1297
+ "S" => "Substance Abuse",
1298
+ "T" => "Tobacco Use",
1299
+ "U" => "Unknown",
1300
+ "X" => "Tobacco Use and Substance Abuse"))
1301
+
1302
+ E1213 = t::ID.new(:E1213, "Current Health Condition Code" , 1, 1)
1303
+ E1214 = t::AN.new(:E1214, "Salary Grade" , 1, 5)
1304
+ E1215 = t::ID.new(:E1215, "Identification Card Type Code" , 1, 1,
1305
+ s::CodeList.build(
1306
+ "D" => "Dental Insurance",
1307
+ "H" => "Health Insurance",
1308
+ "P" => "Prescription Drug Service Drug Insurance"))
1309
+
1310
+ E1216 = t::ID.new(:E1216, "Benefit Status Code" , 1, 1,
1311
+ s::CodeList.build(
1312
+ "A" => "Active",
1313
+ "C" => "Consolidated Omnibus Budget Reconciliation Act (COBRA)",
1314
+ "S" => "Surviving Insured",
1315
+ "T" => "Tax Equity and Fiscal Responsibility Act (TEFRA)"))
1316
+
1317
+ E1218 = t::ID.new(:E1218, "Benefit Status Code" , 1, 1,
1318
+ s::CodeList.build(
1319
+ "A" => "Medicare Part A",
1320
+ "B" => "Medicare Part B",
1321
+ "C" => "Medicare Part A and B",
1322
+ "D" => "Medicare",
1323
+ "E" => "No Medicare"))
1324
+
1325
+ E1219 = t::ID.new(:E1219, "Consolidated Omnibus Budget Reconciliation Act (COBRA) Qualifying", 1, 2,
1326
+ s::CodeList.build(
1327
+ "1" => "Termination of Employment",
1328
+ "2" => "Reduction of work hours",
1329
+ "3" => "Medicare",
1330
+ "4" => "Death",
1331
+ "5" => "Divorce",
1332
+ "6" => "Separation",
1333
+ "7" => "Ineligible Child",
1334
+ "8" => "Bankruptcy of Retiree's Former Employer (26 U.S.C. 4980B(f)(3)(F))",
1335
+ "9" => "Layoff",
1336
+ "10" => "Leave of Absence",
1337
+ "ZZ" => "Mutually Defined"))
1338
+
1339
+ E1220 = t::ID.new(:E1220, "Student Status Code" , 1, 1,
1340
+ s::CodeList.build(
1341
+ "F" => "Full-time",
1342
+ "N" => "Not a Student",
1343
+ "P" => "Part-time"))
1344
+
925
1345
  E1221 = t::ID.new(:E1221, "Provider Code" , 1, 3,
926
1346
  s::CodeList.build(
1347
+ "AT" => "Attending",
927
1348
  "BI" => "Billing",
928
1349
  "PE" => "Performing"))
929
1350
 
@@ -1045,6 +1466,13 @@ module Stupidedi
1045
1466
  E1271 = t::AN.new(:E1271, "Industry Code" , 1, 30,
1046
1467
  s::CodeList.external("508"))
1047
1468
 
1469
+ E1303 = t::ID.new(:E1303, "Use of Language Indicator" , 1, 2,
1470
+ s::CodeList.build(
1471
+ "5" => "Language Reading",
1472
+ "6" => "Language Writing",
1473
+ "7" => "Language Speaking",
1474
+ "8" => "Native Language"))
1475
+
1048
1476
  E1314 = t::ID.new(:E1314, "Admission Source Code" , 1, 1,
1049
1477
  s::CodeList.external("230"))
1050
1478
 
@@ -1175,7 +1603,20 @@ module Stupidedi
1175
1603
  "Y" => "Yes, Provider has a Signed Statement Permitting Release of Medical Billing Data Related to a Claim"))
1176
1604
 
1177
1605
  E1364 = t::ID.new(:E1364, "Review Code" , 1, 2)
1178
- E1365 = t::ID.new(:E1365, "Service Type Code" , 1, 2)
1606
+ E1365 = t::ID.new(:E1365, "Service Type Code" , 1, 2,
1607
+ s::CodeList.build(
1608
+ "1" => "Medical Care",
1609
+ "35" => "Dental Care",
1610
+ "48" => "Hospital - Inpatient",
1611
+ "50" => "Hospital - Outpatient",
1612
+ "54" => "Long Term Care",
1613
+ "89" => "Free Standing Prescription Drug",
1614
+ "90" => "Mail Order Prescription Drug",
1615
+ "A4" => "Psychiatric",
1616
+ "AG" => "Skilled Nursing Care",
1617
+ "AL" => "Vision (Optometry)",
1618
+ "BB" => "Partial Hospitalization (Psychiatric)"))
1619
+
1179
1620
  E1366 = t::ID.new(:E1366, "Special Program Code" , 2, 3)
1180
1621
  E1367 = t::ID.new(:E1367, "Sublaxation Level Code" , 2, 3)
1181
1622
  E1368 = t::ID.new(:E1368, "Tooth Status Code" , 1, 2)
@@ -1183,6 +1624,7 @@ module Stupidedi
1183
1624
  E1371 = t:: R.new(:E1371, "Unit Rate" , 1, 10)
1184
1625
  E1383 = t::ID.new(:E1383, "Claim Submission Reason Code" , 2, 2)
1185
1626
  E1384 = t::ID.new(:E1384, "Patient Location Code" , 1, 1)
1627
+ E1470 = t::Nn.new(:E1470, "Number" , 1, 9, 0)
1186
1628
  E1473 = t::ID.new(:E1473, "Pricing Methodology" , 2, 2,
1187
1629
  s::CodeList.build(
1188
1630
  "00" => "Zero Pricing (Not Covered Under Contract)",
@@ -1201,6 +1643,7 @@ module Stupidedi
1201
1643
  "13" => "Cost Reimbursed",
1202
1644
  "14" => "Adjustment Pricing"))
1203
1645
 
1646
+ E1476 = t::ID.new(:E1476, "Language Proficiency Indicator" , 1, 1)
1204
1647
  E1514 = t::ID.new(:E1514, "Delay Reason Code" , 1, 2,
1205
1648
  s::CodeList.build(
1206
1649
  "1" => "Proof of Eligibility Unknown or Unavailable",
@@ -1236,6 +1679,12 @@ module Stupidedi
1236
1679
 
1237
1680
  E1528 = t::Nn.new(:E1528, "Component Data Element Position in Composite", 1, 2, 0)
1238
1681
  E1686 = t::Nn.new(:E1686, "Repeating Data Element Position" , 1, 4, 0)
1682
+ E1701 = t::ID.new(:E1701, "Eligibility Reason Code" , 1, 1,
1683
+ s::CodeList.build(
1684
+ "0" => "Age",
1685
+ "1" => "Disability",
1686
+ "2" => "End Stage Renal Disease (ESRD)"))
1687
+
1239
1688
  E1705 = t::AN.new(:E1705, "Implementation Convention Reference" , 1, 35)
1240
1689
  E1715 = t::ID.new(:E1715, "Country Subdivision Code" , 1, 3,
1241
1690
  s::CodeList.external("5"))
@@ -1382,6 +1831,14 @@ module Stupidedi
1382
1831
  E98 .component_use(r::Optional),
1383
1832
  E1270.component_use(r::Optional))
1384
1833
 
1834
+ C052 = Schema::CompositeElementDef.build(:C052,
1835
+ "Medicare Status Code",
1836
+ "To provide Medicare coverage and associated reason for Medicare eligibility",
1837
+ E1218.component_use(r::Mandatory),
1838
+ E1701.component_use(r::Optional),
1839
+ E1701.component_use(r::Optional),
1840
+ E1701.component_use(r::Optional))
1841
+
1385
1842
  C056 = Schema::CompositeElementDef.build(:C056,
1386
1843
  "Composite Race or Ethnicity Information",
1387
1844
  "",