era_835_parser 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 731ca964eb5c6e01d791525fe34151a2eb15e1154f2c3e9ca9726ee9264184c8
4
- data.tar.gz: bf55ebe8c6004a2c4555643d73c42589fb064edbfc5870808da76e0738536865
3
+ metadata.gz: 1b8165088acaa6a3976f256236ae0e13a74b9e5b671095caf6be5b08d14af1da
4
+ data.tar.gz: fd280dae00dcf64a92985c864d4b4f54500e2c2f68d370836d233691405d92e5
5
5
  SHA512:
6
- metadata.gz: 2a5948ab0425ab4d72c4b31f03a4300b3759a7ef6619f67d2444baa6fcae83e9da70f1c015e68d6c140cf9c8b4b906d15ffa3a421bc02fab620ba2dc8d20456b
7
- data.tar.gz: 7c49002c06b30bf7a78868837e311b4e00b373af56051d7fcf9292f231ff74f4320350d8c1d72e0e64f0b163a81e83a927fcbbf5bca3e36a8475946895b30992
6
+ metadata.gz: f64e0ff363d2c7b0ad67f97305f17ae591796b5f8729c472478476d4d0af8a44a7268280917bb4730a59b1203452d4c9ca37075898f9ed4d425993ccae374bf5
7
+ data.tar.gz: e2246dcdaa68f1984ee6031170b45ff4054723d490d4b84361dac8eed0ddbba0693e6f547c5bf101624db7bca6dc633c29d0a975f072adf7fb410a411971b51b
data/README.md CHANGED
@@ -33,6 +33,7 @@ era[:checks].each do |check_number, check|
33
33
  puts check[:payee] # Check payee
34
34
  puts check[:date] # Check date (string mm/dd/yyyy)
35
35
  check[:eras].each do |era_counter, era|
36
+ puts era[:era_text] # ERA text
36
37
  puts era[:patient_id] # Patient ID
37
38
  puts era[:patient_name] # Patient name
38
39
  puts era[:patient_last_name] # Patient last name (titlized)
@@ -18,6 +18,7 @@ module Era835Parser
18
18
  individual_era = Hash.new
19
19
  individual_line_item = Hash.new
20
20
  check_number = ''
21
+ era_text = "--------------------------------------------------------------------------------------------------------------------------------------------------------\n"
21
22
 
22
23
  # counters
23
24
  adjustment_counter = 0
@@ -36,6 +37,7 @@ module Era835Parser
36
37
  next_line_adjustment_group = false
37
38
 
38
39
  open(file_path).readlines.each do |line|
40
+ era_text += line if eras_start && line !~ /-{10,}/i
39
41
 
40
42
  if line.include?("Dear:")
41
43
  era[:addressed_to] = line.gsub("Dear:", "").strip
@@ -189,15 +191,18 @@ module Era835Parser
189
191
  era_counter = 0
190
192
  eras = Hash.new
191
193
  individual_era[:line_items] = line_items
194
+ individual_era[:era_text] = era_text.strip.gsub(/\r/, "")
192
195
  eras[era_counter] = individual_era
193
196
  era[:checks][check_number][:eras] = eras
194
197
  else
195
198
  era_counter = era[:checks][check_number][:eras].count
196
199
  eras = Hash.new
197
200
  individual_era[:line_items] = line_items
201
+ individual_era[:era_text] = era_text.strip.gsub(/\r/, "")
198
202
  eras[era_counter] = individual_era
199
203
  era[:checks][check_number][:eras] = era[:checks][check_number][:eras].merge(eras)
200
204
  end
205
+ era_text = "--------------------------------------------------------------------------------------------------------------------------------------------------------\n"
201
206
  end
202
207
  end
203
208
 
@@ -225,16 +230,17 @@ module Era835Parser
225
230
  era_counter = 0
226
231
  eras = Hash.new
227
232
  individual_era[:line_items] = line_items
