era_835_parser 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/era_835_parser/parser.rb +3 -3
- data/lib/era_835_parser/version.rb +1 -1
- data/spec/era_835_parser_spec.rb +1 -1
- 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: ab44ebad1412d62fad23183836733396b192dc70012ce30076070941899e7236
|
4
|
+
data.tar.gz: 67dcf7c109bc282fda67f2a497bb5b40251262b6e8f29c0588b4f14b1cc77f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 643c5464b9f0b171cdb812632fc7116ab9689a6cedd83486e243f7e5a7c7bac76114959d8e401b46bbdf4a7b415bdeebdcf54c6abe91c9822b09197c5908f6bf
|
7
|
+
data.tar.gz: 11527e47a131331d86893e2a37e57994a0a222393aa64f3025eb2a1f615c98da1df53b84bbc56c33641c0716a15be3b3dcb90a9aeddf0db9b2cb3858233fc779
|
data/README.md
CHANGED
@@ -68,7 +68,7 @@ era[:checks].each do |check_number, check|
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# View any adjustments
|
71
|
-
era[:adjustments].each do |adjustment|
|
71
|
+
era[:adjustments].each do |adjustment_counter, adjustment|
|
72
72
|
puts adjustment[:adjustment_date] # Adjustment date (string mm/dd/yyyy)
|
73
73
|
puts adjustment[:provider_id] # Provider ID
|
74
74
|
puts adjustment[:reference_id] # Reference ID
|
@@ -47,9 +47,9 @@ module Era835Parser
|
|
47
47
|
adjustment = Hash.new
|
48
48
|
adjustment[:adjustment_date] = /\d+\/\d+\/\d+/.match(line)[0].strip if !/\d+\/\d+\/\d+/.match(line).nil?
|
49
49
|
adjustment[:provider_id] = /\d+\/\d+\/\d+\s+\d+\s+[^\s]+/.match(line)[0].split(" ")[1].strip if !/\d+\/\d+\/\d+\s+\d+\s+[^\s]+/.match(line).nil?
|
50
|
-
adjustment[:reference_id] = /\d+\/\d+\/\d+\s
|
51
|
-
adjustment[:adjustment_amount] = (/\d+\/\d+\/\d+\s
|
52
|
-
adjustment[:reason] = line.gsub(/\d+\/\d+\/\d+\s
|
50
|
+
adjustment[:reference_id] = /\d+\/\d+\/\d+\s+[^\.]+/.match(line)[0].split(" ").each_with_index.map { |x,i| (/\d+\/\d+\/\d+\s+[^\.]+/.match(line)[0].split(" ").count - 1) > i && i > 1 ? x.strip : '' }.join(" ").strip if !/\d+\/\d+\/\d+\s+[^\.]+/.match(line).nil?
|
51
|
+
adjustment[:adjustment_amount] = (/\d+\/\d+\/\d+\s+[^\.]+\.\d+/.match(line)[0].split(" ")[-1].strip.to_f * 100).to_i if !/\d+\/\d+\/\d+\s+[^\.]+\.\d+/.match(line).nil?
|
52
|
+
adjustment[:reason] = line.gsub(/\d+\/\d+\/\d+\s+[^\.]+\.\d+/, "").strip
|
53
53
|
adjustments[adjustment_counter] = adjustment
|
54
54
|
adjustment_counter += 1
|
55
55
|
end
|
data/spec/era_835_parser_spec.rb
CHANGED
@@ -701,7 +701,7 @@ Check# Patient ID Last,First Charge Amt
|
|
701
701
|
expect(@era[:adjustments][1][:provider_id]).to eq('1111111112')
|
702
702
|
end
|
703
703
|
it 'returns Reference ID' do
|
704
|
-
expect(@era[:adjustments][1][:reference_id]).to eq('
|
704
|
+
expect(@era[:adjustments][1][:reference_id]).to eq('20170514 1710101112 06')
|
705
705
|
end
|
706
706
|
it 'returns Adjustment amount (integer)' do
|
707
707
|
expect(@era[:adjustments][1][:adjustment_amount]).to eq(-3344)
|
data/spec/test_era.txt
CHANGED
@@ -12,7 +12,7 @@ Your Claims have been adjudicated by the Payer. Electronic Payment / Advise info
|
|
12
12
|
Adjustment Date Provider ID Reference ID Adjustment Amt Reason
|
13
13
|
========================================================================================================================================================
|
14
14
|
12/30/2018 1111111111 BBBBBBVP31M0 -42.81 Overpayment Recover
|
15
|
-
12/31/2018 1111111112
|
15
|
+
12/31/2018 1111111112 20170514 1710101112 06 -33.44 Overpayment Recover
|
16
16
|
12/30/2018 1111111113 BBBBBBVP31M2 33.45 Overpayment Recover
|
17
17
|
========================================================================================================================================================
|
18
18
|
|