era_835_parser 0.1.12 → 0.2.0

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: 1a4d95e601bfb1f71b439fe740842c2485accf92bbd7b890e922e5fa53d1b447
4
- data.tar.gz: 89f39835c344f1a9005245ac6712ec0c56dedbebe1cca0f92f608ad598b93ca8
3
+ metadata.gz: ee6d77b1fca8cdd052544e74a5932c84a01ead1ef7bca1c1270a7c9ba397b804
4
+ data.tar.gz: c0cb958f109b14f7cee14e1f80799e58ccdddbff95c5e7478747c21c07527fc7
5
5
  SHA512:
6
- metadata.gz: 489f980ede5fe53b11c9e83806343da7a891e333f3a4d21cdcb1e73918915938473f5cee500b9624874fd1c34e2f06c6d050b616756060dc8e4fd9f1eae21237
7
- data.tar.gz: 641a2ddd323d683091d047dd04c4b26e43bdbf4bc9151bbe28c0e8aa5bf72d958a329eeadf40cdcfe402c4bff51477d9f17f7f2ab337fc2e85986272ee4f9a3e
6
+ metadata.gz: c0ecd8a5bf21446057624dce13d87b26c7c6a8b370dbbdf4871280b35b056da3d05fe71c9813610f6f14af3f905924d89d3119a947bf696bdeb8ee34bf649e03
7
+ data.tar.gz: d5b0d016634ef6d2f177462f8cf8f9285e5b7ad820efa094f815e90fe2ec284a93680a5c1f1782ac0a61e872a2b5d879120af19849227c4c8e588a4eb4e7ae60
data/README.md CHANGED
@@ -38,17 +38,26 @@ if !era[:checks].nil?
38
38
  puts check[:payer_state] # Payer state
39
39
  puts check[:payer_zip_code] # Payer zip code
40
40
  puts check[:payer_tax_id] # Payer tax id
41
+ puts check[:payer_edi_id] # Payer EDI id
41
42
  puts check[:date] # Check date (string mm/dd/yyyy)
42
43
  if !check[:eras].nil?
43
44
  check[:eras].each do |era_counter, individual_era|
44
45
  puts individual_era[:era_text] # ERA text
45
- puts individual_era[:patient_id] # Patient ID
46
+ puts individual_era[:patient_id] # Patient ID / Member number
46
47
  puts individual_era[:patient_name] # Patient name
47
- puts individual_era[:patient_last_name] # Patient last name (titlized)
48
- puts individual_era[:patient_first_name] # Patient first name (titlized)
48
+ puts individual_era[:patient_last_name] # Patient last name (titleized)
49
+ puts individual_era[:patient_first_name] # Patient first name (titleized)
50
+ puts individual_era[:patient_middle_initial] # Patient middle initial
51
+ puts individual_era[:patient_suffix] # Patient suffix
52
+ puts individual_era[:subscriber_id] # Subscriber ID / Member number
53
+ puts individual_era[:subscriber_name] # Subscriber name
54
+ puts individual_era[:subscriber_last_name] # Subscriber last name (titleized)
55
+ puts individual_era[:subscriber_first_name] # Subscriber first name (titleized)
56
+ puts individual_era[:subscriber_middle_initial] # Subscriber middle initial
57
+ puts individual_era[:subscriber_suffix] # Subscriber suffix
49
58
  puts individual_era[:rendering_provider_name] # Rendering provider name
50
- puts individual_era[:rendering_provider_last_name] # Rendering provider last name (titlized)
51
- puts individual_era[:rendering_provider_first_name] # Rendering provider first name (titlized)
59
+ puts individual_era[:rendering_provider_last_name] # Rendering provider last name (titleized)
60
+ puts individual_era[:rendering_provider_first_name] # Rendering provider first name (titleized)
52
61
  puts individual_era[:charge_amount] # Total charge amount (integer)
53
62
  puts individual_era[:payment_amount] # Total payment amount (integer)
54
63
  puts individual_era[:account_number] # Account number
@@ -121,6 +130,11 @@ era = Era835Parser::Parser.new(file: string_io).parse
121
130
  4. Push to the branch (`git push origin my-new-feature`)
122
131
  5. Create a new Pull Request
123
132
 
133
+ ## Publishing
134
+
135
+ 1. gem build era_835_parser.gemspec
136
+ 2. gem push era_835_parser-x.x.x.gem
137
+
124
138
  ## License
