hippo 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/CHANGELOG +4 -5
  2. data/README.md +10 -5
  3. data/lib/hippo/parser.rb +19 -9
  4. data/lib/hippo/transaction_sets/HIPAA_276/L2000A.rb +7 -3
  5. data/lib/hippo/transaction_sets/HIPAA_276/L2000B.rb +7 -3
  6. data/lib/hippo/transaction_sets/HIPAA_276/L2000C.rb +7 -3
  7. data/lib/hippo/transaction_sets/HIPAA_276/L2000D.rb +15 -8
  8. data/lib/hippo/transaction_sets/HIPAA_276/L2000E.rb +12 -7
  9. data/lib/hippo/transaction_sets/HIPAA_276/L2100A.rb +3 -2
  10. data/lib/hippo/transaction_sets/HIPAA_276/L2100B.rb +2 -1
  11. data/lib/hippo/transaction_sets/HIPAA_276/L2100C.rb +4 -2
  12. data/lib/hippo/transaction_sets/HIPAA_276/L2100D.rb +4 -2
  13. data/lib/hippo/transaction_sets/HIPAA_276/L2100E.rb +1 -1
  14. data/lib/hippo/transaction_sets/HIPAA_276/L2200D.rb +13 -12
  15. data/lib/hippo/transaction_sets/HIPAA_276/L2200E.rb +13 -12
  16. data/lib/hippo/transaction_sets/HIPAA_276/L2210D.rb +4 -3
  17. data/lib/hippo/transaction_sets/HIPAA_276/L2210E.rb +4 -3
  18. data/lib/hippo/transaction_sets/HIPAA_276/base.rb +31 -27
  19. data/lib/hippo/transaction_sets/HIPAA_277/L2000A.rb +11 -4
  20. data/lib/hippo/transaction_sets/HIPAA_277/L2000B.rb +13 -6
  21. data/lib/hippo/transaction_sets/HIPAA_277/L2000C.rb +13 -6
  22. data/lib/hippo/transaction_sets/HIPAA_277/L2000D.rb +12 -6
  23. data/lib/hippo/transaction_sets/HIPAA_277/L2000E.rb +11 -6
  24. data/lib/hippo/transaction_sets/HIPAA_277/L2100A.rb +4 -2
  25. data/lib/hippo/transaction_sets/HIPAA_277/L2100B.rb +2 -1
  26. data/lib/hippo/transaction_sets/HIPAA_277/L2100C.rb +4 -2
  27. data/lib/hippo/transaction_sets/HIPAA_277/L2100D.rb +3 -2
  28. data/lib/hippo/transaction_sets/HIPAA_277/L2100E.rb +1 -1
  29. data/lib/hippo/transaction_sets/HIPAA_277/L2200A.rb +3 -3
  30. data/lib/hippo/transaction_sets/HIPAA_277/L2200B.rb +10 -7
  31. data/lib/hippo/transaction_sets/HIPAA_277/L2200C.rb +14 -8
  32. data/lib/hippo/transaction_sets/HIPAA_277/L2200D.rb +13 -9
  33. data/lib/hippo/transaction_sets/HIPAA_277/L2200E.rb +12 -11
  34. data/lib/hippo/transaction_sets/HIPAA_277/L2220D.rb +7 -6
  35. data/lib/hippo/transaction_sets/HIPAA_277/L2220E.rb +5 -4
  36. data/lib/hippo/transaction_sets/HIPAA_277/base.rb +23 -20
  37. data/lib/hippo/transaction_sets/HIPAA_835/L1000A.rb +9 -6
  38. data/lib/hippo/transaction_sets/HIPAA_835/L1000B.rb +12 -5
  39. data/lib/hippo/transaction_sets/HIPAA_835/L2000.rb +6 -2
  40. data/lib/hippo/transaction_sets/HIPAA_835/L2100.rb +55 -24
  41. data/lib/hippo/transaction_sets/HIPAA_835/L2110.rb +30 -9
  42. data/lib/hippo/transaction_sets/HIPAA_835/base.rb +23 -13
  43. data/lib/hippo/transaction_sets/HIPAA_837/L1000A.rb +5 -3
  44. data/lib/hippo/transaction_sets/HIPAA_837/L1000B.rb +1 -1
  45. data/lib/hippo/transaction_sets/HIPAA_837/L2000A.rb +30 -9
  46. data/lib/hippo/transaction_sets/HIPAA_837/L2000B.rb +42 -7
  47. data/lib/hippo/transaction_sets/HIPAA_837/L2000C.rb +17 -5
  48. data/lib/hippo/transaction_sets/HIPAA_837/L2010AA.rb +14 -6
  49. data/lib/hippo/transaction_sets/HIPAA_837/L2010AB.rb +3 -2
  50. data/lib/hippo/transaction_sets/HIPAA_837/L2010AC.rb +8 -4
  51. data/lib/hippo/transaction_sets/HIPAA_837/L2010BA.rb +9 -7
  52. data/lib/hippo/transaction_sets/HIPAA_837/L2010BB.rb +11 -4
  53. data/lib/hippo/transaction_sets/HIPAA_837/L2010CA.rb +10 -6
  54. data/lib/hippo/transaction_sets/HIPAA_837/L2300.rb +116 -56
  55. data/lib/hippo/transaction_sets/HIPAA_837/L2310A.rb +6 -2
  56. data/lib/hippo/transaction_sets/HIPAA_837/L2310B.rb +8 -4
  57. data/lib/hippo/transaction_sets/HIPAA_837/L2310C.rb +6 -3
  58. data/lib/hippo/transaction_sets/HIPAA_837/L2310D.rb +5 -2
  59. data/lib/hippo/transaction_sets/HIPAA_837/L2310E.rb +1 -1
  60. data/lib/hippo/transaction_sets/HIPAA_837/L2310F.rb +1 -1
  61. data/lib/hippo/transaction_sets/HIPAA_837/L2320.rb +54 -19
  62. data/lib/hippo/transaction_sets/HIPAA_837/L2330A.rb +5 -3
  63. data/lib/hippo/transaction_sets/HIPAA_837/L2330B.rb +12 -8
  64. data/lib/hippo/transaction_sets/HIPAA_837/L2330C.rb +6 -2
  65. data/lib/hippo/transaction_sets/HIPAA_837/L2330D.rb +7 -3
  66. data/lib/hippo/transaction_sets/HIPAA_837/L2330E.rb +5 -2
  67. data/lib/hippo/transaction_sets/HIPAA_837/L2330F.rb +5 -2
  68. data/lib/hippo/transaction_sets/HIPAA_837/L2330G.rb +7 -3
  69. data/lib/hippo/transaction_sets/HIPAA_837/L2400.rb +122 -60
  70. data/lib/hippo/transaction_sets/HIPAA_837/L2410.rb +8 -2
  71. data/lib/hippo/transaction_sets/HIPAA_837/L2420A.rb +8 -4
  72. data/lib/hippo/transaction_sets/HIPAA_837/L2420B.rb +7 -3
  73. data/lib/hippo/transaction_sets/HIPAA_837/L2420C.rb +5 -2
  74. data/lib/hippo/transaction_sets/HIPAA_837/L2420D.rb +5 -2
  75. data/lib/hippo/transaction_sets/HIPAA_837/L2420E.rb +8 -4
  76. data/lib/hippo/transaction_sets/HIPAA_837/L2420F.rb +6 -2
  77. data/lib/hippo/transaction_sets/HIPAA_837/L2420G.rb +1 -1
  78. data/lib/hippo/transaction_sets/HIPAA_837/L2420H.rb +1 -1
  79. data/lib/hippo/transaction_sets/HIPAA_837/L2430.rb +6 -3
  80. data/lib/hippo/transaction_sets/HIPAA_837/L2440.rb +4 -1
  81. data/lib/hippo/transaction_sets/HIPAA_837/base.rb +23 -32
  82. data/lib/hippo/transaction_sets/HIPAA_999/L2000AK2.rb +9 -3
  83. data/lib/hippo/transaction_sets/HIPAA_999/L2100AK2.rb +9 -3
  84. data/lib/hippo/transaction_sets/HIPAA_999/L2110AK2.rb +4 -1
  85. data/lib/hippo/transaction_sets/HIPAA_999/base.rb +6 -3
  86. data/lib/hippo/transaction_sets/base.rb +87 -72
  87. data/lib/hippo/transaction_sets/component.rb +80 -0
  88. data/lib/hippo/transaction_sets/repeating_component.rb +30 -0
  89. data/lib/hippo/transaction_sets.rb +8 -6
  90. data/lib/hippo/version.rb +1 -1
  91. data/samples/005010X221A1_business_scenario_1.edi +1 -0
  92. data/samples/005010X221A1_tmhp_example.edi +1 -0
  93. data/samples/005010X222A1_anesthesia.edi +1 -0
  94. data/samples/005010X222A1_commercial_health_insurance.edi +1 -0
  95. data/test/test_helper.rb +6 -6
  96. data/test/test_hipaa_835.rb +229 -0
  97. data/test/test_hipaa_837.rb +263 -63
  98. data/test/test_parser.rb +26 -0
  99. data/test/test_segments_base.rb +1 -1
  100. data/test/test_transaction_sets_base.rb +21 -1
  101. metadata +17 -16
  102. data/bin/demo_270.rb +0 -280
  103. data/bin/demo_276.rb +0 -296
  104. data/bin/demo_835.rb +0 -170
  105. data/lib/hippo/samples/835.edi +0 -88
  106. data/lib/hippo/samples/sample_835_with.rb +0 -272
  107. data/lib/hippo/samples/sample_parsed.rb +0 -1162
@@ -9,14 +9,21 @@ module Hippo::TransactionSets
9
9
  :name => 'Other Subscriber Information',
10
10
  :minimum => 0,
11
11
  :maximum => 1,
12
- :position => 2900
12
+ :position => 2900,
13
+ :identified_by => {
14
+ 'SBR01' => ["A", "B", "C", "D", "E", "F", "G", "H", "P", "S", "T", "U"],
15
+ 'SBR02' => ["01", "18", "19", "20", "21", "39", "40", "53", "G8"]
16
+ }
13
17
 
14
18
  #Claim Level Adjustments
15
19
  segment Hippo::Segments::CAS,
16
20
  :name => 'Claim Level Adjustments',
17
21
  :minimum => 0,
18
22
  :maximum => 5,
19
- :position => 2950
23
+ :position => 2950,
24
+ :identified_by => {
25
+ 'CAS01' => ["CO", "CR", "OA", "PI", "PR"]
26
+ }
20
27
 
21
28
  #Coordination of Benefits (COB) Payer Paid Amount
22
29
  segment Hippo::Segments::AMT,
@@ -24,7 +31,7 @@ module Hippo::TransactionSets
24
31
  :minimum => 0,
25
32
  :maximum => 1,
26
33
  :position => 3000,
27
- :defaults => {
34
+ :identified_by => {
28
35
  'AMT01' => 'D'
29
36
  }
30
37
 
@@ -34,7 +41,7 @@ module Hippo::TransactionSets
34
41
  :minimum => 0,
35
42
  :maximum => 1,
36
43
  :position => 3020,
37
- :defaults => {
44
+ :identified_by => {
38
45
  'AMT01' => 'A8'
39
46
  }
40
47
 
@@ -44,7 +51,7 @@ module Hippo::TransactionSets
44
51
  :minimum => 0,
45
52
  :maximum => 1,
46
53
  :position => 3050,
47
- :defaults => {
54
+ :identified_by => {
48
55
  'AMT01' => 'EAF'
49
56
  }
50
57
 
@@ -53,7 +60,11 @@ module Hippo::TransactionSets
53
60
  :name => 'Other Insurance Coverage Information',
54
61
  :minimum => 1,
55
62
  :maximum => 1,
56
- :position => 3110
63
+ :position => 3110,
64
+ :identified_by => {
65
+ 'OI03' => ["N", "W", "Y"],
66
+ 'OI06' => ["I", "Y"]
67
+ }
57
68
 
58
69
  #Outpatient Adjudication Information
59
70
  segment Hippo::Segments::MOA,
@@ -65,57 +76,81 @@ module Hippo::TransactionSets
65
76
  #Other Subscriber Name
66
77
  loop Hippo::TransactionSets::HIPAA_837::L2330A,
67
78
  :name => 'Other Subscriber Name',
68
- :identified_by => {'NM1.NM101' => 'IL'},
69
79
  :minimum => 1,
70
80
  :maximum => 1,
71
- :position => 3250
81
+ :position => 3250,
82
+ :identified_by => {
83
+ 'NM1.NM101' => 'IL',
84
+ 'NM1.NM102' => ["1", "2"],
85
+ 'NM1.NM108' => ["II", "MI"]
86
+ }
72
87
 
73
88
  #Other Payer Name
74
89
  loop Hippo::TransactionSets::HIPAA_837::L2330B,
75
90
  :name => 'Other Payer Name',
76
- :identified_by => {'NM1.NM101' => 'PR'},
77
91
  :minimum => 1,
78
92
  :maximum => 1,
79
- :position => 3250
93
+ :position => 3250,
94
+ :identified_by => {
95
+ 'NM1.NM101' => 'PR',
96
+ 'NM1.NM102' => '2',
97
+ 'NM1.NM108' => ["PI", "XV"]
98
+ }
80
99
 
81
100
  #Other Payer Referring Provider
82
101
  loop Hippo::TransactionSets::HIPAA_837::L2330C,
83
102
  :name => 'Other Payer Referring Provider',
84
103
  :minimum => 0,
85
104
  :maximum => 2,
86
- :position => 3250
105
+ :position => 3250,
106
+ :identified_by => {
107
+ 'NM1.NM101' => ["DN", "P3"],
108
+ 'NM1.NM102' => '1'
109
+ }
87
110
 
88
111
  #Other Payer Rendering Provider
89
112
  loop Hippo::TransactionSets::HIPAA_837::L2330D,
90
113
  :name => 'Other Payer Rendering Provider',
91
- :identified_by => {'NM1.NM101' => '82'},
92
114
  :minimum => 0,
93
115
  :maximum => 1,
94
- :position => 3650
116
+ :position => 3650,
117
+ :identified_by => {
118
+ 'NM1.NM101' => '82',
119
+ 'NM1.NM102' => ["1", "2"]
120
+ }
95
121
 
96
122
  #Other Payer Service Facility Location
97
123
  loop Hippo::TransactionSets::HIPAA_837::L2330E,
98
124
  :name => 'Other Payer Service Facility Location',
99
- :identified_by => {'NM1.NM101' => '77'},
100
125
  :minimum => 0,
101
126
  :maximum => 1,
102
- :position => 4650
127
+ :position => 4650,
128
+ :identified_by => {
129
+ 'NM1.NM101' => '77',
130
+ 'NM1.NM102' => '2'
131
+ }
103
132
 
104
133
  #Other Payer Supervising Provider
105
134
  loop Hippo::TransactionSets::HIPAA_837::L2330F,
106
135
  :name => 'Other Payer Supervising Provider',
107
- :identified_by => {'NM1.NM101' => 'DQ'},
108
136
  :minimum => 0,
109
137
  :maximum => 1,
110
- :position => 5650
138
+ :position => 5650,
139
+ :identified_by => {
140
+ 'NM1.NM101' => 'DQ',
141
+ 'NM1.NM102' => '1'
142
+ }
111
143
 
112
144
  #Other Payer Billing Provider
113
145
  loop Hippo::TransactionSets::HIPAA_837::L2330G,
114
146
  :name => 'Other Payer Billing Provider',
115
- :identified_by => {'NM1.NM101' => '85'},
116
147
  :minimum => 0,
117
148
  :maximum => 1,
118
- :position => 6350
149
+ :position => 6350,
150
+ :identified_by => {
151
+ 'NM1.NM101' => '85',
152
+ 'NM1.NM102' => ["1", "2"]
153
+ }
119
154
 
120
155
  end
121
156
  end
@@ -10,8 +10,10 @@ module Hippo::TransactionSets
10
10
  :minimum => 1,
11
11
  :maximum => 1,
12
12
  :position => 3250,
13
- :defaults => {
14
- 'NM101' => 'IL'
13
+ :identified_by => {
14
+ 'NM101' => 'IL',
15
+ 'NM102' => ["1", "2"],
16
+ 'NM108' => ["II", "MI"]
15
17
  }
16
18
 
17
19
  #Other Subscriber Address
@@ -34,7 +36,7 @@ module Hippo::TransactionSets
34
36
  :minimum => 0,
35
37
  :maximum => 1,
36
38
  :position => 3550,
37
- :defaults => {
39
+ :identified_by => {
38
40
  'REF01' => 'SY'
39
41
  }
40
42
 
@@ -10,9 +10,10 @@ module Hippo::TransactionSets
10
10
  :minimum => 1,
11
11
  :maximum => 1,
12
12
  :position => 3250,
13
- :defaults => {
13
+ :identified_by => {
14
14
  'NM101' => 'PR',
15
- 'NM102' => '2'
15
+ 'NM102' => '2',
16
+ 'NM108' => ["PI", "XV"]
16
17
  }
17
18
 
18
19
  #Other Payer Address
@@ -35,7 +36,7 @@ module Hippo::TransactionSets
35
36
  :minimum => 0,
36
37
  :maximum => 1,
37
38
  :position => 3470,
38
- :defaults => {
39
+ :identified_by => {
39
40
  'DTP01' => '573',
40
41
  'DTP02' => 'D8'
41
42
  }
@@ -45,7 +46,10 @@ module Hippo::TransactionSets
45
46
  :name => 'Other Payer Secondary Identifier',
46
47
  :minimum => 0,
47
48
  :maximum => 2,
48
- :position => 3550
49
+ :position => 3550,
50
+ :identified_by => {
51
+ 'REF01' => ["2U", "EI", "FY", "NF"]
52
+ }
49
53
 
50
54
  #Other Payer Prior Authorization Number
51
55
  segment Hippo::Segments::REF,
@@ -53,7 +57,7 @@ module Hippo::TransactionSets
53
57
  :minimum => 0,
54
58
  :maximum => 1,
55
59
  :position => 3560,
56
- :defaults => {
60
+ :identified_by => {
57
61
  'REF01' => 'G1'
58
62
  }
59
63
 
@@ -63,7 +67,7 @@ module Hippo::TransactionSets
63
67
  :minimum => 0,
64
68
  :maximum => 1,
65
69
  :position => 3563,
66
- :defaults => {
70
+ :identified_by => {
67
71
  'REF01' => '9F'
68
72
  }
69
73
 
@@ -73,7 +77,7 @@ module Hippo::TransactionSets
73
77
  :minimum => 0,
74
78
  :maximum => 1,
75
79
  :position => 3570,
76
- :defaults => {
80
+ :identified_by => {
77
81
  'REF01' => 'T4'
78
82
  }
79
83
 
@@ -83,7 +87,7 @@ module Hippo::TransactionSets
83
87
  :minimum => 0,
84
88
  :maximum => 1,
85
89
  :position => 3575,
86
- :defaults => {
90
+ :identified_by => {
87
91
  'REF01' => 'F8'
88
92
  }
89
93
 
@@ -10,7 +10,8 @@ module Hippo::TransactionSets
10
10
  :minimum => 0,
11
11
  :maximum => 1,
12
12
  :position => 3250,
13
- :defaults => {
13
+ :identified_by => {
14
+ 'NM101' => ["DN", "P3"],
14
15
  'NM102' => '1'
15
16
  }
16
17
 
@@ -19,7 +20,10 @@ module Hippo::TransactionSets
19
20
  :name => 'Other Payer Referring Provider Secondary Identification',
20
21
  :minimum => 1,
21
22
  :maximum => 3,
22
- :position => 3550
23
+ :position => 3550,
24
+ :identified_by => {
25
+ 'REF01' => ["0B", "1G", "G2"]
26
+ }
23
27
 
24
28
  end
25
29
  end
@@ -10,8 +10,9 @@ module Hippo::TransactionSets
10
10
  :minimum => 0,
11
11
  :maximum => 1,
12
12
  :position => 3650,
13
- :defaults => {
14
- 'NM101' => '82'
13
+ :identified_by => {
14
+ 'NM101' => '82',
15
+ 'NM102' => ["1", "2"]
15
16
  }
16
17
 
17
18
  #Other Payer Rendering Provider Secondary Identification
@@ -19,7 +20,10 @@ module Hippo::TransactionSets
19
20
  :name => 'Other Payer Rendering Provider Secondary Identification',
20
21
  :minimum => 1,
21
22
  :maximum => 3,
22
- :position => 4150
23
+ :position => 4150,
24
+ :identified_by => {
25
+ 'REF01' => ["0B", "1G", "G2", "LU"]
26
+ }
23
27
 
24
28
  end
25
29
  end
@@ -10,7 +10,7 @@ module Hippo::TransactionSets
10
10
  :minimum => 0,
11
11
  :maximum => 1,
12
12
  :position => 4650,
13
- :defaults => {
13
+ :identified_by => {
14
14
  'NM101' => '77',
15
15
  'NM102' => '2'
16
16
  }
@@ -20,7 +20,10 @@ module Hippo::TransactionSets
20
20
  :name => 'Other Payer Service Facility Location Secondary Identification',
21
21
  :minimum => 1,
22
22
  :maximum => 3,
23
- :position => 5550
23
+ :position => 5550,
24
+ :identified_by => {
25
+ 'REF01' => ["0B", "G2", "LU"]
26
+ }
24
27
 
25
28
  end
26
29
  end
@@ -10,7 +10,7 @@ module Hippo::TransactionSets
10
10
  :minimum => 0,
11
11
  :maximum => 1,
12
12
  :position => 5650,
13
- :defaults => {
13
+ :identified_by => {
14
14
  'NM101' => 'DQ',
15
15
  'NM102' => '1'
16
16
  }
@@ -20,7 +20,10 @@ module Hippo::TransactionSets
20
20
  :name => 'Other Payer Supervising Provider Secondary Identification',
21
21
  :minimum => 1,
22
22
  :maximum => 3,
23
- :position => 6050
23
+ :position => 6050,
24
+ :identified_by => {
25
+ 'REF01' => ["0B", "1G", "G2", "LU"]
26
+ }
24
27
 
25
28
  end
26
29
  end
@@ -10,8 +10,9 @@ module Hippo::TransactionSets
10
10
  :minimum => 0,
11
11
  :maximum => 1,
12
12
  :position => 6350,
13
- :defaults => {
14
- 'NM101' => '85'
13
+ :identified_by => {
14
+ 'NM101' => '85',
15
+ 'NM102' => ["1", "2"]
15
16
  }
16
17
 
17
18
  #Other Payer Billing Provider Secondary Identification
@@ -19,7 +20,10 @@ module Hippo::TransactionSets
19
20
  :name => 'Other Payer Billing Provider Secondary Identification',
20
21
  :minimum => 1,
21
22
  :maximum => 2,
22
- :position => 6600
23
+ :position => 6600,
24
+ :identified_by => {
25
+ 'REF01' => ["G2", "LU"]
26
+ }
23
27
 
24
28
  end
25
29
  end