233
+ individual_era[:era_text] = era_text.strip.gsub(/\r/, "")
228
234
  eras[era_counter] = individual_era
229
235
  era[:checks][check_number][:eras] = eras
230
236
  else
231
237
  era_counter = era[:checks][check_number][:eras].count
232
238
  eras = Hash.new
233
239
  individual_era[:line_items] = line_items
240
+ individual_era[:era_text] = era_text.strip.gsub(/\r/, "")
234
241
  eras[era_counter] = individual_era
235
242
  era[:checks][check_number][:eras] = era[:checks][check_number][:eras].merge(eras)
236
243
  end
237
-
238
244
  return era
239
245
  end
240
246
  end
@@ -1,3 +1,3 @@
1
1
  module Era835Parser
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -75,6 +75,24 @@ RSpec.describe Era835Parser::Parser do
75
75
  end
76
76
 
77
77
  context 'ERA #0' do
78
+ it 'returns the ERA text' do
79
+ text = <<-EOF
80
+ --------------------------------------------------------------------------------------------------------------------------------------------------------
81
+ Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
82
+ 201812215555555555 M11111110 DOE JR,DAVIS 65.00 48.80 1112 PROCESSED AS PRIMARY ABC HEALTHCARE EAST
83
+ ONE CIRCLE RD
84
+ SOMEWHERE,GA 11111
85
+ Tax ID: 11-1111110
86
+ Payer Claim Control Number: 111111111000
87
+
88
+ Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
89
+ 10/25/2018 92507 65.00 48.80 16.20 NO REMARKS
90
+
91
+ Adjustment Group Adj Amt Translated Reason Code
92
+ CONTRACTUAL OBLIGATIONS 16.20 CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.
93
+ EOF
94
+ expect(@era[:checks]['201812215555555555'][:eras][0][:era_text]).to eq(text.strip)
95
+ end
78
96
  it 'returns the Patient ID' do
79
97
  expect(@era[:checks]['201812215555555555'][:eras][0][:patient_id]).to eq('M11111110')
80
98
  end
@@ -182,6 +200,30 @@ RSpec.describe Era835Parser::Parser do
182
200
  end
183
201
 
184
202
  context 'ERA #0' do
203
+ it 'returns the ERA text' do
204
+ text = <<-EOF
205
+ --------------------------------------------------------------------------------------------------------------------------------------------------------
206
+ Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
207
+ 201812215555555556 ZECM11111111 DOE,JANE -65.00 -48.80 L111 OTHER ABC HEALTHCARE WEST
208
+ 50 EAST RD
209
+ ANYWHERE,TN 00002-1111
210
+ Tax ID: 11-1111111
211
+ Payer Claim Control Number: BTBBB1111100
212
+
213
+ Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
214
+ 10/27/2017 92507 -65.00 -48.80 -16.20 NO REMARKS
215
+
216
+ Adjustment Group Adj Amt Translated Reason Code
217
+ OTHER ADJUSTMENTS -16.20 CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.
218
+
219
+ Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
220
+ 11/09/2017 92507 -5.00 0.00 -5.00 NO REMARKS
221
+
222
+ Adjustment Group Adj Amt Translated Reason Code
223
+ OTHER ADJUSTMENTS -5.00 PAYMENT ADJUSTED BECAUSE CHARGES HAVE BEEN PAID BY ANOTHER PAYER.
224
+ EOF
225
+ expect(@era[:checks]['201812215555555556'][:eras][0][:era_text]).to eq(text.strip)
226
+ end
185
227
  it 'returns the Patient ID' do
186
228
  expect(@era[:checks]['201812215555555556'][:eras][0][:patient_id]).to eq('ZECM11111111')
187
229
  end
@@ -300,6 +342,21 @@ RSpec.describe Era835Parser::Parser do
300
342
  end
301
343
 
302
344
  context 'ERA #1' do
