era_835_parser 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5834fa9dfb4e9d9353377d74720b0bed60fab1c10213822bb60e2231bad76146
4
- data.tar.gz: 862741c40d5789116242254e87df57e586733298897f31aecfe5578ca4032a07
3
+ metadata.gz: dce7c7dccaaa4ab3ab919104405f040e1e4136b034b24a03d4b210e93bd26258
4
+ data.tar.gz: 37686d6f2e59f1fcf13c1882cb0dddeca71cd6ff28969d5b5f9ee68ad2d876c1
5
5
  SHA512:
6
- metadata.gz: 2a856795afdc964b09d70267e0fa47aa8ebc56242d6907a421d15ee16a738c39df629cdfe034a4a715ab83dbc556ed8ad579c42bf1fa5a0e92504e4466b170bf
7
- data.tar.gz: b13a0efe21fbac317bde706fb3c47c029c6b4e10bd775c27e5e4b1edaba1b0e9a674c31f6324145c8e2dcb3fca0f6b5b01f26ee34500902f05e0cbc0c1864db5
6
+ metadata.gz: fe824f0c5bed8ec29263d6d48240bff8f1d4a2b9b3254eb48efd05c0d975b2e181676ae20017971b24f52669196414feb6b80e5fd2848bb8ef96fe827eedf657
7
+ data.tar.gz: d3d79fa935feced6fc56d60beaf6ddd67af5b470872c26afcaa318621f82c888b229ec09e37ee1df9b0cebd2636412031dcafc1703ac0ca40cd9f2a9457717e7
@@ -56,6 +56,10 @@ module Era835Parser
56
56
  service_payment_information_loop = false
57
57
  bpr_amount = ''
58
58
  bpr_date = ''
59
+ receive_date = false
60
+ claim_date_start = false
61
+ claim_date_end = false
62
+ service_date = false
59
63
 
60
64
  open(file_path).readlines.each do |line|
61
65
  if line.include?("ISA")
@@ -496,12 +500,27 @@ module Era835Parser
496
500
  when 1
497
501
  # Date Time Qualifier
498
502
  # puts "Date Time Qualifier: #{element}"
503
+ if element == "050"
504
+ receive_date = true
505
+ elsif element == "232"
506
+ claim_date_start = true
507
+ elsif element == "233"
508
+ claim_date_end = true
509
+ elsif element == "472"
510
+ service_date = true
511
+ end
499
512
  when 2
500
513
  # Service Date
501
514
  # puts "Service Date: #{element}"
502
- if service_payment_information_loop
515
+ if service_date
503
516
  individual_line_item[:service_date] = element.strip[4..5] + "/" + element.strip[6..7] + "/" + element.strip[0..3]
504
- service_payment_information_loop = false
517
+ receive_date = false
518
+ elsif claim_date_start
519
+ individual_era[:claim_statement_period_start] = element.strip[4..5] + "/" + element.strip[6..7] + "/" + element.strip[0..3]
520
+ claim_date_start = false
521
+ elsif claim_date_end
522
+ individual_era[:claim_statement_period_end] = element.strip[4..5] + "/" + element.strip[6..7] + "/" + element.strip[0..3]
523
+ claim_date_end = false
505
524
  end
506
525
  end
507
526
  when "N4"
@@ -572,6 +591,7 @@ module Era835Parser
572
591
  when "CLP"
573
592
  svc_counter = 0
574
593
  claim_payment_information_loop = true
594
+ service_payment_information_loop = true if individual_line_item[:service_date].nil?
575
595
  case index
576
596
  when 1
577
597
  if individual_line_item != {}
@@ -581,6 +601,7 @@ module Era835Parser
581
601
  line_items[line_items.count] = individual_line_item
582
602
  end
583
603
  individual_era[:line_items] = line_items
604
+ individual_line_item = Hash.new
584
605
  end
585
606
  individual_era = Hash.new
586
607
  line_items = Hash.new
@@ -786,9 +807,6 @@ module Era835Parser
786
807
  individual_line_item[:adjustment_groups].each do |k,v|
787
808
  adjustment_amount_tally += v[:adjustment_amount]
788
809
  end
789
- # puts "^^^^^^^^^"
790
- # puts individual_line_item[:adjustment_groups]
791
- # puts "^^^^^^^^^"
792
810
  individual_line_item[:total_adjustment_amount] = adjustment_amount_tally
793
811
  when 4
794
812
  # QUANTITY
@@ -871,10 +889,10 @@ module Era835Parser
871
889
  line_items[line_items.count] = individual_line_item
872
890
  end
873
891
  individual_era[:line_items] = line_items
892
+ individual_line_item = Hash.new
874
893
  end
875
- individual_line_item = Hash.new
876
894
  adjustment_groups = Hash.new
877
- service_payment_information_loop = true
895
+ service_payment_information_loop = true if individual_line_item[:service_date].nil?
878
896
  element.split(":").each_with_index do |subelement, i|
879
897
  case i
880
898
  when 0
@@ -1,3 +1,3 @@
1
1
  module Era835Parser
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -101,10 +101,10 @@ RSpec.describe Era835Parser::Parser do
101
101
  expect(@era[:checks]['70408535'][:eras][0][:payer_claim_control_number]).to eq('80209000000')
102
102
  end
103
103
  it 'returns the Claim statement period start' do
104
- expect(@era[:checks]['70408535'][:eras][0][:claim_statement_period_start]).to eq(nil)
104
+ expect(@era[:checks]['70408535'][:eras][0][:claim_statement_period_start]).to eq("03/07/2010")
105
105
  end
106
106
  it 'returns the Claim statement period end' do
107
- expect(@era[:checks]['70408535'][:eras][0][:claim_statement_period_end]).to eq(nil)
107
+ expect(@era[:checks]['70408535'][:eras][0][:claim_statement_period_end]).to eq("03/10/2010")
108
108
  end
109
109
 
110
110
  context 'Line item #0' do
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.1.3
4
+ version: 0.1.4
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-28 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler