era_835_parser 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/era_835_parser/parser.rb +2 -2
- data/lib/era_835_parser/version.rb +1 -1
- data/spec/era_835_parser_spec.rb +3 -3
- data/spec/test_era.txt +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c61cb6ee43b26af6f71b0838106a844d8647f8337c72da1fda4f8bc23ad1529
|
4
|
+
data.tar.gz: 832b212be0290b44d3408577368dc291bb544d0a2c0112f733d1a4301e615e34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f45a14db277b2817510d1fa724a560bdc081e98127841fcc2f21ba8e7c57e15e2474e7f8405307e5c29360d8af8788631be5576b099235caa0f151b216159a01
|
7
|
+
data.tar.gz: 63fc1b18b1e8a1be08e2c74a3fadf0091ef347ba44b00a9da0d6d6159e983a013969af8a3149b2f5b7db8af39ae1ace1bfbfe183bbe55d53f761529689f90d07
|
@@ -159,8 +159,8 @@ module Era835Parser
|
|
159
159
|
next_line_check_number = false
|
160
160
|
individual_era[:patient_id] = /^[^\s]+(?=\s)\s+[^\s]+/.match(line)[0].strip.split(" ")[1] if !/^[^\s]+(?=\s)\s+[^\s]+/.match(line).nil?
|
161
161
|
individual_era[:patient_name] = /\s\D*,\D*\s/.match(line)[0].strip if !/\s\D*,\D*\s/.match(line).nil?
|
162
|
-
individual_era[:patient_last_name] = individual_era[:patient_name].split(",")[0].downcase.split(" ").map { |word| word.capitalize }.join(" ")
|
163
|
-
individual_era[:patient_first_name] = individual_era[:patient_name].split(",")[1].downcase.split(" ").map { |word| word.capitalize }.join(" ")
|
162
|
+
individual_era[:patient_last_name] = individual_era[:patient_name].split(",")[0].downcase.split(" ").map { |word| word.capitalize }.join(" ") if !individual_era[:patient_name].split(",")[0].nil?
|
163
|
+
individual_era[:patient_first_name] = individual_era[:patient_name].split(",")[1].downcase.split(" ").map { |word| word.capitalize }.join(" ") if !individual_era[:patient_name].split(",")[1].nil?
|
164
164
|
individual_era[:charge_amount] = (/,\D+\d+\.\d+\s/.match(line)[0].gsub(/[a-zA-Z,]/, "").strip.to_f * 100).to_i if !/,\D+\d+\.\d+\s/.match(line).nil?
|
165
165
|
individual_era[:payment_amount] = (/\.\d+\s+\-?\d+\.\d+\s/.match(line)[0].strip.split(" ")[1].strip.to_f * 100).to_i if !/\.\d+\s+\-?\d+\.\d+\s/.match(line).nil?
|
166
166
|
individual_era[:account_number] = /\.\d+\s+\-?\d+\.\d+\s+[A-Z\d]+\s/.match(line)[0].strip.split(" ")[2] if !/\.\d+\s+\-?\d+\.\d+\s+[A-Z\d]+\s/.match(line).nil?
|
data/spec/era_835_parser_spec.rb
CHANGED
@@ -458,7 +458,7 @@ Check# Patient ID Last,First Charge Amt
|
|
458
458
|
text = <<-EOF
|
459
459
|
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
460
460
|
Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
|
461
|
-
201812215555555557 ZECM11111112 LASTNAME,
|
461
|
+
201812215555555557 ZECM11111112 LASTNAME, 45.00 0.00 M111 DENIED ABC HEALTHCARE EAST
|
462
462
|
ONE CIRCLE RD
|
463
463
|
SOMEWHERE,GA 11111
|
464
464
|
Tax ID: 11-1111110
|
@@ -477,13 +477,13 @@ Check# Patient ID Last,First Charge Amt
|
|
477
477
|
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_id]).to eq('ZECM11111112')
|
478
478
|
end
|
479
479
|
it 'returns the Patient name' do
|
480
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_name]).to eq('LASTNAME,
|
480
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_name]).to eq('LASTNAME,')
|
481
481
|
end
|
482
482
|
it 'returns the Patient last name (titlized)' do
|
483
483
|
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_last_name]).to eq('Lastname')
|
484
484
|
end
|
485
485
|
it 'returns the Patient first name (titlized)' do
|
486
|
-
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_first_name]).to eq(
|
486
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_first_name]).to eq(nil)
|
487
487
|
end
|
488
488
|
it 'returns the Total charge amount (integer)' do
|
489
489
|
expect(@era[:checks]['201812215555555557'][:eras][0][:charge_amount]).to eq(4500)
|
data/spec/test_era.txt
CHANGED
@@ -68,7 +68,7 @@ Check# Patient ID Last,First Charge Amt
|
|
68
68
|
10/25/2017 92507 100.00 100.00 0.00 NO REMARKS
|
69
69
|
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
70
70
|
Check# Patient ID Last,First Charge Amt Payment Amt Accnt# Status Payer
|
71
|
-
201812215555555557 ZECM11111112 LASTNAME,
|
71
|
+
201812215555555557 ZECM11111112 LASTNAME, 45.00 0.00 M111 DENIED ABC HEALTHCARE EAST
|
72
72
|
ONE CIRCLE RD
|
73
73
|
SOMEWHERE,GA 11111
|
74
74
|
Tax ID: 11-1111110
|