125
139
 
126
140
  The MIT License (MIT)
@@ -143,4 +157,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
143
157
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
144
158
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
145
159
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
146
- THE SOFTWARE.
160
+ THE SOFTWARE.
@@ -57,6 +57,7 @@ module Era835Parser
57
57
  header_number_loop = false
58
58
  claim_payment_information_loop = false
59
59
  patient_loop = false
60
+ subscriber_loop = false
60
61
  rendering_provider_loop = false
61
62
  service_payment_information_loop = false
62
63
  bpr_amount = ''
@@ -844,56 +845,84 @@ module Era835Parser
844
845
  when 1
845
846
  # Patient Identifier Code
846
847
  # puts "Patient Identifier Code: #{element}"
847
- if element == "QC"
848
- patient_loop = true
849
- else
850
- patient_loop = false
851
- end
852
- if element == "82"
853
- rendering_provider_loop = true
854
- else
855
- rendering_provider_loop = false
856
- end
848
+ patient_loop = element == "QC"
849
+ subscriber_loop = element == 'IL'
850
+ rendering_provider_loop = element == "82"
857
851
  when 2
858
852
  # Entity Type Qualifier
859
853
  # puts "Entity Type Qualifier: #{element}"
860
854
  when 3
861
855
  # Patient Last Name
862
856
  # puts "Patient Last Name: #{element}"