345
+ it 'returns the ERA text' do
346
+ text = <<-EOF
347
+ --------------------------------------------------------------------------------------------------------------------------------------------------------
348
+ Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
349
+ 201812215555555556 ZECM11111112 SMITH,JOSEPH 100.00 100.00 M111 PROCESSED AS SECONDARY ABC HEALTHCARE WEST
350
+ 50 EAST RD
351
+ ANYWHERE,TN 00002
352
+ Tax ID: 11-1111111
353
+ Payer Claim Control Number: BT1111111141
354
+
355
+ Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
356
+ 10/25/2017 92507 100.00 100.00 0.00 NO REMARKS
357
+ EOF
358
+ expect(@era[:checks]['201812215555555556'][:eras][1][:era_text]).to eq(text.strip)
359
+ end
303
360
  it 'returns the Patient ID' do
304
361
  expect(@era[:checks]['201812215555555556'][:eras][1][:patient_id]).to eq('ZECM11111112')
305
362
  end
@@ -396,6 +453,25 @@ RSpec.describe Era835Parser::Parser do
396
453
  end
397
454
 
398
455
  context 'ERA #0' do
456
+ it 'returns the ERA text' do
457
+ text = <<-EOF
458
+ --------------------------------------------------------------------------------------------------------------------------------------------------------
459
+ Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
460
+ 201812215555555557 ZECM11111112 LASTNAME,FIRST 45.00 0.00 M111 DENIED ABC HEALTHCARE EAST
461
+ ONE CIRCLE RD
462
+ SOMEWHERE,GA 11111
463
+ Tax ID: 11-1111110
464
+ Payer Claim Control Number: BT1111111131
465
+ Claim Statement Period: 01/30/2019 - 01/30/2019
466
+
467
+ Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
468
+ 10/28/2017 92507 45.00 0.00 45.00 NO REMARKS
469
+
470
+ Adjustment Group Adj Amt Translated Reason Code
471
+ CONTRACTUAL OBLIGATIONS 45.00 CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.
472
+ EOF
473
+ expect(@era[:checks]['201812215555555557'][:eras][0][:era_text]).to eq(text.strip)
474
+ end
399
475
  it 'returns the Patient ID' do
400
476
  expect(@era[:checks]['201812215555555557'][:eras][0][:patient_id]).to eq('ZECM11111112')
401
477
  end
@@ -482,6 +558,25 @@ RSpec.describe Era835Parser::Parser do
482
558
  end
483
559
 
484
560
  context 'ERA #1' do
561
+ it 'returns the ERA text' do
562
+ text = <<-EOF
563
+ --------------------------------------------------------------------------------------------------------------------------------------------------------
564
+ Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
565
+ 201812215555555557 ZECM11111112 WORLD,HELLO 65.00 5.00 M111 PROCESSED AS PRIMARY, FWDED ABC HEALTHCARE EAST
566
+ ONE CIRCLE RD
567
+ SOMEWHERE,GA 11111
568
+ Tax ID: 11-1111110
569
+ Payer Claim Control Number: BT1111111121
570
+
571
+ Line Item: Svc Date CPT Charge Amt Payment Amt Total Adj Amt Remarks
572
+ 10/30/2017 92507 65.00 5.00 60.00 NO REMARKS
573
+
574
+ Adjustment Group Adj Amt Translated Reason Code
575
+ CONTRACTUAL OBLIGATIONS 16.20 CHARGES EXCEED YOUR CONTRACTED/LEGISLATED FEE ARRANGEMENT.
576
+ OTHER ADJUSTMENTS 43.80 PAYMENT ADJUSTED BECAUSE CHARGES HAVE BEEN PAID BY ANOTHER PAYER.
577
+ EOF
578
+ expect(@era[:checks]['201812215555555557'][:eras][1][:era_text]).to eq(text.strip)
579
+ end
485
580
  it 'returns the Patient ID' do
486
581
  expect(@era[:checks]['201812215555555557'][:eras][1][:patient_id]).to eq('ZECM11111112')
487
582
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: era_835_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-24 00:00:00.000000000 Z
11
+ date: 2019-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler