era_835_parser 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +59 -44
- data/lib/era_835_parser/parser.rb +930 -178
- data/lib/era_835_parser/version.rb +1 -1
- data/spec/era_835_parser_spec.rb +1125 -548
- data/spec/example_1.835 +1 -0
- data/spec/example_2.835 +1 -0
- data/spec/example_3.835 +32 -0
- data/spec/test_era.txt +2 -2
- metadata +8 -2
data/spec/era_835_parser_spec.rb
CHANGED
@@ -3,206 +3,836 @@ require 'spec_helper'
|
|
3
3
|
RSpec.describe Era835Parser::Parser do
|
4
4
|
|
5
5
|
describe '#parse' do
|
6
|
-
before :all do
|
7
|
-
@era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/test_era.txt").parse
|
8
|
-
end
|
9
6
|
|
10
|
-
context '
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
it 'returns the correct number of adjustments' do
|
18
|
-
expect(@era[:adjustments].count).to eq(3)
|
19
|
-
end
|
7
|
+
context 'Machine readable' do
|
8
|
+
context 'example_1.835' do
|
9
|
+
# https://www.bluecrossnc.com/sites/default/files/document/attachment/providers/public/pdfs/835_5010_v2.6%20Claim%20Payment%20Advice.pdf
|
10
|
+
before :all do
|
11
|
+
@era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/example_1.835").parse
|
12
|
+
end
|
20
13
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
14
|
+
context 'Aggregate totals' do
|
15
|
+
it 'returns the addressed to' do
|
16
|
+
expect(@era[:addressed_to]).to eq(nil)
|
17
|
+
end
|
18
|
+
it 'returns the correct number of checks' do
|
19
|
+
expect(@era[:checks].count).to eq(1)
|
20
|
+
end
|
21
|
+
it 'returns the correct number of adjustments' do
|
22
|
+
expect(@era[:adjustments]).to eq(nil)
|
23
|
+
end
|
24
|
+
it 'returns the correct number of eras' do
|
25
|
+
expect(@era[:checks]['70408535'][:eras].count).to eq(1)
|
26
|
+
end
|
27
|
+
it 'returns the correct number of line items' do
|
28
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items].count).to eq(1)
|
29
|
+
end
|
30
|
+
it 'returns the correct number of adjustment groups' do
|
31
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(1)
|
32
|
+
end
|
33
|
+
end
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
35
|
+
context 'Check #70408535' do
|
36
|
+
it 'returns the check number' do
|
37
|
+
expect(@era[:checks]['70408535'][:check_number]).to eq('70408535')
|
38
|
+
end
|
39
|
+
it 'returns the amount' do
|
40
|
+
expect(@era[:checks]['70408535'][:amount]).to eq(1509646)
|
41
|
+
end
|
42
|
+
it 'returns the number of claims' do
|
43
|
+
expect(@era[:checks]['70408535'][:number_of_claims]).to eq(1)
|
44
|
+
end
|
45
|
+
it 'returns the NPI or Tax ID of payee' do
|
46
|
+
expect(@era[:checks]['70408535'][:npi_tax_id]).to eq('1234567890')
|
47
|
+
end
|
48
|
+
it 'returns the Check payee' do
|
49
|
+
expect(@era[:checks]['70408535'][:payee]).to eq('ACME UNIV HLTH SYS INC')
|
50
|
+
end
|
51
|
+
it 'returns the Payer name' do
|
52
|
+
expect(@era[:checks]['70408535'][:payer_name]).to eq('NC TEACHERS & STATE EMPLOYEES HEALTH PLAN & HEALTH CHOICE')
|
53
|
+
end
|
54
|
+
it 'returns the Payer address' do
|
55
|
+
expect(@era[:checks]['70408535'][:payer_address]).to eq('P O BOX 30025')
|
56
|
+
end
|
57
|
+
it 'returns the Payer city' do
|
58
|
+
expect(@era[:checks]['70408535'][:payer_city]).to eq('DURHAM')
|
59
|
+
end
|
60
|
+
it 'returns the Payer state' do
|
61
|
+
expect(@era[:checks]['70408535'][:payer_state]).to eq('NC')
|
62
|
+
end
|
63
|
+
it 'returns the Payer zip code' do
|
64
|
+
expect(@era[:checks]['70408535'][:payer_zip_code]).to eq('27702')
|
65
|
+
end
|
66
|
+
it 'returns the Payer tax id' do
|
67
|
+
expect(@era[:checks]['70408535'][:payer_tax_id]).to eq('57-14001')
|
68
|
+
end
|
69
|
+
it 'returns the Check date (string mm/dd/yyyy)' do
|
70
|
+
expect(@era[:checks]['70408535'][:date]).to eq('09/23/2010')
|
71
|
+
end
|
72
|
+
context 'ERA #0' do
|
73
|
+
it 'returns the Patient ID' do
|
74
|
+
expect(@era[:checks]['70408535'][:eras][0][:patient_id]).to eq('RUN123456789')
|
75
|
+
end
|
76
|
+
it 'returns the Patient name' do
|
77
|
+
expect(@era[:checks]['70408535'][:eras][0][:patient_name]).to eq('RABBIT,ROGER')
|
78
|
+
end
|
79
|
+
it 'returns the Patient last name (titlized)' do
|
80
|
+
expect(@era[:checks]['70408535'][:eras][0][:patient_last_name]).to eq('Rabbit')
|
81
|
+
end
|
82
|
+
it 'returns the Patient first name (titlized)' do
|
83
|
+
expect(@era[:checks]['70408535'][:eras][0][:patient_first_name]).to eq('Roger')
|
84
|
+
end
|
85
|
+
it 'returns the Total charge amount (integer)' do
|
86
|
+
expect(@era[:checks]['70408535'][:eras][0][:charge_amount]).to eq(374060)
|
87
|
+
end
|
88
|
+
it 'returns the Total payment amount (integer)' do
|
89
|
+
expect(@era[:checks]['70408535'][:eras][0][:payment_amount]).to eq(545104)
|
90
|
+
end
|
91
|
+
it 'returns the Account number' do
|
92
|
+
expect(@era[:checks]['70408535'][:eras][0][:account_number]).to eq('474623UB001CW0321')
|
93
|
+
end
|
94
|
+
it 'returns the Cliam status code' do
|
95
|
+
expect(@era[:checks]['70408535'][:eras][0][:claim_status_code]).to eq('1')
|
96
|
+
end
|
97
|
+
it 'returns the Claim status code description' do
|
98
|
+
expect(@era[:checks]['70408535'][:eras][0][:status]).to eq("PROCESSED AS PRIMARY")
|
99
|
+
end
|
100
|
+
it 'returns the Payer claim control number' do
|
101
|
+
expect(@era[:checks]['70408535'][:eras][0][:payer_claim_control_number]).to eq('80209000000')
|
102
|
+
end
|
103
|
+
it 'returns the Claim statement period start' do
|
104
|
+
expect(@era[:checks]['70408535'][:eras][0][:claim_statement_period_start]).to eq(nil)
|
105
|
+
end
|
106
|
+
it 'returns the Claim statement period end' do
|
107
|
+
expect(@era[:checks]['70408535'][:eras][0][:claim_statement_period_end]).to eq(nil)
|
108
|
+
end
|
109
|
+
|
110
|
+
context 'Line item #0' do
|
111
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
112
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:service_date]).to eq(nil)
|
113
|
+
end
|
114
|
+
it 'returns the CPT code' do
|
115
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:cpt_code]).to eq(nil)
|
116
|
+
end
|
117
|
+
it 'returns the Charge amount (integer)' do
|
118
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:charge_amount]).to eq(nil)
|
119
|
+
end
|
120
|
+
it 'returns the Payment amount (integer)' do
|
121
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:payment_amount]).to eq(nil)
|
122
|
+
end
|
123
|
+
it 'returns the Total adjustment amount (integer)' do
|
124
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(-171044)
|
125
|
+
end
|
126
|
+
it 'returns the Remark code' do
|
127
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:remark_code]).to eq(nil)
|
128
|
+
end
|
129
|
+
it 'returns the Remarks' do
|
130
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:remarks]).to eq(nil)
|
131
|
+
end
|
132
|
+
context 'Adjustment group #0' do
|
133
|
+
it 'returns the Adjustment group' do
|
134
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq("Contractual Obligation")
|
135
|
+
end
|
136
|
+
it 'returns the Adjustment group code' do
|
137
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group_code]).to eq("CO")
|
138
|
+
end
|
139
|
+
it 'returns the Adjustment amount (integer)' do
|
140
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(-171044)
|
141
|
+
end
|
142
|
+
it 'returns the Reason code' do
|
143
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:adjustment_groups][0][:reason_code]).to eq('94')
|
144
|
+
end
|
145
|
+
it 'returns the Translated reason code' do
|
146
|
+
expect(@era[:checks]['70408535'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq("Processed in Excess of charges.")
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
48
152
|
end
|
49
|
-
|
50
|
-
|
153
|
+
|
154
|
+
context 'example_2.835' do
|
155
|
+
before :all do
|
156
|
+
@era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/example_2.835").parse
|
157
|
+
end
|
158
|
+
|
159
|
+
context 'Aggregate totals' do
|
160
|
+
it 'returns the addressed to' do
|
161
|
+
expect(@era[:addressed_to]).to eq(nil)
|
162
|
+
end
|
163
|
+
it 'returns the correct number of checks' do
|
164
|
+
expect(@era[:checks].count).to eq(1)
|
165
|
+
end
|
166
|
+
it 'returns the correct number of adjustments' do
|
167
|
+
expect(@era[:adjustments]).to eq(nil)
|
168
|
+
end
|
169
|
+
it 'returns the correct number of eras' do
|
170
|
+
expect(@era[:checks]['02790758'][:eras].count).to eq(1)
|
171
|
+
end
|
172
|
+
it 'returns the correct number of line items' do
|
173
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items].count).to eq(3)
|
174
|
+
end
|
175
|
+
it 'returns the correct number of adjustment groups' do
|
176
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(2)
|
177
|
+
end
|
178
|
+
it 'returns the correct number of adjustment groups' do
|
179
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups].count).to eq(1)
|
180
|
+
end
|
181
|
+
it 'returns the correct number of adjustment groups' do
|
182
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:adjustment_groups]).to eq(nil)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
context 'Check #70408535' do
|
187
|
+
it 'returns the check number' do
|
188
|
+
expect(@era[:checks]['02790758'][:check_number]).to eq('02790758')
|
189
|
+
end
|
190
|
+
it 'returns the amount' do
|
191
|
+
expect(@era[:checks]['02790758'][:amount]).to eq(192286)
|
192
|
+
end
|
193
|
+
it 'returns the number of claims' do
|
194
|
+
expect(@era[:checks]['02790758'][:number_of_claims]).to eq(1)
|
195
|
+
end
|
196
|
+
it 'returns the NPI or Tax ID of payee' do
|
197
|
+
expect(@era[:checks]['02790758'][:npi_tax_id]).to eq('0987654321')
|
198
|
+
end
|
199
|
+
it 'returns the Check payee' do
|
200
|
+
expect(@era[:checks]['02790758'][:payee]).to eq('XYZ HEALTHCARE CORPORATION')
|
201
|
+
end
|
202
|
+
it 'returns the Payer name' do
|
203
|
+
expect(@era[:checks]['02790758'][:payer_name]).to eq('BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA')
|
204
|
+
end
|
205
|
+
it 'returns the Payer address' do
|
206
|
+
expect(@era[:checks]['02790758'][:payer_address]).to eq('P O BOX 2291')
|
207
|
+
end
|
208
|
+
it 'returns the Payer city' do
|
209
|
+
expect(@era[:checks]['02790758'][:payer_city]).to eq('DURHAM')
|
210
|
+
end
|
211
|
+
it 'returns the Payer state' do
|
212
|
+
expect(@era[:checks]['02790758'][:payer_state]).to eq('NC')
|
213
|
+
end
|
214
|
+
it 'returns the Payer zip code' do
|
215
|
+
expect(@era[:checks]['02790758'][:payer_zip_code]).to eq('27702')
|
216
|
+
end
|
217
|
+
it 'returns the Payer tax id' do
|
218
|
+
expect(@era[:checks]['02790758'][:payer_tax_id]).to eq('60-894904')
|
219
|
+
end
|
220
|
+
it 'returns the Check date (string mm/dd/yyyy)' do
|
221
|
+
expect(@era[:checks]['02790758'][:date]).to eq('01/08/2011')
|
222
|
+
end
|
223
|
+
context 'ERA #0' do
|
224
|
+
it 'returns the Patient ID' do
|
225
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_id]).to eq('YPB123456789001')
|
226
|
+
end
|
227
|
+
it 'returns the Patient name' do
|
228
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
|
229
|
+
end
|
230
|
+
it 'returns the Patient last name (titlized)' do
|
231
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
|
232
|
+
end
|
233
|
+
it 'returns the Patient first name (titlized)' do
|
234
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
|
235
|
+
end
|
236
|
+
it 'returns the Total charge amount (integer)' do
|
237
|
+
expect(@era[:checks]['02790758'][:eras][0][:charge_amount]).to eq(210000)
|
238
|
+
end
|
239
|
+
it 'returns the Total payment amount (integer)' do
|
240
|
+
expect(@era[:checks]['02790758'][:eras][0][:payment_amount]).to eq(192286)
|
241
|
+
end
|
242
|
+
it 'returns the Account number' do
|
243
|
+
expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
|
244
|
+
end
|
245
|
+
it 'returns the Cliam status code' do
|
246
|
+
expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
|
247
|
+
end
|
248
|
+
it 'returns the Claim status code description' do
|
249
|
+
expect(@era[:checks]['02790758'][:eras][0][:status]).to eq("PROCESSED AS PRIMARY")
|
250
|
+
end
|
251
|
+
it 'returns the Payer claim control number' do
|
252
|
+
expect(@era[:checks]['02790758'][:eras][0][:payer_claim_control_number]).to eq('94151100100')
|
253
|
+
end
|
254
|
+
it 'returns the Claim statement period start' do
|
255
|
+
expect(@era[:checks]['02790758'][:eras][0][:claim_statement_period_start]).to eq(nil)
|
256
|
+
end
|
257
|
+
it 'returns the Claim statement period end' do
|
258
|
+
expect(@era[:checks]['02790758'][:eras][0][:claim_statement_period_end]).to eq(nil)
|
259
|
+
end
|
260
|
+
|
261
|
+
context 'Line item #0' do
|
262
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
263
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:service_date]).to eq("12/31/2010")
|
264
|
+
end
|
265
|
+
it 'returns the CPT code' do
|
266
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:cpt_code]).to eq("59430")
|
267
|
+
end
|
268
|
+
it 'returns the Charge amount (integer)' do
|
269
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:charge_amount]).to eq(121000)
|
270
|
+
end
|
271
|
+
it 'returns the Payment amount (integer)' do
|
272
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:payment_amount]).to eq(105786)
|
273
|
+
end
|
274
|
+
it 'returns the Total adjustment amount (integer)' do
|
275
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(15214)
|
276
|
+
end
|
277
|
+
it 'returns the Remark code' do
|
278
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:remark_code]).to eq(nil)
|
279
|
+
end
|
280
|
+
it 'returns the Remarks' do
|
281
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:remarks]).to eq(nil)
|
282
|
+
end
|
283
|
+
context 'Adjustment group #0' do
|
284
|
+
it 'returns the Adjustment group' do
|
285
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq("Contractual Obligation")
|
286
|
+
end
|
287
|
+
it 'returns the Adjustment group code' do
|
288
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group_code]).to eq("CO")
|
289
|
+
end
|
290
|
+
it 'returns the Adjustment amount (integer)' do
|
291
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(3460)
|
292
|
+
end
|
293
|
+
it 'returns the Reason code' do
|
294
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:reason_code]).to eq('42')
|
295
|
+
end
|
296
|
+
it 'returns the Translated reason code' do
|
297
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq("Charges exceed our fee schedule or maximum allowable amount. (Use CARC 45)")
|
298
|
+
end
|
299
|
+
end
|
300
|
+
context 'Adjustment group #1' do
|
301
|
+
it 'returns the Adjustment group' do
|
302
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group]).to eq("Patient Responsibility")
|
303
|
+
end
|
304
|
+
it 'returns the Adjustment group code' do
|
305
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group_code]).to eq("PR")
|
306
|
+
end
|
307
|
+
it 'returns the Adjustment amount (integer)' do
|
308
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_amount]).to eq(11754)
|
309
|
+
end
|
310
|
+
it 'returns the Reason code' do
|
311
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:reason_code]).to eq('2')
|
312
|
+
end
|
313
|
+
it 'returns the Translated reason code' do
|
314
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:translated_reason_code]).to eq("Coinsurance Amount")
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|
318
|
+
context 'Line item #1' do
|
319
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
320
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:service_date]).to eq("12/31/2010")
|
321
|
+
end
|
322
|
+
it 'returns the CPT code' do
|
323
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:cpt_code]).to eq("59440")
|
324
|
+
end
|
325
|
+
it 'returns the Charge amount (integer)' do
|
326
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:charge_amount]).to eq(89000)
|
327
|
+
end
|
328
|
+
it 'returns the Payment amount (integer)' do
|
329
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:payment_amount]).to eq(86500)
|
330
|
+
end
|
331
|
+
it 'returns the Total adjustment amount (integer)' do
|
332
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:total_adjustment_amount]).to eq(2500)
|
333
|
+
end
|
334
|
+
it 'returns the Remark code' do
|
335
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:remark_code]).to eq(nil)
|
336
|
+
end
|
337
|
+
it 'returns the Remarks' do
|
338
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:remarks]).to eq(nil)
|
339
|
+
end
|
340
|
+
context 'Adjustment group #0' do
|
341
|
+
it 'returns the Adjustment group' do
|
342
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group]).to eq("Patient Responsibility")
|
343
|
+
end
|
344
|
+
it 'returns the Adjustment group code' do
|
345
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group_code]).to eq("PR")
|
346
|
+
end
|
347
|
+
it 'returns the Adjustment amount (integer)' do
|
348
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_amount]).to eq(2500)
|
349
|
+
end
|
350
|
+
it 'returns the Reason code' do
|
351
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:reason_code]).to eq('3')
|
352
|
+
end
|
353
|
+
it 'returns the Translated reason code' do
|
354
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:translated_reason_code]).to eq("Co-payment Amount")
|
355
|
+
end
|
356
|
+
end
|
357
|
+
end
|
358
|
+
context 'Line item #2' do
|
359
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
360
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:service_date]).to eq("12/31/2010")
|
361
|
+
end
|
362
|
+
it 'returns the CPT code' do
|
363
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:cpt_code]).to eq("59426")
|
364
|
+
end
|
365
|
+
it 'returns the Charge amount (integer)' do
|
366
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:charge_amount]).to eq(74200)
|
367
|
+
end
|
368
|
+
it 'returns the Payment amount (integer)' do
|
369
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:payment_amount]).to eq(74200)
|
370
|
+
end
|
371
|
+
it 'returns the Total adjustment amount (integer)' do
|
372
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:total_adjustment_amount]).to eq(nil)
|
373
|
+
end
|
374
|
+
it 'returns the Remark code' do
|
375
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:remark_code]).to eq(nil)
|
376
|
+
end
|
377
|
+
it 'returns the Remarks' do
|
378
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:remarks]).to eq(nil)
|
379
|
+
end
|
380
|
+
end
|
381
|
+
end
|
382
|
+
end
|
51
383
|
end
|
52
|
-
|
53
|
-
|
384
|
+
|
385
|
+
context 'example_3.835' do
|
386
|
+
before :all do
|
387
|
+
@era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/example_3.835").parse
|
388
|
+
end
|
389
|
+
|
390
|
+
context 'Aggregate totals' do
|
391
|
+
it 'returns the addressed to' do
|
392
|
+
expect(@era[:addressed_to]).to eq(nil)
|
393
|
+
end
|
394
|
+
it 'returns the correct number of checks' do
|
395
|
+
expect(@era[:checks].count).to eq(1)
|
396
|
+
end
|
397
|
+
it 'returns the correct number of adjustments' do
|
398
|
+
expect(@era[:adjustments]).to eq(nil)
|
399
|
+
end
|
400
|
+
it 'returns the correct number of eras' do
|
401
|
+
expect(@era[:checks]['02790758'][:eras].count).to eq(1)
|
402
|
+
end
|
403
|
+
it 'returns the correct number of line items' do
|
404
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items].count).to eq(3)
|
405
|
+
end
|
406
|
+
it 'returns the correct number of adjustment groups' do
|
407
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(2)
|
408
|
+
end
|
409
|
+
it 'returns the correct number of adjustment groups' do
|
410
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups].count).to eq(1)
|
411
|
+
end
|
412
|
+
it 'returns the correct number of adjustment groups' do
|
413
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:adjustment_groups]).to eq(nil)
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
context 'Check #70408535' do
|
418
|
+
it 'returns the check number' do
|
419
|
+
expect(@era[:checks]['02790758'][:check_number]).to eq('02790758')
|
420
|
+
end
|
421
|
+
it 'returns the amount' do
|
422
|
+
expect(@era[:checks]['02790758'][:amount]).to eq(192286)
|
423
|
+
end
|
424
|
+
it 'returns the number of claims' do
|
425
|
+
expect(@era[:checks]['02790758'][:number_of_claims]).to eq(1)
|
426
|
+
end
|
427
|
+
it 'returns the NPI or Tax ID of payee' do
|
428
|
+
expect(@era[:checks]['02790758'][:npi_tax_id]).to eq('0987654321')
|
429
|
+
end
|
430
|
+
it 'returns the Check payee' do
|
431
|
+
expect(@era[:checks]['02790758'][:payee]).to eq('XYZ HEALTHCARE CORPORATION')
|
432
|
+
end
|
433
|
+
it 'returns the Payer name' do
|
434
|
+
expect(@era[:checks]['02790758'][:payer_name]).to eq('BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA')
|
435
|
+
end
|
436
|
+
it 'returns the Payer address' do
|
437
|
+
expect(@era[:checks]['02790758'][:payer_address]).to eq('P O BOX 2291')
|
438
|
+
end
|
439
|
+
it 'returns the Payer city' do
|
440
|
+
expect(@era[:checks]['02790758'][:payer_city]).to eq('DURHAM')
|
441
|
+
end
|
442
|
+
it 'returns the Payer state' do
|
443
|
+
expect(@era[:checks]['02790758'][:payer_state]).to eq('NC')
|
444
|
+
end
|
445
|
+
it 'returns the Payer zip code' do
|
446
|
+
expect(@era[:checks]['02790758'][:payer_zip_code]).to eq('27702')
|
447
|
+
end
|
448
|
+
it 'returns the Payer tax id' do
|
449
|
+
expect(@era[:checks]['02790758'][:payer_tax_id]).to eq('60-894904')
|
450
|
+
end
|
451
|
+
it 'returns the Check date (string mm/dd/yyyy)' do
|
452
|
+
expect(@era[:checks]['02790758'][:date]).to eq('01/08/2011')
|
453
|
+
end
|
454
|
+
context 'ERA #0' do
|
455
|
+
it 'returns the Patient ID' do
|
456
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_id]).to eq('YPB123456789001')
|
457
|
+
end
|
458
|
+
it 'returns the Patient name' do
|
459
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
|
460
|
+
end
|
461
|
+
it 'returns the Patient last name (titlized)' do
|
462
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
|
463
|
+
end
|
464
|
+
it 'returns the Patient first name (titlized)' do
|
465
|
+
expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
|
466
|
+
end
|
467
|
+
it 'returns the Total charge amount (integer)' do
|
468
|
+
expect(@era[:checks]['02790758'][:eras][0][:charge_amount]).to eq(210000)
|
469
|
+
end
|
470
|
+
it 'returns the Total payment amount (integer)' do
|
471
|
+
expect(@era[:checks]['02790758'][:eras][0][:payment_amount]).to eq(192286)
|
472
|
+
end
|
473
|
+
it 'returns the Account number' do
|
474
|
+
expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
|
475
|
+
end
|
476
|
+
it 'returns the Cliam status code' do
|
477
|
+
expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
|
478
|
+
end
|
479
|
+
it 'returns the Claim status code description' do
|
480
|
+
expect(@era[:checks]['02790758'][:eras][0][:status]).to eq("PROCESSED AS PRIMARY")
|
481
|
+
end
|
482
|
+
it 'returns the Payer claim control number' do
|
483
|
+
expect(@era[:checks]['02790758'][:eras][0][:payer_claim_control_number]).to eq('94151100100')
|
484
|
+
end
|
485
|
+
it 'returns the Claim statement period start' do
|
486
|
+
expect(@era[:checks]['02790758'][:eras][0][:claim_statement_period_start]).to eq(nil)
|
487
|
+
end
|
488
|
+
it 'returns the Claim statement period end' do
|
489
|
+
expect(@era[:checks]['02790758'][:eras][0][:claim_statement_period_end]).to eq(nil)
|
490
|
+
end
|
491
|
+
|
492
|
+
context 'Line item #0' do
|
493
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
494
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:service_date]).to eq("12/31/2010")
|
495
|
+
end
|
496
|
+
it 'returns the CPT code' do
|
497
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:cpt_code]).to eq("59430")
|
498
|
+
end
|
499
|
+
it 'returns the Charge amount (integer)' do
|
500
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:charge_amount]).to eq(121000)
|
501
|
+
end
|
502
|
+
it 'returns the Payment amount (integer)' do
|
503
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:payment_amount]).to eq(105786)
|
504
|
+
end
|
505
|
+
it 'returns the Total adjustment amount (integer)' do
|
506
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(15214)
|
507
|
+
end
|
508
|
+
it 'returns the Remark code' do
|
509
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:remark_code]).to eq(nil)
|
510
|
+
end
|
511
|
+
it 'returns the Remarks' do
|
512
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:remarks]).to eq(nil)
|
513
|
+
end
|
514
|
+
context 'Adjustment group #0' do
|
515
|
+
it 'returns the Adjustment group' do
|
516
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq("Contractual Obligation")
|
517
|
+
end
|
518
|
+
it 'returns the Adjustment group code' do
|
519
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group_code]).to eq("CO")
|
520
|
+
end
|
521
|
+
it 'returns the Adjustment amount (integer)' do
|
522
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(3460)
|
523
|
+
end
|
524
|
+
it 'returns the Reason code' do
|
525
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:reason_code]).to eq('42')
|
526
|
+
end
|
527
|
+
it 'returns the Translated reason code' do
|
528
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq("Charges exceed our fee schedule or maximum allowable amount. (Use CARC 45)")
|
529
|
+
end
|
530
|
+
end
|
531
|
+
context 'Adjustment group #1' do
|
532
|
+
it 'returns the Adjustment group' do
|
533
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group]).to eq("Patient Responsibility")
|
534
|
+
end
|
535
|
+
it 'returns the Adjustment group code' do
|
536
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group_code]).to eq("PR")
|
537
|
+
end
|
538
|
+
it 'returns the Adjustment amount (integer)' do
|
539
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_amount]).to eq(11754)
|
540
|
+
end
|
541
|
+
it 'returns the Reason code' do
|
542
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:reason_code]).to eq('2')
|
543
|
+
end
|
544
|
+
it 'returns the Translated reason code' do
|
545
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][0][:adjustment_groups][1][:translated_reason_code]).to eq("Coinsurance Amount")
|
546
|
+
end
|
547
|
+
end
|
548
|
+
end
|
549
|
+
context 'Line item #1' do
|
550
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
551
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:service_date]).to eq("12/31/2010")
|
552
|
+
end
|
553
|
+
it 'returns the CPT code' do
|
554
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:cpt_code]).to eq("59440")
|
555
|
+
end
|
556
|
+
it 'returns the Charge amount (integer)' do
|
557
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:charge_amount]).to eq(89000)
|
558
|
+
end
|
559
|
+
it 'returns the Payment amount (integer)' do
|
560
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:payment_amount]).to eq(86500)
|
561
|
+
end
|
562
|
+
it 'returns the Total adjustment amount (integer)' do
|
563
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:total_adjustment_amount]).to eq(2500)
|
564
|
+
end
|
565
|
+
it 'returns the Remark code' do
|
566
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:remark_code]).to eq(nil)
|
567
|
+
end
|
568
|
+
it 'returns the Remarks' do
|
569
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:remarks]).to eq(nil)
|
570
|
+
end
|
571
|
+
context 'Adjustment group #0' do
|
572
|
+
it 'returns the Adjustment group' do
|
573
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group]).to eq("Patient Responsibility")
|
574
|
+
end
|
575
|
+
it 'returns the Adjustment group code' do
|
576
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group_code]).to eq("PR")
|
577
|
+
end
|
578
|
+
it 'returns the Adjustment amount (integer)' do
|
579
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_amount]).to eq(2500)
|
580
|
+
end
|
581
|
+
it 'returns the Reason code' do
|
582
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:reason_code]).to eq('3')
|
583
|
+
end
|
584
|
+
it 'returns the Translated reason code' do
|
585
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][1][:adjustment_groups][0][:translated_reason_code]).to eq("Co-payment Amount")
|
586
|
+
end
|
587
|
+
end
|
588
|
+
end
|
589
|
+
context 'Line item #2' do
|
590
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
591
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:service_date]).to eq("12/31/2010")
|
592
|
+
end
|
593
|
+
it 'returns the CPT code' do
|
594
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:cpt_code]).to eq("59426")
|
595
|
+
end
|
596
|
+
it 'returns the Charge amount (integer)' do
|
597
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:charge_amount]).to eq(74200)
|
598
|
+
end
|
599
|
+
it 'returns the Payment amount (integer)' do
|
600
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:payment_amount]).to eq(74200)
|
601
|
+
end
|
602
|
+
it 'returns the Total adjustment amount (integer)' do
|
603
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:total_adjustment_amount]).to eq(nil)
|
604
|
+
end
|
605
|
+
it 'returns the Remark code' do
|
606
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:remark_code]).to eq(nil)
|
607
|
+
end
|
608
|
+
it 'returns the Remarks' do
|
609
|
+
expect(@era[:checks]['02790758'][:eras][0][:line_items][2][:remarks]).to eq(nil)
|
610
|
+
end
|
611
|
+
end
|
612
|
+
end
|
613
|
+
end
|
54
614
|
end
|
55
615
|
end
|
56
616
|
|
57
|
-
context '
|
58
|
-
|
59
|
-
|
60
|
-
end
|
61
|
-
it 'returns the amount' do
|
62
|
-
expect(@era[:checks]['201812215555555555'][:amount]).to eq(4880)
|
63
|
-
end
|
64
|
-
it 'returns the number of claims' do
|
65
|
-
expect(@era[:checks]['201812215555555555'][:number_of_claims]).to eq(1)
|
66
|
-
end
|
67
|
-
it 'returns the NPI or Tax ID' do
|
68
|
-
expect(@era[:checks]['201812215555555555'][:npi_tax_id]).to eq('1212121212')
|
69
|
-
end
|
70
|
-
it 'returns the payee' do
|
71
|
-
expect(@era[:checks]['201812215555555555'][:payee]).to eq('ABC COMPANY LLC')
|
72
|
-
end
|
73
|
-
it 'returns the date' do
|
74
|
-
expect(@era[:checks]['201812215555555555'][:date]).to eq('12/21/2018')
|
617
|
+
context 'Human readable' do
|
618
|
+
before :all do
|
619
|
+
@era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/test_era.txt").parse
|
75
620
|
end
|
76
621
|
|
77
|
-
context '
|
78
|
-
it 'returns the
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
Payer Claim Control Number: 111111111000
|
622
|
+
context 'Aggregate totals' do
|
623
|
+
it 'returns the addressed to' do
|
624
|
+
expect(@era[:addressed_to]).to eq('Jane Doe')
|
625
|
+
end
|
626
|
+
it 'returns the correct number of checks' do
|
627
|
+
expect(@era[:checks].count).to eq(3)
|
628
|
+
end
|
629
|
+
it 'returns the correct number of adjustments' do
|
630
|
+
expect(@era[:adjustments].count).to eq(3)
|
631
|
+
end
|
88
632
|
|
89
|
-
|
90
|
-
|
633
|
+
it 'returns the correct number of line items' do
|
634
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items].count).to eq(1)
|
635
|
+
end
|
636
|
+
it 'returns the correct number of line items' do
|
637
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items].count).to eq(2)
|
638
|
+
end
|
639
|
+
it 'returns the correct number of line items' do
|
640
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items].count).to eq(1)
|
641
|
+
end
|
642
|
+
it 'returns the correct number of line items' do
|
643
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items].count).to eq(1)
|
644
|
+
end
|
645
|
+
it 'returns the correct number of line items' do
|
646
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items].count).to eq(1)
|
647
|
+
end
|
91
648
|
|
92
|
-
|
93
|
-
|
94
|
-
EOF
|
95
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:era_text]).to eq(text.strip)
|
649
|
+
it 'returns the correct number of adjustment groups' do
|
650
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(1)
|
96
651
|
end
|
97
|
-
it 'returns the
|
98
|
-
expect(@era[:checks]['
|
652
|
+
it 'returns the correct number of adjustment groups' do
|
653
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(1)
|
99
654
|
end
|
100
|
-
it 'returns the
|
101
|
-
expect(@era[:checks]['
|
655
|
+
it 'returns the correct number of adjustment groups' do
|
656
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:adjustment_groups].count).to eq(1)
|
102
657
|
end
|
103
|
-
it 'returns the
|
104
|
-
expect(@era[:checks]['
|
658
|
+
it 'returns the correct number of adjustment groups' do
|
659
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:adjustment_groups]).to eq(nil)
|
105
660
|
end
|
106
|
-
it 'returns the
|
107
|
-
expect(@era[:checks]['
|
661
|
+
it 'returns the correct number of adjustment groups' do
|
662
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(1)
|
108
663
|
end
|
109
|
-
it 'returns the
|
110
|
-
expect(@era[:checks]['
|
664
|
+
it 'returns the correct number of adjustment groups' do
|
665
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups].count).to eq(2)
|
111
666
|
end
|
112
|
-
|
113
|
-
|
667
|
+
end
|
668
|
+
|
669
|
+
context 'Check #201812215555555555' do
|
670
|
+
it 'returns the check number' do
|
671
|
+
expect(@era[:checks]['201812215555555555'][:check_number]).to eq('201812215555555555')
|
672
|
+
end
|
673
|
+
it 'returns the amount' do
|
674
|
+
expect(@era[:checks]['201812215555555555'][:amount]).to eq(4880)
|
675
|
+
end
|
676
|
+
it 'returns the number of claims' do
|
677
|
+
expect(@era[:checks]['201812215555555555'][:number_of_claims]).to eq(1)
|
114
678
|
end
|
115
|
-
it 'returns the
|
116
|
-
expect(@era[:checks]['201812215555555555'][:
|
679
|
+
it 'returns the NPI or Tax ID' do
|
680
|
+
expect(@era[:checks]['201812215555555555'][:npi_tax_id]).to eq('1212121212')
|
117
681
|
end
|
118
|
-
it 'returns the
|
119
|
-
expect(@era[:checks]['201812215555555555'][:
|
682
|
+
it 'returns the payee' do
|
683
|
+
expect(@era[:checks]['201812215555555555'][:payee]).to eq('ABC COMPANY LLC')
|
120
684
|
end
|
121
685
|
it 'returns the Payer name' do
|
122
|
-
expect(@era[:checks]['201812215555555555'][:
|
686
|
+
expect(@era[:checks]['201812215555555555'][:payer_name]).to eq('ABC HEALTHCARE EAST')
|
123
687
|
end
|
124
688
|
it 'returns the Payer address' do
|
125
|
-
expect(@era[:checks]['201812215555555555'][:
|
689
|
+
expect(@era[:checks]['201812215555555555'][:payer_address]).to eq('SERVICE CENTER PO BOX 12234')
|
126
690
|
end
|
127
691
|
it 'returns the Payer city' do
|
128
|
-
expect(@era[:checks]['201812215555555555'][:
|
692
|
+
expect(@era[:checks]['201812215555555555'][:payer_city]).to eq('SOMEWHERE')
|
129
693
|
end
|
130
694
|
it 'returns the Payer state' do
|
131
|
-
expect(@era[:checks]['201812215555555555'][:
|
695
|
+
expect(@era[:checks]['201812215555555555'][:payer_state]).to eq('GA')
|
132
696
|
end
|
133
697
|
it 'returns the Payer zip code' do
|
134
|
-
expect(@era[:checks]['201812215555555555'][:
|
698
|
+
expect(@era[:checks]['201812215555555555'][:payer_zip_code]).to eq('11111')
|
135
699
|
end
|
136
700
|
it 'returns the Payer tax id' do
|
137
|
-
expect(@era[:checks]['201812215555555555'][:
|
701
|
+
expect(@era[:checks]['201812215555555555'][:payer_tax_id]).to eq('11-1111110')
|
138
702
|
end
|
139
|
-
it 'returns the
|
140
|
-
expect(@era[:checks]['201812215555555555'][:
|
141
|
-
end
|
142
|
-
it 'returns the Claim statement period start' do
|
143
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:claim_statement_period_start]).to eq(nil)
|
144
|
-
end
|
145
|
-
it 'returns the Claim statement period end' do
|
146
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:claim_statement_period_end]).to eq(nil)
|
703
|
+
it 'returns the date' do
|
704
|
+
expect(@era[:checks]['201812215555555555'][:date]).to eq('12/21/2018')
|
147
705
|
end
|
148
706
|
|
149
|
-
context '
|
150
|
-
it 'returns the
|
151
|
-
|
707
|
+
context 'ERA #0' do
|
708
|
+
it 'returns the ERA text' do
|
709
|
+
text = <<-EOF
|
710
|
+
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
711
|
+
Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
|
712
|
+
201812215555555555 M11111110 DOE JR,DAVIS 65.00 48.80 1112 PROCESSED AS PRIMARY ABC HEALTHCARE EAST
|
713
|
+
SERVICE CENTER
|
714
|
+
PO BOX 12234
|
715
|
+
SOMEWHERE,GA 11111
|
716
|
+
Tax ID: 11-1111110
|
717
|
+
Payer Claim Control Number: 111111111000
|
718
|
+
|
719
|
+
Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
|
720
|
+
10/25/2018 92507 65.00 48.80 16.20 NO REMARKS
|
721
|
+
|
722
|
+
Adjustment Group Adj Amt Translated Reason Code
|
723
|
+
CONTRACTUAL OBLIGATIONS 16.20 CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.
|
724
|
+
EOF
|
725
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:era_text]).to eq(text.strip)
|
726
|
+
end
|
727
|
+
it 'returns the Patient ID' do
|
728
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:patient_id]).to eq('M11111110')
|
729
|
+
end
|
730
|
+
it 'returns the Patient name' do
|
731
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:patient_name]).to eq('DOE JR,DAVIS')
|
732
|
+
end
|
733
|
+
it 'returns the Patient last name (titlized)' do
|
734
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:patient_last_name]).to eq('Doe Jr')
|
735
|
+
end
|
736
|
+
it 'returns the Patient first name (titlized)' do
|
737
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:patient_first_name]).to eq('Davis')
|
738
|
+
end
|
739
|
+
it 'returns the Total charge amount (integer)' do
|
740
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:charge_amount]).to eq(6500)
|
741
|
+
end
|
742
|
+
it 'returns the Total payment amount (integer)' do
|
743
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:payment_amount]).to eq(4880)
|
152
744
|
end
|
153
|
-
it 'returns the
|
154
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:
|
745
|
+
it 'returns the Account number' do
|
746
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:account_number]).to eq('1112')
|
155
747
|
end
|
156
|
-
it 'returns the
|
157
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:
|
748
|
+
it 'returns the Status' do
|
749
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:status]).to eq('PROCESSED AS PRIMARY')
|
158
750
|
end
|
159
|
-
it 'returns the
|
160
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:
|
751
|
+
it 'returns the Payer claim control number' do
|
752
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:payer_claim_control_number]).to eq('111111111000')
|
161
753
|
end
|
162
|
-
it 'returns the
|
163
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:
|
754
|
+
it 'returns the Claim statement period start' do
|
755
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:claim_statement_period_start]).to eq(nil)
|
164
756
|
end
|
165
|
-
it 'returns the
|
166
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:
|
757
|
+
it 'returns the Claim statement period end' do
|
758
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:claim_statement_period_end]).to eq(nil)
|
167
759
|
end
|
168
|
-
|
169
|
-
|
170
|
-
|
760
|
+
|
761
|
+
context 'Line item #0' do
|
762
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
763
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:service_date]).to eq('10/25/2018')
|
764
|
+
end
|
765
|
+
it 'returns the CPT code' do
|
766
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:cpt_code]).to eq('92507')
|
767
|
+
end
|
768
|
+
it 'returns the Charge amount (integer)' do
|
769
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:charge_amount]).to eq(6500)
|
171
770
|
end
|
172
|
-
it 'returns the
|
173
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:
|
771
|
+
it 'returns the Payment amount (integer)' do
|
772
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:payment_amount]).to eq(4880)
|
174
773
|
end
|
175
|
-
it 'returns the
|
176
|
-
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:
|
774
|
+
it 'returns the Total adjustment amount (integer)' do
|
775
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(1620)
|
776
|
+
end
|
777
|
+
it 'returns the Remarks' do
|
778
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:remarks]).to eq('NO REMARKS')
|
779
|
+
end
|
780
|
+
context 'Adjustment group #0' do
|
781
|
+
it 'returns the Adjustment group' do
|
782
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq('CONTRACTUAL OBLIGATIONS')
|
783
|
+
end
|
784
|
+
it 'returns the Adjustment amount (integer)' do
|
785
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(1620)
|
786
|
+
end
|
787
|
+
it 'returns the Translated reason code' do
|
788
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq('CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.')
|
789
|
+
end
|
177
790
|
end
|
178
791
|
end
|
179
792
|
end
|
180
793
|
end
|
181
|
-
end
|
182
794
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
795
|
+
context 'Check #201812215555555556' do
|
796
|
+
it 'returns the check number' do
|
797
|
+
expect(@era[:checks]['201812215555555556'][:check_number]).to eq('201812215555555556')
|
798
|
+
end
|
799
|
+
it 'returns the amount' do
|
800
|
+
expect(@era[:checks]['201812215555555556'][:amount]).to eq(5120)
|
801
|
+
end
|
802
|
+
it 'returns the number of claims' do
|
803
|
+
expect(@era[:checks]['201812215555555556'][:number_of_claims]).to eq(2)
|
804
|
+
end
|
805
|
+
it 'returns the NPI or Tax ID' do
|
806
|
+
expect(@era[:checks]['201812215555555556'][:npi_tax_id]).to eq('1212121213')
|
807
|
+
end
|
808
|
+
it 'returns the payee' do
|
809
|
+
expect(@era[:checks]['201812215555555556'][:payee]).to eq('ABC COMPANY')
|
810
|
+
end
|
811
|
+
it 'returns the Payer name' do
|
812
|
+
expect(@era[:checks]['201812215555555556'][:payer_name]).to eq('ABC HEALTHCARE WEST')
|
813
|
+
end
|
814
|
+
it 'returns the Payer address' do
|
815
|
+
expect(@era[:checks]['201812215555555556'][:payer_address]).to eq('50 EAST RD')
|
816
|
+
end
|
817
|
+
it 'returns the Payer city' do
|
818
|
+
expect(@era[:checks]['201812215555555556'][:payer_city]).to eq('ANYWHERE')
|
819
|
+
end
|
820
|
+
it 'returns the Payer state' do
|
821
|
+
expect(@era[:checks]['201812215555555556'][:payer_state]).to eq('TN')
|
822
|
+
end
|
823
|
+
it 'returns the Payer zip code' do
|
824
|
+
expect(@era[:checks]['201812215555555556'][:payer_zip_code]).to eq('00002-1111')
|
825
|
+
end
|
826
|
+
it 'returns the Payer tax id' do
|
827
|
+
expect(@era[:checks]['201812215555555556'][:payer_tax_id]).to eq('11-1111111')
|
828
|
+
end
|
829
|
+
it 'returns the date' do
|
830
|
+
expect(@era[:checks]['201812215555555556'][:date]).to eq('12/22/2018')
|
831
|
+
end
|
202
832
|
|
203
|
-
|
204
|
-
|
205
|
-
|
833
|
+
context 'ERA #0' do
|
834
|
+
it 'returns the ERA text' do
|
835
|
+
text = <<-EOF
|
206
836
|
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
207
837
|
Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
|
208
838
|
201812215555555556 ZECM11111111 DOE,JANE -65.00 -48.80 L111 OTHER ABC HEALTHCARE WEST
|
@@ -222,240 +852,222 @@ Check# Patient ID Last,First Charge Amt
|
|
222
852
|
|
223
853
|
Adjustment Group Adj Amt Translated Reason Code
|
224
854
|
OTHER ADJUSTMENTS -5.00 PAYMENT ADJUSTED BECAUSE CHARGES HAVE BEEN PAID BY ANOTHER PAYER.
|
225
|
-
|
226
|
-
|
227
|
-
end
|
228
|
-
it 'returns the Patient ID' do
|
229
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_id]).to eq('ZECM11111111')
|
230
|
-
end
|
231
|
-
it 'returns the Patient name' do
|
232
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_name]).to eq('DOE,JANE')
|
233
|
-
end
|
234
|
-
it 'returns the Patient last name (titlized)' do
|
235
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_last_name]).to eq('Doe')
|
236
|
-
end
|
237
|
-
it 'returns the Patient first name (titlized)' do
|
238
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_first_name]).to eq('Jane')
|
239
|
-
end
|
240
|
-
it 'returns the Total charge amount (integer)' do
|
241
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:charge_amount]).to eq(-6500)
|
242
|
-
end
|
243
|
-
it 'returns the Total payment amount (integer)' do
|
244
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payment_amount]).to eq(-4880)
|
245
|
-
end
|
246
|
-
it 'returns the Account number' do
|
247
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:account_number]).to eq('L111')
|
248
|
-
end
|
249
|
-
it 'returns the Status' do
|
250
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:status]).to eq('OTHER')
|
251
|
-
end
|
252
|
-
it 'returns the Payer name' do
|
253
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_name]).to eq('ABC HEALTHCARE WEST')
|
254
|
-
end
|
255
|
-
it 'returns the Payer address' do
|
256
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_address]).to eq('50 EAST RD')
|
257
|
-
end
|
258
|
-
it 'returns the Payer city' do
|
259
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_city]).to eq('ANYWHERE')
|
260
|
-
end
|
261
|
-
it 'returns the Payer state' do
|
262
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_state]).to eq('TN')
|
263
|
-
end
|
264
|
-
it 'returns the Payer zip code' do
|
265
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_zip_code]).to eq('00002-1111')
|
266
|
-
end
|
267
|
-
it 'returns the Payer tax id' do
|
268
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_tax_id]).to eq('11-1111111')
|
269
|
-
end
|
270
|
-
it 'returns the Payer claim control number' do
|
271
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_claim_control_number]).to eq('BTBBB1111100')
|
272
|
-
end
|
273
|
-
it 'returns the Claim statement period start' do
|
274
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:claim_statement_period_start]).to eq(nil)
|
275
|
-
end
|
276
|
-
it 'returns the Claim statement period end' do
|
277
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:claim_statement_period_end]).to eq(nil)
|
278
|
-
end
|
279
|
-
|
280
|
-
context 'Line item #0' do
|
281
|
-
it 'returns the Date of service (string mm/dd/yyyy)' do
|
282
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:service_date]).to eq('10/27/2017')
|
855
|
+
EOF
|
856
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:era_text]).to eq(text.strip)
|
283
857
|
end
|
284
|
-
it 'returns the
|
285
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
858
|
+
it 'returns the Patient ID' do
|
859
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_id]).to eq('ZECM11111111')
|
286
860
|
end
|
287
|
-
it 'returns the
|
288
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
861
|
+
it 'returns the Patient name' do
|
862
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_name]).to eq('DOE,JANE')
|
289
863
|
end
|
290
|
-
it 'returns the
|
291
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
864
|
+
it 'returns the Patient last name (titlized)' do
|
865
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_last_name]).to eq('Doe')
|
292
866
|
end
|
293
|
-
it 'returns the
|
294
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
867
|
+
it 'returns the Patient first name (titlized)' do
|
868
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_first_name]).to eq('Jane')
|
295
869
|
end
|
296
|
-
it 'returns the
|
297
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
870
|
+
it 'returns the Total charge amount (integer)' do
|
871
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:charge_amount]).to eq(-6500)
|
298
872
|
end
|
299
|
-
|
300
|
-
|
301
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq('OTHER ADJUSTMENTS')
|
302
|
-
end
|
303
|
-
it 'returns the Adjustment amount (integer)' do
|
304
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(-1620)
|
305
|
-
end
|
306
|
-
it 'returns the Translated reason code' do
|
307
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq('CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.')
|
308
|
-
end
|
873
|
+
it 'returns the Total payment amount (integer)' do
|
874
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:payment_amount]).to eq(-4880)
|
309
875
|
end
|
310
|
-
|
311
|
-
|
312
|
-
context 'Line item #1' do
|
313
|
-
it 'returns the Date of service (string mm/dd/yyyy)' do
|
314
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:service_date]).to eq('11/09/2017')
|
876
|
+
it 'returns the Account number' do
|
877
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:account_number]).to eq('L111')
|
315
878
|
end
|
316
|
-
it 'returns the
|
317
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
879
|
+
it 'returns the Status' do
|
880
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:status]).to eq('OTHER')
|
318
881
|
end
|
319
|
-
it 'returns the
|
320
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
882
|
+
it 'returns the Payer claim control number' do
|
883
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:payer_claim_control_number]).to eq('BTBBB1111100')
|
321
884
|
end
|
322
|
-
it 'returns the
|
323
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
885
|
+
it 'returns the Claim statement period start' do
|
886
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:claim_statement_period_start]).to eq(nil)
|
324
887
|
end
|
325
|
-
it 'returns the
|
326
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:
|
888
|
+
it 'returns the Claim statement period end' do
|
889
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:claim_statement_period_end]).to eq(nil)
|
327
890
|
end
|
328
|
-
|
329
|
-
|
891
|
+
|
892
|
+
context 'Line item #0' do
|
893
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
894
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:service_date]).to eq('10/27/2017')
|
895
|
+
end
|
896
|
+
it 'returns the CPT code' do
|
897
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:cpt_code]).to eq('92507')
|
898
|
+
end
|
899
|
+
it 'returns the Charge amount (integer)' do
|
900
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:charge_amount]).to eq(-6500)
|
901
|
+
end
|
902
|
+
it 'returns the Payment amount (integer)' do
|
903
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:payment_amount]).to eq(-4880)
|
904
|
+
end
|
905
|
+
it 'returns the Total adjustment amount (integer)' do
|
906
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(-1620)
|
907
|
+
end
|
908
|
+
it 'returns the Remarks' do
|
909
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:remarks]).to eq('NO REMARKS')
|
910
|
+
end
|
911
|
+
context 'Adjustment group #0' do
|
912
|
+
it 'returns the Adjustment group' do
|
913
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq('OTHER ADJUSTMENTS')
|
914
|
+
end
|
915
|
+
it 'returns the Adjustment amount (integer)' do
|
916
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(-1620)
|
917
|
+
end
|
918
|
+
it 'returns the Translated reason code' do
|
919
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq('CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.')
|
920
|
+
end
|
921
|
+
end
|
330
922
|
end
|
331
|
-
|
332
|
-
|
333
|
-
|
923
|
+
|
924
|
+
context 'Line item #1' do
|
925
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
926
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:service_date]).to eq('11/09/2017')
|
334
927
|
end
|
335
|
-
it 'returns the
|
336
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:
|
928
|
+
it 'returns the CPT code' do
|
929
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:cpt_code]).to eq('92507')
|
337
930
|
end
|
338
|
-
it 'returns the
|
339
|
-
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:
|
931
|
+
it 'returns the Charge amount (integer)' do
|
932
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:charge_amount]).to eq(-500)
|
933
|
+
end
|
934
|
+
it 'returns the Payment amount (integer)' do
|
935
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:payment_amount]).to eq(0)
|
936
|
+
end
|
937
|
+
it 'returns the Total adjustment amount (integer)' do
|
938
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:total_adjustment_amount]).to eq(-500)
|
939
|
+
end
|
940
|
+
it 'returns the Remarks' do
|
941
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:remarks]).to eq('NO REMARKS')
|
942
|
+
end
|
943
|
+
context 'Adjustment group #0' do
|
944
|
+
it 'returns the Adjustment group' do
|
945
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group]).to eq('OTHER ADJUSTMENTS')
|
946
|
+
end
|
947
|
+
it 'returns the Adjustment amount (integer)' do
|
948
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_amount]).to eq(-500)
|
949
|
+
end
|
950
|
+
it 'returns the Translated reason code' do
|
951
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:adjustment_groups][0][:translated_reason_code]).to eq('PAYMENT ADJUSTED BECAUSE CHARGES HAVE BEEN PAID BY ANOTHER PAYER.')
|
952
|
+
end
|
340
953
|
end
|
341
954
|
end
|
342
955
|
end
|
343
|
-
end
|
344
956
|
|
345
|
-
|
346
|
-
|
347
|
-
|
957
|
+
context 'ERA #1' do
|
958
|
+
it 'returns the ERA text' do
|
959
|
+
text = <<-EOF
|
348
960
|
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
349
961
|
Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
|
350
962
|
201812215555555556 ZECM11111112 SMITH,JOSEPH 100.00 100.00 M111 PROCESSED AS SECONDARY ABC HEALTHCARE WEST
|
351
963
|
50 EAST RD
|
352
|
-
ANYWHERE,TN 00002
|
964
|
+
ANYWHERE,TN 00002-1111
|
353
965
|
Tax ID: 11-1111111
|
354
966
|
Payer Claim Control Number: BT1111111141
|
355
967
|
|
356
968
|
Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
|
357
969
|
10/25/2017 92507 100.00 100.00 0.00 NO REMARKS
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
970
|
+
EOF
|
971
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:era_text]).to eq(text.strip)
|
972
|
+
end
|
973
|
+
it 'returns the Patient ID' do
|
974
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:patient_id]).to eq('ZECM11111112')
|
975
|
+
end
|
976
|
+
it 'returns the Patient name' do
|
977
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:patient_name]).to eq('SMITH,JOSEPH')
|
978
|
+
end
|
979
|
+
it 'returns the Patient last name (titlized)' do
|
980
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:patient_last_name]).to eq('Smith')
|
981
|
+
end
|
982
|
+
it 'returns the Patient first name (titlized)' do
|
983
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:patient_first_name]).to eq('Joseph')
|
984
|
+
end
|
985
|
+
it 'returns the Total charge amount (integer)' do
|
986
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:charge_amount]).to eq(10000)
|
987
|
+
end
|
988
|
+
it 'returns the Total payment amount (integer)' do
|
989
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:payment_amount]).to eq(10000)
|
990
|
+
end
|
991
|
+
it 'returns the Account number' do
|
992
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:account_number]).to eq('M111')
|
993
|
+
end
|
994
|
+
it 'returns the Status' do
|
995
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:status]).to eq('PROCESSED AS SECONDARY')
|
996
|
+
end
|
997
|
+
it 'returns the Payer claim control number' do
|
998
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:payer_claim_control_number]).to eq('BT1111111141')
|
999
|
+
end
|
1000
|
+
it 'returns the Claim statement period start' do
|
1001
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:claim_statement_period_start]).to eq(nil)
|
1002
|
+
end
|
1003
|
+
it 'returns the Claim statement period end' do
|
1004
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:claim_statement_period_end]).to eq(nil)
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
context 'Line item #0' do
|
1008
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
1009
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:service_date]).to eq('10/25/2017')
|
1010
|
+
end
|
1011
|
+
it 'returns the CPT code' do
|
1012
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:cpt_code]).to eq('92507')
|
1013
|
+
end
|
1014
|
+
it 'returns the Charge amount (integer)' do
|
1015
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:charge_amount]).to eq(10000)
|
1016
|
+
end
|
1017
|
+
it 'returns the Payment amount (integer)' do
|
1018
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:payment_amount]).to eq(10000)
|
1019
|
+
end
|
1020
|
+
it 'returns the Total adjustment amount (integer)' do
|
1021
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:total_adjustment_amount]).to eq(0)
|
1022
|
+
end
|
1023
|
+
it 'returns the Remarks' do
|
1024
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:remarks]).to eq('NO REMARKS')
|
1025
|
+
end
|
1026
|
+
end
|
369
1027
|
end
|
370
|
-
|
371
|
-
|
1028
|
+
end
|
1029
|
+
|
1030
|
+
context 'Check #201812215555555557' do
|
1031
|
+
it 'returns the check number' do
|
1032
|
+
expect(@era[:checks]['201812215555555557'][:check_number]).to eq('201812215555555557')
|
372
1033
|
end
|
373
|
-
it 'returns the
|
374
|
-
expect(@era[:checks]['
|
1034
|
+
it 'returns the amount' do
|
1035
|
+
expect(@era[:checks]['201812215555555557'][:amount]).to eq(500)
|
375
1036
|
end
|
376
|
-
it 'returns the
|
377
|
-
expect(@era[:checks]['
|
1037
|
+
it 'returns the number of claims' do
|
1038
|
+
expect(@era[:checks]['201812215555555557'][:number_of_claims]).to eq(2)
|
378
1039
|
end
|
379
|
-
it 'returns the
|
380
|
-
expect(@era[:checks]['
|
1040
|
+
it 'returns the NPI or Tax ID' do
|
1041
|
+
expect(@era[:checks]['201812215555555557'][:npi_tax_id]).to eq('1212121212')
|
381
1042
|
end
|
382
|
-
it 'returns the
|
383
|
-
expect(@era[:checks]['
|
1043
|
+
it 'returns the payee' do
|
1044
|
+
expect(@era[:checks]['201812215555555557'][:payee]).to eq('ABC COMPANY LLC')
|
384
1045
|
end
|
385
1046
|
it 'returns the Payer name' do
|
386
|
-
expect(@era[:checks]['
|
1047
|
+
expect(@era[:checks]['201812215555555557'][:payer_name]).to eq('ABC HEALTHCARE EAST')
|
387
1048
|
end
|
388
1049
|
it 'returns the Payer address' do
|
389
|
-
expect(@era[:checks]['
|
1050
|
+
expect(@era[:checks]['201812215555555557'][:payer_address]).to eq('ONE CIRCLE RD')
|
390
1051
|
end
|
391
1052
|
it 'returns the Payer city' do
|
392
|
-
expect(@era[:checks]['
|
1053
|
+
expect(@era[:checks]['201812215555555557'][:payer_city]).to eq('SOMEWHERE')
|
393
1054
|
end
|
394
1055
|
it 'returns the Payer state' do
|
395
|
-
expect(@era[:checks]['
|
1056
|
+
expect(@era[:checks]['201812215555555557'][:payer_state]).to eq('GA')
|
396
1057
|
end
|
397
1058
|
it 'returns the Payer zip code' do
|
398
|
-
expect(@era[:checks]['
|
1059
|
+
expect(@era[:checks]['201812215555555557'][:payer_zip_code]).to eq('11111')
|
399
1060
|
end
|
400
1061
|
it 'returns the Payer tax id' do
|
401
|
-
expect(@era[:checks]['
|
402
|
-
end
|
403
|
-
it 'returns the Payer claim control number' do
|
404
|
-
expect(@era[:checks]['201812215555555556'][:eras][1][:payer_claim_control_number]).to eq('BT1111111141')
|
405
|
-
end
|
406
|
-
it 'returns the Claim statement period start' do
|
407
|
-
expect(@era[:checks]['201812215555555556'][:eras][1][:claim_statement_period_start]).to eq(nil)
|
1062
|
+
expect(@era[:checks]['201812215555555557'][:payer_tax_id]).to eq('11-1111110')
|
408
1063
|
end
|
409
|
-
it 'returns the
|
410
|
-
expect(@era[:checks]['
|
1064
|
+
it 'returns the date' do
|
1065
|
+
expect(@era[:checks]['201812215555555557'][:date]).to eq('12/21/2018')
|
411
1066
|
end
|
412
1067
|
|
413
|
-
context '
|
414
|
-
it 'returns the
|
415
|
-
|
416
|
-
end
|
417
|
-
it 'returns the CPT code' do
|
418
|
-
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:cpt_code]).to eq('92507')
|
419
|
-
end
|
420
|
-
it 'returns the Charge amount (integer)' do
|
421
|
-
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:charge_amount]).to eq(10000)
|
422
|
-
end
|
423
|
-
it 'returns the Payment amount (integer)' do
|
424
|
-
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:payment_amount]).to eq(10000)
|
425
|
-
end
|
426
|
-
it 'returns the Total adjustment amount (integer)' do
|
427
|
-
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:total_adjustment_amount]).to eq(0)
|
428
|
-
end
|
429
|
-
it 'returns the Remarks' do
|
430
|
-
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:remarks]).to eq('NO REMARKS')
|
431
|
-
end
|
432
|
-
end
|
433
|
-
end
|
434
|
-
end
|
435
|
-
|
436
|
-
context 'Check #201812215555555557' do
|
437
|
-
it 'returns the check number' do
|
438
|
-
expect(@era[:checks]['201812215555555557'][:check_number]).to eq('201812215555555557')
|
439
|
-
end
|
440
|
-
it 'returns the amount' do
|
441
|
-
expect(@era[:checks]['201812215555555557'][:amount]).to eq(500)
|
442
|
-
end
|
443
|
-
it 'returns the number of claims' do
|
444
|
-
expect(@era[:checks]['201812215555555557'][:number_of_claims]).to eq(2)
|
445
|
-
end
|
446
|
-
it 'returns the NPI or Tax ID' do
|
447
|
-
expect(@era[:checks]['201812215555555557'][:npi_tax_id]).to eq('1212121212')
|
448
|
-
end
|
449
|
-
it 'returns the payee' do
|
450
|
-
expect(@era[:checks]['201812215555555557'][:payee]).to eq('ABC COMPANY LLC')
|
451
|
-
end
|
452
|
-
it 'returns the date' do
|
453
|
-
expect(@era[:checks]['201812215555555557'][:date]).to eq('12/21/2018')
|
454
|
-
end
|
455
|
-
|
456
|
-
context 'ERA #0' do
|
457
|
-
it 'returns the ERA text' do
|
458
|
-
text = <<-EOF
|
1068
|
+
context 'ERA #0' do
|
1069
|
+
it 'returns the ERA text' do
|
1070
|
+
text = <<-EOF
|
459
1071
|
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
460
1072
|
Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
|
461
1073
|
201812215555555557 ZECM11111112 LASTNAME, 45.00 0.00 M111 DENIED ABC HEALTHCARE EAST
|
@@ -470,97 +1082,79 @@ Check# Patient ID Last,First Charge Amt
|
|
470
1082
|
|
471
1083
|
Adjustment Group Adj Amt Translated Reason Code
|
472
1084
|
CONTRACTUAL OBLIGATIONS 45.00 CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
end
|
482
|
-
it 'returns the Patient last name (titlized)' do
|
483
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_last_name]).to eq('Lastname')
|
484
|
-
end
|
485
|
-
it 'returns the Patient first name (titlized)' do
|
486
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_first_name]).to eq(nil)
|
487
|
-
end
|
488
|
-
it 'returns the Total charge amount (integer)' do
|
489
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:charge_amount]).to eq(4500)
|
490
|
-
end
|
491
|
-
it 'returns the Total payment amount (integer)' do
|
492
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payment_amount]).to eq(0)
|
493
|
-
end
|
494
|
-
it 'returns the Account number' do
|
495
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:account_number]).to eq('M111')
|
496
|
-
end
|
497
|
-
it 'returns the Status' do
|
498
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:status]).to eq('DENIED')
|
499
|
-
end
|
500
|
-
it 'returns the Payer name' do
|
501
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_name]).to eq('ABC HEALTHCARE EAST')
|
502
|
-
end
|
503
|
-
it 'returns the Payer address' do
|
504
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_address]).to eq('ONE CIRCLE RD')
|
505
|
-
end
|
506
|
-
it 'returns the Payer city' do
|
507
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_city]).to eq('SOMEWHERE')
|
508
|
-
end
|
509
|
-
it 'returns the Payer state' do
|
510
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_state]).to eq('GA')
|
511
|
-
end
|
512
|
-
it 'returns the Payer zip code' do
|
513
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_zip_code]).to eq('11111')
|
514
|
-
end
|
515
|
-
it 'returns the Payer tax id' do
|
516
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_tax_id]).to eq('11-1111110')
|
517
|
-
end
|
518
|
-
it 'returns the Payer claim control number' do
|
519
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_claim_control_number]).to eq('BT1111111131')
|
520
|
-
end
|
521
|
-
it 'returns the Claim statement period start' do
|
522
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:claim_statement_period_start]).to eq('01/30/2019')
|
523
|
-
end
|
524
|
-
it 'returns the Claim statement period end' do
|
525
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:claim_statement_period_end]).to eq('01/30/2019')
|
526
|
-
end
|
527
|
-
|
528
|
-
context 'Line item #0' do
|
529
|
-
it 'returns the Date of service (string mm/dd/yyyy)' do
|
530
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:service_date]).to eq('10/28/2017')
|
1085
|
+
EOF
|
1086
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:era_text]).to eq(text.strip)
|
1087
|
+
end
|
1088
|
+
it 'returns the Patient ID' do
|
1089
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_id]).to eq('ZECM11111112')
|
1090
|
+
end
|
1091
|
+
it 'returns the Patient name' do
|
1092
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_name]).to eq('LASTNAME,')
|
531
1093
|
end
|
532
|
-
it 'returns the
|
533
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:
|
1094
|
+
it 'returns the Patient last name (titlized)' do
|
1095
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_last_name]).to eq('Lastname')
|
534
1096
|
end
|
535
|
-
it 'returns the
|
536
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:
|
1097
|
+
it 'returns the Patient first name (titlized)' do
|
1098
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_first_name]).to eq(nil)
|
537
1099
|
end
|
538
|
-
it 'returns the
|
539
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:
|
1100
|
+
it 'returns the Total charge amount (integer)' do
|
1101
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:charge_amount]).to eq(4500)
|
540
1102
|
end
|
541
|
-
it 'returns the Total
|
542
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:
|
1103
|
+
it 'returns the Total payment amount (integer)' do
|
1104
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:payment_amount]).to eq(0)
|
543
1105
|
end
|
544
|
-
it 'returns the
|
545
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:
|
1106
|
+
it 'returns the Account number' do
|
1107
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:account_number]).to eq('M111')
|
546
1108
|
end
|
547
|
-
|
548
|
-
|
549
|
-
|
1109
|
+
it 'returns the Status' do
|
1110
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:status]).to eq('DENIED')
|
1111
|
+
end
|
1112
|
+
it 'returns the Payer claim control number' do
|
1113
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:payer_claim_control_number]).to eq('BT1111111131')
|
1114
|
+
end
|
1115
|
+
it 'returns the Claim statement period start' do
|
1116
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:claim_statement_period_start]).to eq('01/30/2019')
|
1117
|
+
end
|
1118
|
+
it 'returns the Claim statement period end' do
|
1119
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:claim_statement_period_end]).to eq('01/30/2019')
|
1120
|
+
end
|
1121
|
+
|
1122
|
+
context 'Line item #0' do
|
1123
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
1124
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:service_date]).to eq('10/28/2017')
|
1125
|
+
end
|
1126
|
+
it 'returns the CPT code' do
|
1127
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:cpt_code]).to eq('92507')
|
1128
|
+
end
|
1129
|
+
it 'returns the Charge amount (integer)' do
|
1130
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:charge_amount]).to eq(4500)
|
550
1131
|
end
|
551
|
-
it 'returns the
|
552
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:
|
1132
|
+
it 'returns the Payment amount (integer)' do
|
1133
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:payment_amount]).to eq(0)
|
553
1134
|
end
|
554
|
-
it 'returns the
|
555
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:
|
1135
|
+
it 'returns the Total adjustment amount (integer)' do
|
1136
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(4500)
|
1137
|
+
end
|
1138
|
+
it 'returns the Remarks' do
|
1139
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:remarks]).to eq('NO REMARKS')
|
1140
|
+
end
|
1141
|
+
context 'Adjustment group #0' do
|
1142
|
+
it 'returns the Adjustment group' do
|
1143
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq('CONTRACTUAL OBLIGATIONS')
|
1144
|
+
end
|
1145
|
+
it 'returns the Adjustment amount (integer)' do
|
1146
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(4500)
|
1147
|
+
end
|
1148
|
+
it 'returns the Translated reason code' do
|
1149
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq('CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.')
|
1150
|
+
end
|
556
1151
|
end
|
557
1152
|
end
|
558
1153
|
end
|
559
|
-
end
|
560
1154
|
|
561
|
-
|
562
|
-
|
563
|
-
|
1155
|
+
context 'ERA #1' do
|
1156
|
+
it 'returns the ERA text' do
|
1157
|
+
text = <<-EOF
|
564
1158
|
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
565
1159
|
Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
|
566
1160
|
201812215555555557 ZECM11111112 WORLD,HELLO 65.00 5.00 M111 PROCESSED AS PRIMARY, FWDED ABC HEALTHCARE EAST
|
@@ -575,156 +1169,139 @@ Check# Patient ID Last,First Charge Amt
|
|
575
1169
|
Adjustment Group Adj Amt Translated Reason Code
|
576
1170
|
CONTRACTUAL OBLIGATIONS 16.20 CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.
|
577
1171
|
OTHER ADJUSTMENTS 43.80 PAYMENT ADJUSTED BECAUSE CHARGES HAVE BEEN PAID BY ANOTHER PAYER.
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
end
|
590
|
-
it 'returns the Patient first name (titlized)' do
|
591
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_first_name]).to eq('Hello')
|
592
|
-
end
|
593
|
-
it 'returns the Total charge amount (integer)' do
|
594
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:charge_amount]).to eq(6500)
|
595
|
-
end
|
596
|
-
it 'returns the Total payment amount (integer)' do
|
597
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payment_amount]).to eq(500)
|
598
|
-
end
|
599
|
-
it 'returns the Account number' do
|
600
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:account_number]).to eq('M111')
|
601
|
-
end
|
602
|
-
it 'returns the Status' do
|
603
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:status]).to eq('PROCESSED AS PRIMARY, FWDED')
|
604
|
-
end
|
605
|
-
it 'returns the Payer name' do
|
606
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_name]).to eq('ABC HEALTHCARE EAST')
|
607
|
-
end
|
608
|
-
it 'returns the Payer address' do
|
609
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_address]).to eq('ONE CIRCLE RD')
|
610
|
-
end
|
611
|
-
it 'returns the Payer city' do
|
612
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_city]).to eq('SOMEWHERE')
|
613
|
-
end
|
614
|
-
it 'returns the Payer state' do
|
615
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_state]).to eq('GA')
|
616
|
-
end
|
617
|
-
it 'returns the Payer zip code' do
|
618
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_zip_code]).to eq('11111')
|
619
|
-
end
|
620
|
-
it 'returns the Payer tax id' do
|
621
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_tax_id]).to eq('11-1111110')
|
622
|
-
end
|
623
|
-
it 'returns the Payer claim control number' do
|
624
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_claim_control_number]).to eq('BT1111111121')
|
625
|
-
end
|
626
|
-
it 'returns the Claim statement period start' do
|
627
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:claim_statement_period_start]).to eq(nil)
|
628
|
-
end
|
629
|
-
it 'returns the Claim statement period end' do
|
630
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:claim_statement_period_end]).to eq(nil)
|
631
|
-
end
|
632
|
-
|
633
|
-
context 'Line item #0' do
|
634
|
-
it 'returns the Date of service (string mm/dd/yyyy)' do
|
635
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:service_date]).to eq('10/30/2017')
|
1172
|
+
EOF
|
1173
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:era_text]).to eq(text.strip)
|
1174
|
+
end
|
1175
|
+
it 'returns the Patient ID' do
|
1176
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_id]).to eq('ZECM11111112')
|
1177
|
+
end
|
1178
|
+
it 'returns the Patient name' do
|
1179
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_name]).to eq('WORLD,HELLO')
|
1180
|
+
end
|
1181
|
+
it 'returns the Patient last name (titlized)' do
|
1182
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_last_name]).to eq('World')
|
636
1183
|
end
|
637
|
-
it 'returns the
|
638
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:
|
1184
|
+
it 'returns the Patient first name (titlized)' do
|
1185
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_first_name]).to eq('Hello')
|
639
1186
|
end
|
640
|
-
it 'returns the
|
641
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:
|
1187
|
+
it 'returns the Total charge amount (integer)' do
|
1188
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:charge_amount]).to eq(6500)
|
642
1189
|
end
|
643
|
-
it 'returns the
|
644
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:
|
1190
|
+
it 'returns the Total payment amount (integer)' do
|
1191
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:payment_amount]).to eq(500)
|
645
1192
|
end
|
646
|
-
it 'returns the
|
647
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:
|
1193
|
+
it 'returns the Account number' do
|
1194
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:account_number]).to eq('M111')
|
648
1195
|
end
|
649
|
-
it 'returns the
|
650
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:
|
1196
|
+
it 'returns the Status' do
|
1197
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:status]).to eq('PROCESSED AS PRIMARY, FWDED')
|
651
1198
|
end
|
652
|
-
|
653
|
-
|
654
|
-
|
1199
|
+
it 'returns the Payer claim control number' do
|
1200
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:payer_claim_control_number]).to eq('BT1111111121')
|
1201
|
+
end
|
1202
|
+
it 'returns the Claim statement period start' do
|
1203
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:claim_statement_period_start]).to eq(nil)
|
1204
|
+
end
|
1205
|
+
it 'returns the Claim statement period end' do
|
1206
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:claim_statement_period_end]).to eq(nil)
|
1207
|
+
end
|
1208
|
+
|
1209
|
+
context 'Line item #0' do
|
1210
|
+
it 'returns the Date of service (string mm/dd/yyyy)' do
|
1211
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:service_date]).to eq('10/30/2017')
|
655
1212
|
end
|
656
|
-
it 'returns the
|
657
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:
|
1213
|
+
it 'returns the CPT code' do
|
1214
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:cpt_code]).to eq('92507')
|
658
1215
|
end
|
659
|
-
it 'returns the
|
660
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:
|
1216
|
+
it 'returns the Charge amount (integer)' do
|
1217
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:charge_amount]).to eq(6500)
|
661
1218
|
end
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
1219
|
+
it 'returns the Payment amount (integer)' do
|
1220
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:payment_amount]).to eq(500)
|
1221
|
+
end
|
1222
|
+
it 'returns the Total adjustment amount (integer)' do
|
1223
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:total_adjustment_amount]).to eq(6000)
|
666
1224
|
end
|
667
|
-
it 'returns the
|
668
|
-
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:
|
1225
|
+
it 'returns the Remarks' do
|
1226
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:remarks]).to eq('NO REMARKS')
|
669
1227
|
end
|
670
|
-
|
671
|
-
|
1228
|
+
context 'Adjustment group #0' do
|
1229
|
+
it 'returns the Adjustment group' do
|
1230
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq('CONTRACTUAL OBLIGATIONS')
|
1231
|
+
end
|
1232
|
+
it 'returns the Adjustment amount (integer)' do
|
1233
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(1620)
|
1234
|
+
end
|
1235
|
+
it 'returns the Translated reason code' do
|
1236
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq('CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.')
|
1237
|
+
end
|
1238
|
+
end
|
1239
|
+
context 'Adjustment group #1' do
|
1240
|
+
it 'returns the Adjustment group' do
|
1241
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups][1][:adjustment_group]).to eq('OTHER ADJUSTMENTS')
|
1242
|
+
end
|
1243
|
+
it 'returns the Adjustment amount (integer)' do
|
1244
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups][1][:adjustment_amount]).to eq(4380)
|
1245
|
+
end
|
1246
|
+
it 'returns the Translated reason code' do
|
1247
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups][1][:translated_reason_code]).to eq('PAYMENT ADJUSTED BECAUSE CHARGES HAVE BEEN PAID BY ANOTHER PAYER.')
|
1248
|
+
end
|
672
1249
|
end
|
673
1250
|
end
|
674
1251
|
end
|
675
1252
|
end
|
676
|
-
end
|
677
1253
|
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
end
|
696
|
-
context 'Adjustment #1' do
|
697
|
-
it 'returns Adjustment date (string mm/dd/yyyy)' do
|
698
|
-
expect(@era[:adjustments][1][:adjustment_date]).to eq('12/31/2018')
|
699
|
-
end
|
700
|
-
it 'returns Provider ID' do
|
701
|
-
expect(@era[:adjustments][1][:provider_id]).to eq('1111111112')
|
702
|
-
end
|
703
|
-
it 'returns Reference ID' do
|
704
|
-
expect(@era[:adjustments][1][:reference_id]).to eq('20170514 1710101112 06')
|
705
|
-
end
|
706
|
-
it 'returns Adjustment amount (integer)' do
|
707
|
-
expect(@era[:adjustments][1][:adjustment_amount]).to eq(-3344)
|
708
|
-
end
|
709
|
-
it 'returns reason' do
|
710
|
-
expect(@era[:adjustments][1][:reason]).to eq('Overpayment Recover')
|
711
|
-
end
|
712
|
-
end
|
713
|
-
context 'Adjustment #2' do
|
714
|
-
it 'returns Adjustment date (string mm/dd/yyyy)' do
|
715
|
-
expect(@era[:adjustments][2][:adjustment_date]).to eq('12/30/2018')
|
716
|
-
end
|
717
|
-
it 'returns Provider ID' do
|
718
|
-
expect(@era[:adjustments][2][:provider_id]).to eq('1111111113')
|
719
|
-
end
|
720
|
-
it 'returns Reference ID' do
|
721
|
-
expect(@era[:adjustments][2][:reference_id]).to eq('BBBBBBVP31M2')
|
1254
|
+
context 'Adjustments' do
|
1255
|
+
context 'Adjustment #0' do
|
1256
|
+
it 'returns Adjustment date (string mm/dd/yyyy)' do
|
1257
|
+
expect(@era[:adjustments][0][:adjustment_date]).to eq('12/30/2018')
|
1258
|
+
end
|
1259
|
+
it 'returns Provider ID' do
|
1260
|
+
expect(@era[:adjustments][0][:provider_id]).to eq('1111111111')
|
1261
|
+
end
|
1262
|
+
it 'returns Reference ID' do
|
1263
|
+
expect(@era[:adjustments][0][:reference_id]).to eq('BBBBBBVP31M0')
|
1264
|
+
end
|
1265
|
+
it 'returns Adjustment amount (integer)' do
|
1266
|
+
expect(@era[:adjustments][0][:adjustment_amount]).to eq(-4281)
|
1267
|
+
end
|
1268
|
+
it 'returns reason' do
|
1269
|
+
expect(@era[:adjustments][0][:reason]).to eq('Overpayment Recover')
|
1270
|
+
end
|
722
1271
|
end
|
723
|
-
|
724
|
-
|
1272
|
+
context 'Adjustment #1' do
|
1273
|
+
it 'returns Adjustment date (string mm/dd/yyyy)' do
|
1274
|
+
expect(@era[:adjustments][1][:adjustment_date]).to eq('12/31/2018')
|
1275
|
+
end
|
1276
|
+
it 'returns Provider ID' do
|
1277
|
+
expect(@era[:adjustments][1][:provider_id]).to eq('1111111112')
|
1278
|
+
end
|
1279
|
+
it 'returns Reference ID' do
|
1280
|
+
expect(@era[:adjustments][1][:reference_id]).to eq('20170514 1710101112 06')
|
1281
|
+
end
|
1282
|
+
it 'returns Adjustment amount (integer)' do
|
1283
|
+
expect(@era[:adjustments][1][:adjustment_amount]).to eq(-3344)
|
1284
|
+
end
|
1285
|
+
it 'returns reason' do
|
1286
|
+
expect(@era[:adjustments][1][:reason]).to eq('Overpayment Recover')
|
1287
|
+
end
|
725
1288
|
end
|
726
|
-
|
727
|
-
|
1289
|
+
context 'Adjustment #2' do
|
1290
|
+
it 'returns Adjustment date (string mm/dd/yyyy)' do
|
1291
|
+
expect(@era[:adjustments][2][:adjustment_date]).to eq('12/30/2018')
|
1292
|
+
end
|
1293
|
+
it 'returns Provider ID' do
|
1294
|
+
expect(@era[:adjustments][2][:provider_id]).to eq('1111111113')
|
1295
|
+
end
|
1296
|
+
it 'returns Reference ID' do
|
1297
|
+
expect(@era[:adjustments][2][:reference_id]).to eq('BBBBBBVP31M2')
|
1298
|
+
end
|
1299
|
+
it 'returns Adjustment amount (integer)' do
|
1300
|
+
expect(@era[:adjustments][2][:adjustment_amount]).to eq(3345)
|
1301
|
+
end
|
1302
|
+
it 'returns reason' do
|
1303
|
+
expect(@era[:adjustments][2][:reason]).to eq('Overpayment Recover')
|
1304
|
+
end
|
728
1305
|
end
|
729
1306
|
end
|
730
1307
|
end
|