863
- if claim_payment_information_loop && patient_loop
864
- individual_era[:patient_last_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
865
- end
866
- if claim_payment_information_loop && rendering_provider_loop
867
- individual_era[:rendering_provider_last_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
857
+ if claim_payment_information_loop
858
+ if patient_loop
859
+ individual_era[:patient_last_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
860
+ end
861
+ if subscriber_loop
862
+ individual_era[:subscriber_last_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
863
+ end
864
+ if rendering_provider_loop
865
+ individual_era[:rendering_provider_last_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
866
+ end
868
867
  end
869
868
  when 4
870
869
  # Patient First Name
871
870
  # puts "Patient First Name: #{element}"
872
- if claim_payment_information_loop && patient_loop
873
- individual_era[:patient_first_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
874
- individual_era[:patient_name] = individual_era[:patient_last_name].upcase + "," + individual_era[:patient_first_name].upcase
875
- end
876
- if claim_payment_information_loop && rendering_provider_loop
877
- individual_era[:rendering_provider_first_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
878
- individual_era[:rendering_provider_name] = individual_era[:rendering_provider_last_name].upcase + "," + individual_era[:rendering_provider_first_name].upcase
871
+ if claim_payment_information_loop
872
+ if patient_loop
873
+ individual_era[:patient_first_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
874
+ individual_era[:patient_name] = individual_era[:patient_last_name].upcase + "," + individual_era[:patient_first_name].upcase
875
+ end
876
+ if subscriber_loop
877
+ individual_era[:subscriber_first_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
878
+ individual_era[:subscriber_name] = individual_era[:subscriber_last_name].upcase + "," + individual_era[:subscriber_first_name].upcase
879
+ end
880
+ if rendering_provider_loop
881
+ individual_era[:rendering_provider_first_name] = element.strip.downcase.split(" ").map { |word| word.capitalize }.join(" ")
882
+ individual_era[:rendering_provider_name] = individual_era[:rendering_provider_last_name].upcase + "," + individual_era[:rendering_provider_first_name].upcase
883
+ end
879
884
  end
880
885
  when 5
881
886
  # Patient Middle Initial
882
887
  # puts "Patient Middle Initial: #{element}"
888
+ if claim_payment_information_loop
889
+ if patient_loop
890
+ individual_era[:patient_middle_initial] = element.strip
891
+ end
892
+ if subscriber_loop
893
+ individual_era[:subscriber_middle_initial] = element.strip
894
+ end
895
+ end
883
896
  when 6
884
897
  # Name Prefix
885
898
  # puts "Name Prefix: #{element}"
886
899
  when 7
887
900
  # Patient Name Suffix
888
901
  # puts "Patient Name Suffix: #{element}"
902
+ if claim_payment_information_loop
903
+ if patient_loop
904
+ individual_era[:patient_suffix] = element.strip
905
+ end
906
+ if subscriber_loop
907
+ individual_era[:subscriber_suffix] = element.strip
908
+ end
909
+ end
889
910
  when 8
890
911
  # Identification Code Qualifier
891
912
  # puts "Identification Code Qualifier: #{element}"
892
913
  when 9
893
- # Patient Member Number
914
+ # Patient Member Number or rendering provider NPI number
894
915
  # puts "Patient Member Number: #{element}"
895
- if claim_payment_information_loop && patient_loop
896
- individual_era[:patient_id] = element.strip
916
+ if claim_payment_information_loop
917
+ if patient_loop
918
+ individual_era[:patient_id] = element.strip
919
+ end
920
+ if subscriber_loop
921
+ individual_era[:subscriber_id] = element.strip
922
+ end
923
+ if rendering_provider_loop
924
+ individual_era[:rendering_provider_npi] = element.strip
925
+ end
897
926
  end
898
927
  end
899
928
  when "SVC"
@@ -1,3 +1,3 @@
1
1
  module Era835Parser
2
- VERSION = "0.1.12"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -78,10 +78,10 @@ RSpec.describe Era835Parser::Parser do
78
78
  it 'returns the Patient name' do
79
79
  expect(@era[:checks]['70408535'][:eras][0][:patient_name]).to eq('RABBIT,ROGER')
80
80
  end
81
- it 'returns the Patient last name (titlized)' do
81
+ it 'returns the Patient last name (titleized)' do
82
82
  expect(@era[:checks]['70408535'][:eras][0][:patient_last_name]).to eq('Rabbit')
83
83
  end
84
- it 'returns the Patient first name (titlized)' do
84
+ it 'returns the Patient first name (titleized)' do
85
85
  expect(@era[:checks]['70408535'][:eras][0][:patient_first_name]).to eq('Roger')
86
86
  end
87
87
  it 'returns the Total charge amount (integer)' do
@@ -93,7 +93,7 @@ RSpec.describe Era835Parser::Parser do
93
93
  it 'returns the Account number' do
94
94
  expect(@era[:checks]['70408535'][:eras][0][:account_number]).to eq('474623UB001CW0321')
95
95
  end
96
- it 'returns the Cliam status code' do
96
+ it 'returns the Claim status code' do
97
97
  expect(@era[:checks]['70408535'][:eras][0][:claim_status_code]).to eq('1')
98
98
  end
99
99
  it 'returns the Claim status code description' do
@@ -235,10 +235,10 @@ RSpec.describe Era835Parser::Parser do
235
235
  it 'returns the Patient name' do
236
236
  expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
237
237
  end
238
- it 'returns the Patient last name (titlized)' do
238
+ it 'returns the Patient last name (titleized)' do
239
239
  expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
240
240
  end
241
- it 'returns the Patient first name (titlized)' do
241
+ it 'returns the Patient first name (titleized)' do
242
242
  expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
243
243
  end
244
244
  it 'returns the Total charge amount (integer)' do
@@ -250,7 +250,7 @@ RSpec.describe Era835Parser::Parser do
250
250
  it 'returns the Account number' do
251
251
  expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
252
252
  end
253
- it 'returns the Cliam status code' do
253
+ it 'returns the Claim status code' do
254
254
  expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
255
255
  end
256
256
  it 'returns the Claim status code description' do
@@ -478,10 +478,10 @@ RSpec.describe Era835Parser::Parser do
478
478
  it 'returns the Patient name' do
479
479
  expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
480
480
  end
481
- it 'returns the Patient last name (titlized)' do
481
+ it 'returns the Patient last name (titleized)' do
482
482
  expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
483
483
  end
484
- it 'returns the Patient first name (titlized)' do
484
+ it 'returns the Patient first name (titleized)' do
485
485
  expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
486
486
  end
487
487
  it 'returns the Total charge amount (integer)' do
@@ -493,7 +493,7 @@ RSpec.describe Era835Parser::Parser do
493
493
  it 'returns the Account number' do
494
494
  expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
495
495
  end
496
- it 'returns the Cliam status code' do
496
+ it 'returns the Claim status code' do
497
497
  expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
498
498
  end
499
499
  it 'returns the Claim status code description' do
@@ -721,10 +721,10 @@ RSpec.describe Era835Parser::Parser do
721
721
  it 'returns the Patient name' do
722
722
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
723
723
  end
724
- it 'returns the Patient last name (titlized)' do
724
+ it 'returns the Patient last name (titleized)' do
725
725
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_last_name]).to eq('Dough')
726
726
  end
727
- it 'returns the Patient first name (titlized)' do
727
+ it 'returns the Patient first name (titleized)' do
728
728
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_first_name]).to eq('Mary')
729
729
  end
730
730
  it 'returns the Total charge amount (integer)' do
@@ -736,7 +736,277 @@ RSpec.describe Era835Parser::Parser do
736
736
  it 'returns the Account number' do
737
737
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:account_number]).to eq('200200964A52')
738
738
  end
739
- it 'returns the Cliam status code' do
739
+ it 'returns the Claim status code' do
740
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_status_code]).to eq('1')
741
+ end
742
+ it 'returns the Claim status code description' do
743
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:status]).to eq("PROCESSED AS PRIMARY")
744
+ end
745
+ it 'returns the Payer claim control number' do
746
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:payer_claim_control_number]).to eq('94151100100')
747
+ end
748
+ it 'returns the Claim statement period start' do
749
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_statement_period_start]).to eq(nil)
750
+ end
751
+ it 'returns the Claim statement period end' do
752
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_statement_period_end]).to eq(nil)
753
+ end
754
+
755
+ context 'Line item #0' do
756
+ it 'returns the Date of service (string mm/dd/yyyy)' do
757
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:service_date]).to eq("12/31/2010")
758
+ end
759
+ it 'returns the CPT code' do
760
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:cpt_code]).to eq("59430")
761
+ end
762
+ it 'returns the Charge amount (integer)' do
763
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:charge_amount]).to eq(121000)
764
+ end
765
+ it 'returns the Payment amount (integer)' do
766
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:payment_amount]).to eq(105786)
767
+ end
768
+ it 'returns the Total adjustment amount (integer)' do
769
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(15214)
770
+ end
771
+ it 'returns the Remark code' do
772
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:remark_code]).to eq(nil)
773
+ end
774
+ it 'returns the Remarks' do
775
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:remarks]).to eq(nil)
776
+ end
777
+ it 'returns the Reference number' do
778
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:reference_number]).to eq('0001')
779
+ end
780
+ context 'Adjustment group #0' do
781
+ it 'returns the Adjustment group' do
782
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq("Contractual Obligation")
783
+ end
784
+ it 'returns the Adjustment group code' do
785
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group_code]).to eq("CO")
786
+ end
787
+ it 'returns the Adjustment amount (integer)' do
788
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(3460)
789
+ end
790
+ it 'returns the Reason code' do
791
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:reason_code]).to eq('42')
792
+ end
793
+ it 'returns the Translated reason code' do
794
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:translated_reason_code]).to eq("Charges exceed our fee schedule or maximum allowable amount. (Use CARC 45)")
795
+ end
796
+ end
797
+ context 'Adjustment group #1' do
798
+ it 'returns the Adjustment group' do
799
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group]).to eq("Patient Responsibility")
800
+ end
801
+ it 'returns the Adjustment group code' do
802
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group_code]).to eq("PR")
803
+ end
804
+ it 'returns the Adjustment amount (integer)' do
805
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_amount]).to eq(11754)
806
+ end
807
+ it 'returns the Reason code' do
808
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:reason_code]).to eq('2')
809
+ end
810
+ it 'returns the Translated reason code' do
811
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:translated_reason_code]).to eq("Coinsurance Amount")
812
+ end
813
+ end
814
+ end
815
+ context 'Line item #1' do
816
+ it 'returns the Date of service (string mm/dd/yyyy)' do
817
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:service_date]).to eq("12/31/2010")
818
+ end
819
+ it 'returns the CPT code' do
820
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:cpt_code]).to eq("59440")
821
+ end
822
+ it 'returns the Charge amount (integer)' do
823
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:charge_amount]).to eq(89000)
824
+ end
825
+ it 'returns the Payment amount (integer)' do
826
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:payment_amount]).to eq(86500)
827
+ end
828
+ it 'returns the Total adjustment amount (integer)' do
829
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:total_adjustment_amount]).to eq(2500)
830
+ end
831
+ it 'returns the Remark code' do
832
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:remark_code]).to eq(nil)
833
+ end
834
+ it 'returns the Remarks' do
835
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:remarks]).to eq(nil)
836
+ end
837
+ it 'returns the Reference number' do
838
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:reference_number]).to eq('0002')
839
+ end
840
+ context 'Adjustment group #0' do
841
+ it 'returns the Adjustment group' do
842
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group]).to eq("Patient Responsibility")
843
+ end
844
+ it 'returns the Adjustment group code' do
845
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group_code]).to eq("PR")
846
+ end
847
+ it 'returns the Adjustment amount (integer)' do
848
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_amount]).to eq(2500)
849
+ end
850
+ it 'returns the Reason code' do
851
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:reason_code]).to eq('3')
852
+ end
853
+ it 'returns the Translated reason code' do
854
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:translated_reason_code]).to eq("Co-payment Amount")
855
+ end
856
+ end
857
+ end
858
+ context 'Line item #2' do
859
+ it 'returns the Date of service (string mm/dd/yyyy)' do
860
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:service_date]).to eq("12/31/2010")
861
+ end
862
+ it 'returns the CPT code' do
863
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:cpt_code]).to eq("59426")
864
+ end
865
+ it 'returns the Charge amount (integer)' do
866
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:charge_amount]).to eq(74200)
867
+ end
868
+ it 'returns the Payment amount (integer)' do
869
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:payment_amount]).to eq(74200)
870
+ end
871
+ it 'returns the Total adjustment amount (integer)' do
872
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:total_adjustment_amount]).to eq(nil)
873
+ end
874
+ it 'returns the Remark code' do
875
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:remark_code]).to eq(nil)
876
+ end
877
+ it 'returns the Remarks' do
878
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:remarks]).to eq(nil)
879
+ end
880
+ it 'returns the Reference number' do
881
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:reference_number]).to eq('0003')
882
+ end
883
+ end
884
+ end
885
+ end
886
+ end
887
+
888
+ context 'example_5.835' do
889
+ before :all do
890
+ @era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/example_5.835").parse
891
+ end
892
+
893
+ context 'Aggregate totals' do
894
+ it 'returns the addressed to' do
895
+ expect(@era[:addressed_to]).to eq(nil)
896
+ end
897
+ it 'returns the correct number of checks' do
898
+ expect(@era[:checks].count).to eq(1)
899
+ end
900
+ it 'returns the correct number of adjustments' do
901
+ expect(@era[:adjustments]).to eq(nil)
902
+ end
903
+ it 'returns the correct number of eras' do
904
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras].count).to eq(1)
905
+ end
906
+ it 'returns the correct number of line items' do
907
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items].count).to eq(3)
908
+ end
909
+ it 'returns the correct number of adjustment groups' do
910
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(2)
911
+ end
912
+ it 'returns the correct number of adjustment groups' do
913
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups].count).to eq(1)
914
+ end
915
+ it 'returns the correct number of adjustment groups' do
916
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:adjustment_groups]).to eq(nil)
917
+ end
918
+ end
919
+
920
+ context 'Check #70408535' do
921
+ it 'returns the check number' do
922
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:check_number]).to eq('0123456789012345678901234567890123456789')
923
+ end
924
+ it 'returns the amount' do
925
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:amount]).to eq(192286)
926
+ end
927
+ it 'returns the number of claims' do
928
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:number_of_claims]).to eq(1)
929
+ end
930
+ it 'returns the NPI or Tax ID of payee' do
931
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:npi_tax_id]).to eq('0987654321')
932
+ end
933
+ it 'returns the Check payee' do
934
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payee]).to eq('XYZ HEALTHCARE CORPORATION')
935
+ end
936
+ it 'returns the Payer name' do
937
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_name]).to eq('BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA')
938
+ end
939
+ it 'returns the Payer address' do
940
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_address]).to eq('P O BOX 2291')
941
+ end
942
+ it 'returns the Payer city' do
943
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_city]).to eq('DURHAM')
944
+ end
945
+ it 'returns the Payer state' do
946
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_state]).to eq('NC')
947
+ end
948
+ it 'returns the Payer zip code' do
949
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_zip_code]).to eq('27702')
950
+ end
951
+ it 'returns the Payer tax id' do
952
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_tax_id]).to eq('60-894904')
953
+ end
954
+ it 'returns the Payer EDI id' do
955
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_edi_id]).to eq(nil)
956
+ end
957
+ it 'returns the Check date (string mm/dd/yyyy)' do
958
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:date]).to eq('01/08/2011')
959
+ end
960
+ context 'ERA #0' do
961
+ it 'returns the Patient ID' do
962
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_id]).to eq(nil)
963
+ end
964
+ it 'returns the Patient name' do
965
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
966
+ end
967
+ it 'returns the Patient last name (titleized)' do
968
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_last_name]).to eq('Dough')
969
+ end
970
+ it 'returns the Patient first name (titleized)' do
971
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_first_name]).to eq('Mary')
972
+ end
973
+ it 'returns the Subscriber last name (titleized)' do
974
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_first_name]).to eq('Marty')
975
+ end
976
+ it 'returns the Subscriber last name (titleized)' do
977
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_last_name]).to eq('Dough')
978
+ end
979
+ it 'returns the Subscriber name (titleized)' do
980
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_name]).to eq('DOUGH,MARTY')
981
+ end
982
+ it 'returns the Subscriber middle initial' do
983
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_middle_initial]).to eq('L')
984
+ end
985
+ it 'returns the Subscriber suffix' do
986
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_suffix]).to eq('Sr.')
987
+ end
988
+ it 'returns the Subscriber ID' do
989
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_id]).to eq('YPB123456789009')
990
+ end
991
+ it 'returns the rendering provider last_name (titleized)' do
992
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:rendering_provider_last_name]).to eq('Jones')
993
+ end
994
+ it 'returns the rendering provider first name (titleized)' do
995
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:rendering_provider_first_name]).to eq('Alice')
996
+ end
997
+ it 'returns the rendering provider NPI' do
998
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:rendering_provider_npi]).to eq('1116359906')
999
+ end
1000
+ it 'returns the Total charge amount (integer)' do
1001
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:charge_amount]).to eq(210000)
1002
+ end
1003
+ it 'returns the Total payment amount (integer)' do
1004
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:payment_amount]).to eq(192286)
1005
+ end
1006
+ it 'returns the Account number' do
1007
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:account_number]).to eq('200200964A52')
1008
+ end
1009
+ it 'returns the Claim status code' do
740
1010
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_status_code]).to eq('1')
741
1011
  end
