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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab44ebad1412d62fad23183836733396b192dc70012ce30076070941899e7236
4
- data.tar.gz: 67dcf7c109bc282fda67f2a497bb5b40251262b6e8f29c0588b4f14b1cc77f94
3
+ metadata.gz: 9c61cb6ee43b26af6f71b0838106a844d8647f8337c72da1fda4f8bc23ad1529
4
+ data.tar.gz: 832b212be0290b44d3408577368dc291bb544d0a2c0112f733d1a4301e615e34
5
5
  SHA512:
6
- metadata.gz: 643c5464b9f0b171cdb812632fc7116ab9689a6cedd83486e243f7e5a7c7bac76114959d8e401b46bbdf4a7b415bdeebdcf54c6abe91c9822b09197c5908f6bf
7
- data.tar.gz: 11527e47a131331d86893e2a37e57994a0a222393aa64f3025eb2a1f615c98da1df53b84bbc56c33641c0716a15be3b3dcb90a9aeddf0db9b2cb3858233fc779
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?
@@ -1,3 +1,3 @@
1
1
  module Era835Parser
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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,FIRST 45.00 0.00 M111 DENIED ABC HEALTHCARE EAST
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,FIRST')
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('First')
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,FIRST 45.00 0.00 M111 DENIED ABC HEALTHCARE EAST
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
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias