era_835_parser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/era_835_parser.gemspec +1 -1
- data/lib/era_835_parser/parser.rb +4 -0
- data/lib/era_835_parser/version.rb +1 -1
- data/spec/era_835_parser_spec.rb +44 -41
- metadata +5 -6
- data/.travis.yml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 731ca964eb5c6e01d791525fe34151a2eb15e1154f2c3e9ca9726ee9264184c8
|
4
|
+
data.tar.gz: bf55ebe8c6004a2c4555643d73c42589fb064edbfc5870808da76e0738536865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a5948ab0425ab4d72c4b31f03a4300b3759a7ef6619f67d2444baa6fcae83e9da70f1c015e68d6c140cf9c8b4b906d15ffa3a421bc02fab620ba2dc8d20456b
|
7
|
+
data.tar.gz: 7c49002c06b30bf7a78868837e311b4e00b373af56051d7fcf9292f231ff74f4320350d8c1d72e0e64f0b163a81e83a927fcbbf5bca3e36a8475946895b30992
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Electronic Remittance Advice (ERA) 835 parser
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/era_835_parser.svg)](http://badge.fury.io/rb/era_835_parser) [![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/era_835_parser.svg)](http://badge.fury.io/rb/era_835_parser) [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/diasks2/era_835_parser/blob/master/LICENSE.txt)
|
4
4
|
|
5
5
|
This is a gem to parse ERAs, the electronic equivalent of a paper Explanation of Benefits (EOB). An electronic remittance advice (ERA) is an electronic data interchange (EDI) version of a medical insurance payment explanation. It provides details about providers' claims payment, and if the claims are denied, it would then contain the required explanations.
|
6
6
|
|
@@ -22,6 +22,8 @@ gem 'era_835_parser'
|
|
22
22
|
```ruby
|
23
23
|
era = Era835Parser::Parser.new(file_path: '/Desktop/era.txt').parse
|
24
24
|
|
25
|
+
puts era[:addressed_to] # The person/name the ERA is addressed to
|
26
|
+
|
25
27
|
# The output is grouped by check number with each claim grouped under its respective check
|
26
28
|
era[:checks].each do |check_number, check|
|
27
29
|
puts check[:check_number] # Check number
|
data/era_835_parser.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Kevin S. Dias"]
|
10
10
|
spec.email = ["diasks2@gmail.com"]
|
11
11
|
spec.summary = %q{Electronic Remittance Advice (ERA) 835 parser}
|
12
|
-
spec.description = %q{This is a gem to parse ERAs, the electronic equivalent of a paper Explanation of Benefits (EOB). An electronic remittance advice (ERA) is an electronic data interchange (EDI) version of a medical insurance payment explanation. It provides details about providers' claims payment, and if the claims are denied, it would then contain the required explanations.}
|
12
|
+
spec.description = %q{This is a gem to parse ERAs, the electronic equivalent of a paper Explanation of Benefits (EOB) used in the medical industry. An electronic remittance advice (ERA) is an electronic data interchange (EDI) version of a medical insurance payment explanation. It provides details about providers' claims payment, and if the claims are denied, it would then contain the required explanations.}
|
13
13
|
spec.homepage = "https://github.com/diasks2/era_835_parser"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -37,6 +37,10 @@ module Era835Parser
|
|
37
37
|
|
38
38
|
open(file_path).readlines.each do |line|
|
39
39
|
|
40
|
+
if line.include?("Dear:")
|
41
|
+
era[:addressed_to] = line.gsub("Dear:", "").strip
|
42
|
+
end
|
43
|
+
|
40
44
|
if line !~ /={10,}/i && adjustments_start == true
|
41
45
|
adjustment = Hash.new
|
42
46
|
adjustment[:adjustment_date] = /\d+\/\d+\/\d+/.match(line)[0].strip if !/\d+\/\d+\/\d+/.match(line).nil?
|
data/spec/era_835_parser_spec.rb
CHANGED
@@ -7,49 +7,52 @@ RSpec.describe Era835Parser::Parser do
|
|
7
7
|
@era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/test_era.txt").parse
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
context 'Aggregate totals' do
|
11
|
+
it 'returns the addressed to' do
|
12
|
+
expect(@era[:addressed_to]).to eq('Jane Doe')
|
13
|
+
end
|
14
|
+
it 'returns the correct number of checks' do
|
15
|
+
expect(@era[:checks].count).to eq(3)
|
16
|
+
end
|
17
|
+
it 'returns the correct number of adjustments' do
|
18
|
+
expect(@era[:adjustments].count).to eq(3)
|
19
|
+
end
|
17
20
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
21
|
+
it 'returns the correct number of line items' do
|
22
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items].count).to eq(1)
|
23
|
+
end
|
24
|
+
it 'returns the correct number of line items' do
|
25
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items].count).to eq(2)
|
26
|
+
end
|
27
|
+
it 'returns the correct number of line items' do
|
28
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items].count).to eq(1)
|
29
|
+
end
|
30
|
+
it 'returns the correct number of line items' do
|
31
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items].count).to eq(1)
|
32
|
+
end
|
33
|
+
it 'returns the correct number of line items' do
|
34
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items].count).to eq(1)
|
35
|
+
end
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
37
|
+
it 'returns the correct number of adjustment groups' do
|
38
|
+
expect(@era[:checks]['201812215555555555'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(1)
|
39
|
+
end
|
40
|
+
it 'returns the correct number of adjustment groups' do
|
41
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(1)
|
42
|
+
end
|
43
|
+
it 'returns the correct number of adjustment groups' do
|
44
|
+
expect(@era[:checks]['201812215555555556'][:eras][0][:line_items][1][:adjustment_groups].count).to eq(1)
|
45
|
+
end
|
46
|
+
it 'returns the correct number of adjustment groups' do
|
47
|
+
expect(@era[:checks]['201812215555555556'][:eras][1][:line_items][0][:adjustment_groups]).to eq(nil)
|
48
|
+
end
|
49
|
+
it 'returns the correct number of adjustment groups' do
|
50
|
+
expect(@era[:checks]['201812215555555557'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(1)
|
51
|
+
end
|
52
|
+
it 'returns the correct number of adjustment groups' do
|
53
|
+
expect(@era[:checks]['201812215555555557'][:eras][1][:line_items][0][:adjustment_groups].count).to eq(2)
|
54
|
+
end
|
55
|
+
end
|
53
56
|
|
54
57
|
context 'Check #201812215555555555' do
|
55
58
|
it 'returns the check number' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: era_835_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin S. Dias
|
@@ -53,10 +53,10 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: This is a gem to parse ERAs, the electronic equivalent of a paper Explanation
|
56
|
-
of Benefits (EOB)
|
57
|
-
(EDI) version of a medical insurance payment
|
58
|
-
providers' claims payment, and if the claims
|
59
|
-
required explanations.
|
56
|
+
of Benefits (EOB) used in the medical industry. An electronic remittance advice
|
57
|
+
(ERA) is an electronic data interchange (EDI) version of a medical insurance payment
|
58
|
+
explanation. It provides details about providers' claims payment, and if the claims
|
59
|
+
are denied, it would then contain the required explanations.
|
60
60
|
email:
|
61
61
|
- diasks2@gmail.com
|
62
62
|
executables: []
|
@@ -65,7 +65,6 @@ extra_rdoc_files: []
|
|
65
65
|
files:
|
66
66
|
- ".gitignore"
|
67
67
|
- ".rspec"
|
68
|
-
- ".travis.yml"
|
69
68
|
- CODE_OF_CONDUCT.md
|
70
69
|
- Gemfile
|
71
70
|
- LICENSE.txt
|
data/.travis.yml
DELETED
File without changes
|