742
1012
  it 'returns the Claim status code description' do
@@ -1002,10 +1272,10 @@ Check# Patient ID Last,First Charge Amt
1002
1272
  it 'returns the Patient name' do
1003
1273
  expect(@era[:checks]['201812215555555555'][:eras][0][:patient_name]).to eq('DOE JR,DAVIS')
1004
1274
  end
1005
- it 'returns the Patient last name (titlized)' do
1275
+ it 'returns the Patient last name (titleized)' do
1006
1276
  expect(@era[:checks]['201812215555555555'][:eras][0][:patient_last_name]).to eq('Doe Jr')
1007
1277
  end
1008
- it 'returns the Patient first name (titlized)' do
1278
+ it 'returns the Patient first name (titleized)' do
1009
1279
  expect(@era[:checks]['201812215555555555'][:eras][0][:patient_first_name]).to eq('Davis')
1010
1280
  end
1011
1281
  it 'returns the Total charge amount (integer)' do
@@ -1133,10 +1403,10 @@ Check# Patient ID Last,First Charge Amt
1133
1403
  it 'returns the Patient name' do
1134
1404
  expect(@era[:checks]['201812215555555556'][:eras][0][:patient_name]).to eq('DOE,JANE')
1135
1405
  end
1136
- it 'returns the Patient last name (titlized)' do
1406
+ it 'returns the Patient last name (titleized)' do
1137
1407
  expect(@era[:checks]['201812215555555556'][:eras][0][:patient_last_name]).to eq('Doe')
1138
1408
  end
1139
- it 'returns the Patient first name (titlized)' do
1409
+ it 'returns the Patient first name (titleized)' do
1140
1410
  expect(@era[:checks]['201812215555555556'][:eras][0][:patient_first_name]).to eq('Jane')
1141
1411
  end
1142
1412
  it 'returns the Total charge amount (integer)' do
@@ -1248,10 +1518,10 @@ Check# Patient ID Last,First Charge Amt
1248
1518
  it 'returns the Patient name' do
1249
1519
  expect(@era[:checks]['201812215555555556'][:eras][1][:patient_name]).to eq('SMITH,JOSEPH')
1250
1520
  end
1251
- it 'returns the Patient last name (titlized)' do
1521
+ it 'returns the Patient last name (titleized)' do
1252
1522
  expect(@era[:checks]['201812215555555556'][:eras][1][:patient_last_name]).to eq('Smith')
1253
1523
  end
1254
- it 'returns the Patient first name (titlized)' do
1524
+ it 'returns the Patient first name (titleized)' do
1255
1525
  expect(@era[:checks]['201812215555555556'][:eras][1][:patient_first_name]).to eq('Joseph')
1256
1526
  end
1257
1527
  it 'returns the Total charge amount (integer)' do
@@ -1363,10 +1633,10 @@ Check# Patient ID Last,First Charge Amt
1363
1633
  it 'returns the Patient name' do
1364
1634
  expect(@era[:checks]['201812215555555557'][:eras][0][:patient_name]).to eq('LASTNAME,')
1365
1635
  end
1366
- it 'returns the Patient last name (titlized)' do
1636
+ it 'returns the Patient last name (titleized)' do
1367
1637
  expect(@era[:checks]['201812215555555557'][:eras][0][:patient_last_name]).to eq('Lastname')
1368
1638
  end
1369
- it 'returns the Patient first name (titlized)' do
1639
+ it 'returns the Patient first name (titleized)' do
1370
1640
  expect(@era[:checks]['201812215555555557'][:eras][0][:patient_first_name]).to eq(nil)
1371
1641
  end
1372
1642
  it 'returns the Total charge amount (integer)' do
@@ -1450,10 +1720,10 @@ Check# Patient ID Last,First Charge Amt
1450
1720
  it 'returns the Patient name' do
1451
1721
  expect(@era[:checks]['201812215555555557'][:eras][1][:patient_name]).to eq('WORLD,HELLO')
1452
1722
  end
1453
- it 'returns the Patient last name (titlized)' do
1723
+ it 'returns the Patient last name (titleized)' do
1454
1724
  expect(@era[:checks]['201812215555555557'][:eras][1][:patient_last_name]).to eq('World')
1455
1725
  end
1456
- it 'returns the Patient first name (titlized)' do
1726
+ it 'returns the Patient first name (titleized)' do
1457
1727
  expect(@era[:checks]['201812215555555557'][:eras][1][:patient_first_name]).to eq('Hello')
1458
1728
  end
1459
1729
  it 'returns the Total charge amount (integer)' do
@@ -0,0 +1,34 @@
1
+ ST*835*1234~
2
+ BPR*I*1922.86*C*CHK************20110108~
3
+ TRN*1*0123456789012345678901234567890123456789*560894904~
4
+ REF*F2*LCLA438D~
5
+ DTM*405*20110104~
6
+ N1*PR*BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA~
7
+ N3*P O BOX 2291~
8
+ N4*DURHAM*NC*27702~
9
+ PER*CX*TE*8005554844~
10
+ N1*PE*XYZ HEALTHCARE CORPORATION*XX*0987654321~
11
+ N3*P O BOX XYZ~
12
+ N4*CHARLOTTE*NC*28234~
13
+ REF*TJ*123456789~
14
+ LX*1~
15
+ CLP*200200964A52*1*2100*1922.86*142.54*15*94151100100~
16
+ NM1*QC*1*Dough*Mary~
17
+ NM1*IL*1*Dough*Marty*L**Sr.*MI* YPB123456789009~
18
+ NM1*82*1*Jones*Alice****XX*1116359906~
19
+ DTM*050*20110103~
20
+ SVC*HC:59430*1210*1057.86**1*HC:59410~
21
+ DTM*472*20101231~
22
+ CAS*CO*42*34.6~
23
+ CAS*PR*2*117.54~
24
+ REF*6R*0001~
25
+ AMT*B6*1175.4~
26
+ SVC*HC:59440*890*865**1*HC:59410~
27
+ DTM*472*20101231~
28
+ CAS*PR*3*25~
29
+ REF*6R*0002~
30
+ SVC*HC:59426*742*742**1~
31
+ DTM*472*20101231~
32
+ REF*6R*0003~
33
+ AMT*B6*742~
34
+ SE*33*1234~
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.12
4
+ version: 0.2.0
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: 2023-09-13 00:00:00.000000000 Z
11
+ date: 2026-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,6 +79,7 @@ files:
79
79
  - spec/example_2.835
80
80
  - spec/example_3.835
81
81
  - spec/example_4.835
82
+ - spec/example_5.835
82
83
  - spec/spec_helper.rb
83
84
  - spec/test_era.txt
84
85
  homepage: https://github.com/diasks2/era_835_parser
@@ -110,5 +111,6 @@ test_files:
110
111
  - spec/example_2.835
111
112
  - spec/example_3.835
112
113
  - spec/example_4.835
114
+ - spec/example_5.835
113
115
  - spec/spec_helper.rb
114
116
  - spec/test_era.txt