era_835_parser 0.1.12 → 0.2.1

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.
@@ -35,6 +35,15 @@ RSpec.describe Era835Parser::Parser do
35
35
  it 'returns the check number' do
36
36
  expect(@era[:checks]['70408535'][:check_number]).to eq('70408535')
37
37
  end
38
+ it 'returns the transaction handling code' do
39
+ expect(@era[:checks]['70408535'][:transaction_handling_code]).to eq('I')
40
+ end
41
+ it 'returns the credit debit flag' do
42
+ expect(@era[:checks]['70408535'][:credit_debit_flag]).to eq('C')
43
+ end
44
+ it 'returns the payment method code' do
45
+ expect(@era[:checks]['70408535'][:payment_method_code]).to eq('CHK')
46
+ end
38
47
  it 'returns the amount' do
39
48
  expect(@era[:checks]['70408535'][:amount]).to eq(1509646)
40
49
  end
@@ -78,10 +87,10 @@ RSpec.describe Era835Parser::Parser do
78
87
  it 'returns the Patient name' do
79
88
  expect(@era[:checks]['70408535'][:eras][0][:patient_name]).to eq('RABBIT,ROGER')
80
89
  end
81
- it 'returns the Patient last name (titlized)' do
90
+ it 'returns the Patient last name (titleized)' do
82
91
  expect(@era[:checks]['70408535'][:eras][0][:patient_last_name]).to eq('Rabbit')
83
92
  end
84
- it 'returns the Patient first name (titlized)' do
93
+ it 'returns the Patient first name (titleized)' do
85
94
  expect(@era[:checks]['70408535'][:eras][0][:patient_first_name]).to eq('Roger')
86
95
  end
87
96
  it 'returns the Total charge amount (integer)' do
@@ -93,7 +102,7 @@ RSpec.describe Era835Parser::Parser do
93
102
  it 'returns the Account number' do
94
103
  expect(@era[:checks]['70408535'][:eras][0][:account_number]).to eq('474623UB001CW0321')
95
104
  end
96
- it 'returns the Cliam status code' do
105
+ it 'returns the Claim status code' do
97
106
  expect(@era[:checks]['70408535'][:eras][0][:claim_status_code]).to eq('1')
98
107
  end
99
108
  it 'returns the Claim status code description' do
@@ -192,6 +201,15 @@ RSpec.describe Era835Parser::Parser do
192
201
  it 'returns the check number' do
193
202
  expect(@era[:checks]['02790758'][:check_number]).to eq('02790758')
194
203
  end
204
+ it 'returns the transaction handling code' do
205
+ expect(@era[:checks]['02790758'][:transaction_handling_code]).to eq('I')
206
+ end
207
+ it 'returns the credit debit flag' do
208
+ expect(@era[:checks]['02790758'][:credit_debit_flag]).to eq('C')
209
+ end
210
+ it 'returns the payment method code' do
211
+ expect(@era[:checks]['02790758'][:payment_method_code]).to eq('CHK')
212
+ end
195
213
  it 'returns the amount' do
196
214
  expect(@era[:checks]['02790758'][:amount]).to eq(192286)
197
215
  end
@@ -235,10 +253,10 @@ RSpec.describe Era835Parser::Parser do
235
253
  it 'returns the Patient name' do
236
254
  expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
237
255
  end
238
- it 'returns the Patient last name (titlized)' do
256
+ it 'returns the Patient last name (titleized)' do
239
257
  expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
240
258
  end
241
- it 'returns the Patient first name (titlized)' do
259
+ it 'returns the Patient first name (titleized)' do
242
260
  expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
243
261
  end
244
262
  it 'returns the Total charge amount (integer)' do
@@ -250,7 +268,7 @@ RSpec.describe Era835Parser::Parser do
250
268
  it 'returns the Account number' do
251
269
  expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
252
270
  end
253
- it 'returns the Cliam status code' do
271
+ it 'returns the Claim status code' do
254
272
  expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
255
273
  end
256
274
  it 'returns the Claim status code description' do
@@ -435,6 +453,15 @@ RSpec.describe Era835Parser::Parser do
435
453
  it 'returns the check number' do
436
454
  expect(@era[:checks]['02790758'][:check_number]).to eq('02790758')
437
455
  end
456
+ it 'returns the transaction handling code' do
457
+ expect(@era[:checks]['02790758'][:transaction_handling_code]).to eq('I')
458
+ end
459
+ it 'returns the credit debit flag' do
460
+ expect(@era[:checks]['02790758'][:credit_debit_flag]).to eq('C')
461
+ end
462
+ it 'returns the payment method code' do
463
+ expect(@era[:checks]['02790758'][:payment_method_code]).to eq('CHK')
464
+ end
438
465
  it 'returns the amount' do
439
466
  expect(@era[:checks]['02790758'][:amount]).to eq(192286)
440
467
  end
@@ -478,10 +505,10 @@ RSpec.describe Era835Parser::Parser do
478
505
  it 'returns the Patient name' do
479
506
  expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
480
507
  end
481
- it 'returns the Patient last name (titlized)' do
508
+ it 'returns the Patient last name (titleized)' do
482
509
  expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
483
510
  end
484
- it 'returns the Patient first name (titlized)' do
511
+ it 'returns the Patient first name (titleized)' do
485
512
  expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
486
513
  end
487
514
  it 'returns the Total charge amount (integer)' do
@@ -493,7 +520,7 @@ RSpec.describe Era835Parser::Parser do
493
520
  it 'returns the Account number' do
494
521
  expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
495
522
  end
496
- it 'returns the Cliam status code' do
523
+ it 'returns the Claim status code' do
497
524
  expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
498
525
  end
499
526
  it 'returns the Claim status code description' do
@@ -678,6 +705,15 @@ RSpec.describe Era835Parser::Parser do
678
705
  it 'returns the check number' do
679
706
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:check_number]).to eq('0123456789012345678901234567890123456789')
680
707
  end
708
+ it 'returns the transaction handling code' do
709
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:transaction_handling_code]).to eq('I')
710
+ end
711
+ it 'returns the credit debit flag' do
712
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:credit_debit_flag]).to eq('C')
713
+ end
714
+ it 'returns the payment method code' do
715
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payment_method_code]).to eq('CHK')
716
+ end
681
717
  it 'returns the amount' do
682
718
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:amount]).to eq(192286)
683
719
  end
@@ -721,10 +757,10 @@ RSpec.describe Era835Parser::Parser do
721
757
  it 'returns the Patient name' do
722
758
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
723
759
  end
724
- it 'returns the Patient last name (titlized)' do
760
+ it 'returns the Patient last name (titleized)' do
725
761
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_last_name]).to eq('Dough')
726
762
  end
727
- it 'returns the Patient first name (titlized)' do
763
+ it 'returns the Patient first name (titleized)' do
728
764
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_first_name]).to eq('Mary')
729
765
  end
730
766
  it 'returns the Total charge amount (integer)' do
@@ -736,7 +772,7 @@ RSpec.describe Era835Parser::Parser do
736
772
  it 'returns the Account number' do
737
773
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:account_number]).to eq('200200964A52')
738
774
  end
739
- it 'returns the Cliam status code' do
775
+ it 'returns the Claim status code' do
740
776
  expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_status_code]).to eq('1')
741
777
  end
742
778
  it 'returns the Claim status code description' do
@@ -884,6 +920,816 @@ RSpec.describe Era835Parser::Parser do
884
920
  end
885
921
  end
886
922
  end
923
+
924
+ context 'example_5.835' do
925
+ before :all do
926
+ @era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/example_5.835").parse
927
+ end
928
+
929
+ context 'Aggregate totals' do
930
+ it 'returns the addressed to' do
931
+ expect(@era[:addressed_to]).to eq(nil)
932
+ end
933
+ it 'returns the correct number of checks' do
934
+ expect(@era[:checks].count).to eq(1)
935
+ end
936
+ it 'returns the correct number of adjustments' do
937
+ expect(@era[:adjustments]).to eq(nil)
938
+ end
939
+ it 'returns the correct number of eras' do
940
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras].count).to eq(1)
941
+ end
942
+ it 'returns the correct number of line items' do
943
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items].count).to eq(3)
944
+ end
945
+ it 'returns the correct number of adjustment groups' do
946
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups].count).to eq(2)
947
+ end
948
+ it 'returns the correct number of adjustment groups' do
949
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups].count).to eq(1)
950
+ end
951
+ it 'returns the correct number of adjustment groups' do
952
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:adjustment_groups]).to eq(nil)
953
+ end
954
+ end
955
+
956
+ context 'Check #70408535' do
957
+ it 'returns the check number' do
958
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:check_number]).to eq('0123456789012345678901234567890123456789')
959
+ end
960
+ it 'returns the transaction handling code' do
961
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:transaction_handling_code]).to eq('I')
962
+ end
963
+ it 'returns the credit debit flag' do
964
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:credit_debit_flag]).to eq('C')
965
+ end
966
+ it 'returns the payment method code' do
967
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payment_method_code]).to eq('CHK')
968
+ end
969
+ it 'returns the amount' do
970
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:amount]).to eq(192286)
971
+ end
972
+ it 'returns the number of claims' do
973
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:number_of_claims]).to eq(1)
974
+ end
975
+ it 'returns the NPI or Tax ID of payee' do
976
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:npi_tax_id]).to eq('0987654321')
977
+ end
978
+ it 'returns the Check payee' do
979
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payee]).to eq('XYZ HEALTHCARE CORPORATION')
980
+ end
981
+ it 'returns the Payer name' do
982
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_name]).to eq('BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA')
983
+ end
984
+ it 'returns the Payer address' do
985
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_address]).to eq('P O BOX 2291')
986
+ end
987
+ it 'returns the Payer city' do
988
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_city]).to eq('DURHAM')
989
+ end
990
+ it 'returns the Payer state' do
991
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_state]).to eq('NC')
992
+ end
993
+ it 'returns the Payer zip code' do
994
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_zip_code]).to eq('27702')
995
+ end
996
+ it 'returns the Payer tax id' do
997
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_tax_id]).to eq('60-894904')
998
+ end
999
+ it 'returns the Payer EDI id' do
1000
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_edi_id]).to eq(nil)
1001
+ end
1002
+ it 'returns the Check date (string mm/dd/yyyy)' do
1003
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:date]).to eq('01/08/2011')
1004
+ end
1005
+ context 'ERA #0' do
1006
+ it 'returns the Patient ID' do
1007
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_id]).to eq(nil)
1008
+ end
1009
+ it 'returns the Patient name' do
1010
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
1011
+ end
1012
+ it 'returns the Patient last name (titleized)' do
1013
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_last_name]).to eq('Dough')
1014
+ end
1015
+ it 'returns the Patient first name (titleized)' do
1016
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_first_name]).to eq('Mary')
1017
+ end
1018
+ it 'returns the Subscriber last name (titleized)' do
1019
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_first_name]).to eq('Marty')
1020
+ end
1021
+ it 'returns the Subscriber last name (titleized)' do
1022
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_last_name]).to eq('Dough')
1023
+ end
1024
+ it 'returns the Subscriber name (titleized)' do
1025
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_name]).to eq('DOUGH,MARTY')
1026
+ end
1027
+ it 'returns the Subscriber middle initial' do
1028
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_middle_initial]).to eq('L')
1029
+ end
1030
+ it 'returns the Subscriber suffix' do
1031
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_suffix]).to eq('Sr.')
1032
+ end
1033
+ it 'returns the Subscriber ID' do
1034
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:subscriber_id]).to eq('YPB123456789009')
1035
+ end
1036
+ it 'returns the rendering provider last_name (titleized)' do
1037
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:rendering_provider_last_name]).to eq('Jones')
1038
+ end
1039
+ it 'returns the rendering provider first name (titleized)' do
1040
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:rendering_provider_first_name]).to eq('Alice')
1041
+ end
1042
+ it 'returns the rendering provider NPI' do
1043
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:rendering_provider_npi]).to eq('1116359906')
1044
+ end
1045
+ it 'returns the Total charge amount (integer)' do
1046
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:charge_amount]).to eq(210000)
1047
+ end
1048
+ it 'returns the Total payment amount (integer)' do
1049
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:payment_amount]).to eq(192286)
1050
+ end
1051
+ it 'returns the Account number' do
1052
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:account_number]).to eq('200200964A52')
1053
+ end
1054
+ it 'returns the Claim status code' do
1055
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_status_code]).to eq('1')
1056
+ end
1057
+ it 'returns the Claim status code description' do
1058
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:status]).to eq("PROCESSED AS PRIMARY")
1059
+ end
1060
+ it 'returns the Payer claim control number' do
1061
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:payer_claim_control_number]).to eq('94151100100')
1062
+ end
1063
+ it 'returns the Claim statement period start' do
1064
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_statement_period_start]).to eq(nil)
1065
+ end
1066
+ it 'returns the Claim statement period end' do
1067
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_statement_period_end]).to eq(nil)
1068
+ end
1069
+
1070
+ context 'Line item #0' do
1071
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1072
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:service_date]).to eq("12/31/2010")
1073
+ end
1074
+ it 'returns the CPT code' do
1075
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:cpt_code]).to eq("59430")
1076
+ end
1077
+ it 'returns the Charge amount (integer)' do
1078
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:charge_amount]).to eq(121000)
1079
+ end
1080
+ it 'returns the Payment amount (integer)' do
1081
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:payment_amount]).to eq(105786)
1082
+ end
1083
+ it 'returns the Total adjustment amount (integer)' do
1084
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:total_adjustment_amount]).to eq(15214)
1085
+ end
1086
+ it 'returns the Remark code' do
1087
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:remark_code]).to eq(nil)
1088
+ end
1089
+ it 'returns the Remarks' do
1090
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:remarks]).to eq(nil)
1091
+ end
1092
+ it 'returns the Reference number' do
1093
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:reference_number]).to eq('0001')
1094
+ end
1095
+ context 'Adjustment group #0' do
1096
+ it 'returns the Adjustment group' do
1097
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq("Contractual Obligation")
1098
+ end
1099
+ it 'returns the Adjustment group code' do
1100
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group_code]).to eq("CO")
1101
+ end
1102
+ it 'returns the Adjustment amount (integer)' do
1103
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(3460)
1104
+ end
1105
+ it 'returns the Reason code' do
1106
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][0][:reason_code]).to eq('42')
1107
+ end
1108
+ it 'returns the Translated reason code' do
1109
+ 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)")
1110
+ end
1111
+ end
1112
+ context 'Adjustment group #1' do
1113
+ it 'returns the Adjustment group' do
1114
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group]).to eq("Patient Responsibility")
1115
+ end
1116
+ it 'returns the Adjustment group code' do
1117
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group_code]).to eq("PR")
1118
+ end
1119
+ it 'returns the Adjustment amount (integer)' do
1120
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_amount]).to eq(11754)
1121
+ end
1122
+ it 'returns the Reason code' do
1123
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:reason_code]).to eq('2')
1124
+ end
1125
+ it 'returns the Translated reason code' do
1126
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][0][:adjustment_groups][1][:translated_reason_code]).to eq("Coinsurance Amount")
1127
+ end
1128
+ end
1129
+ end
1130
+ context 'Line item #1' do
1131
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1132
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:service_date]).to eq("12/31/2010")
1133
+ end
1134
+ it 'returns the CPT code' do
1135
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:cpt_code]).to eq("59440")
1136
+ end
1137
+ it 'returns the Charge amount (integer)' do
1138
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:charge_amount]).to eq(89000)
1139
+ end
1140
+ it 'returns the Payment amount (integer)' do
1141
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:payment_amount]).to eq(86500)
1142
+ end
1143
+ it 'returns the Total adjustment amount (integer)' do
1144
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:total_adjustment_amount]).to eq(2500)
1145
+ end
1146
+ it 'returns the Remark code' do
1147
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:remark_code]).to eq(nil)
1148
+ end
1149
+ it 'returns the Remarks' do
1150
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:remarks]).to eq(nil)
1151
+ end
1152
+ it 'returns the Reference number' do
1153
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:reference_number]).to eq('0002')
1154
+ end
1155
+ context 'Adjustment group #0' do
1156
+ it 'returns the Adjustment group' do
1157
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group]).to eq("Patient Responsibility")
1158
+ end
1159
+ it 'returns the Adjustment group code' do
1160
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group_code]).to eq("PR")
1161
+ end
1162
+ it 'returns the Adjustment amount (integer)' do
1163
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_amount]).to eq(2500)
1164
+ end
1165
+ it 'returns the Reason code' do
1166
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:reason_code]).to eq('3')
1167
+ end
1168
+ it 'returns the Translated reason code' do
1169
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][1][:adjustment_groups][0][:translated_reason_code]).to eq("Co-payment Amount")
1170
+ end
1171
+ end
1172
+ end
1173
+ context 'Line item #2' do
1174
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1175
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:service_date]).to eq("12/31/2010")
1176
+ end
1177
+ it 'returns the CPT code' do
1178
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:cpt_code]).to eq("59426")
1179
+ end
1180
+ it 'returns the Charge amount (integer)' do
1181
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:charge_amount]).to eq(74200)
1182
+ end
1183
+ it 'returns the Payment amount (integer)' do
1184
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:payment_amount]).to eq(74200)
1185
+ end
1186
+ it 'returns the Total adjustment amount (integer)' do
1187
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:total_adjustment_amount]).to eq(nil)
1188
+ end
1189
+ it 'returns the Remark code' do
1190
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:remark_code]).to eq(nil)
1191
+ end
1192
+ it 'returns the Remarks' do
1193
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:remarks]).to eq(nil)
1194
+ end
1195
+ it 'returns the Reference number' do
1196
+ expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:line_items][2][:reference_number]).to eq('0003')
1197
+ end
1198
+ end
1199
+ end
1200
+ end
1201
+ end
1202
+ context 'example_6.835' do
1203
+ before :all do
1204
+ @era = Era835Parser::Parser.new(file_path: "../era_835_parser/spec/example_6.835").parse
1205
+ @check_5003 = @era[:checks]['5003']
1206
+ @check_5010 = @era[:checks]['5010']
1207
+ end
1208
+
1209
+ context 'Aggregate totals' do
1210
+ it 'returns the addressed to' do
1211
+ expect(@era[:addressed_to]).to eq(nil)
1212
+ end
1213
+ it 'returns the correct number of checks' do
1214
+ expect(@era[:checks].count).to eq(2)
1215
+ end
1216
+ it 'returns the correct number of adjustments' do
1217
+ expect(@era[:adjustments]).to eq(nil)
1218
+ end
1219
+ it 'returns the correct number of eras' do
1220
+ total = @check_5003[:eras].count + @check_5010[:eras].count
1221
+ expect(total).to eq(2)
1222
+ end
1223
+ it 'returns the correct number of line items' do
1224
+ total = @check_5003[:eras][0][:line_items].count + @check_5010[:eras][0][:line_items].count
1225
+ expect(total).to eq(6)
1226
+ end
1227
+ it 'returns the correct number of adjustment groups' do
1228
+ total = @check_5003[:eras][0][:line_items][0][:adjustment_groups].count + @check_5010[:eras][0][:line_items][0][:adjustment_groups].count
1229
+ expect(total).to eq(4)
1230
+ end
1231
+ it 'returns the correct number of adjustment groups' do
1232
+ total = @check_5003[:eras][0][:line_items][1][:adjustment_groups].count + @check_5010[:eras][0][:line_items][1][:adjustment_groups].count
1233
+ expect(total).to eq(2)
1234
+ end
1235
+ it 'returns the correct number of adjustment groups' do
1236
+ total = @check_5003[:eras][0][:line_items][2][:adjustment_groups].count + @check_5010[:eras][0][:line_items][2][:adjustment_groups].count
1237
+ expect(total).to eq(2)
1238
+ end
1239
+ end
1240
+
1241
+ context 'Check #5003' do
1242
+ it 'returns the check number' do
1243
+ expect(@check_5003[:check_number]).to eq('5003')
1244
+ end
1245
+ it 'returns the transaction handling code' do
1246
+ expect(@check_5003[:transaction_handling_code]).to eq('H')
1247
+ end
1248
+ it 'returns the credit debit flag' do
1249
+ expect(@check_5003[:credit_debit_flag]).to eq('C')
1250
+ end
1251
+ it 'returns the payment method code' do
1252
+ expect(@check_5003[:payment_method_code]).to eq('NON')
1253
+ end
1254
+ it 'returns the amount' do
1255
+ expect(@check_5003[:amount]).to eq(0)
1256
+ end
1257
+ it 'returns the number of claims' do
1258
+ expect(@check_5003[:number_of_claims]).to eq(1)
1259
+ end
1260
+ it 'returns the NPI or Tax ID of payee' do
1261
+ expect(@check_5003[:npi_tax_id]).to eq('0987654321')
1262
+ end
1263
+ it 'returns the Check payee' do
1264
+ expect(@check_5003[:payee]).to eq('XYZ HEALTHCARE CORPORATION')
1265
+ end
1266
+ it 'returns the Payer name' do
1267
+ expect(@check_5003[:payer_name]).to eq('BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA')
1268
+ end
1269
+ it 'returns the Payer address' do
1270
+ expect(@check_5003[:payer_address]).to eq('P O BOX 2291')
1271
+ end
1272
+ it 'returns the Payer city' do
1273
+ expect(@check_5003[:payer_city]).to eq('DURHAM')
1274
+ end
1275
+ it 'returns the Payer state' do
1276
+ expect(@check_5003[:payer_state]).to eq('NC')
1277
+ end
1278
+ it 'returns the Payer zip code' do
1279
+ expect(@check_5003[:payer_zip_code]).to eq('27702')
1280
+ end
1281
+ it 'returns the Payer tax id' do
1282
+ expect(@check_5003[:payer_tax_id]).to eq('60-894904')
1283
+ end
1284
+ it 'returns the Payer EDI id' do
1285
+ expect(@check_5003[:payer_edi_id]).to eq(nil)
1286
+ end
1287
+ it 'returns the Check date (string mm/dd/yyyy)' do
1288
+ expect(@check_5003[:date]).to eq('01/08/2026')
1289
+ end
1290
+ context 'ERA #0' do
1291
+ it 'returns the Patient ID' do
1292
+ expect(@check_5003[:eras][0][:patient_id]).to eq(nil)
1293
+ end
1294
+ it 'returns the Patient name' do
1295
+ expect(@check_5003[:eras][0][:patient_name]).to eq('DOUGH,MARY')
1296
+ end
1297
+ it 'returns the Patient last name (titleized)' do
1298
+ expect(@check_5003[:eras][0][:patient_last_name]).to eq('Dough')
1299
+ end
1300
+ it 'returns the Patient first name (titleized)' do
1301
+ expect(@check_5003[:eras][0][:patient_first_name]).to eq('Mary')
1302
+ end
1303
+ it 'returns the Subscriber last name (titleized)' do
1304
+ expect(@check_5003[:eras][0][:subscriber_first_name]).to eq('Marty')
1305
+ end
1306
+ it 'returns the Subscriber last name (titleized)' do
1307
+ expect(@check_5003[:eras][0][:subscriber_last_name]).to eq('Dough')
1308
+ end
1309
+ it 'returns the Subscriber name (titleized)' do
1310
+ expect(@check_5003[:eras][0][:subscriber_name]).to eq('DOUGH,MARTY')
1311
+ end
1312
+ it 'returns the Subscriber middle initial' do
1313
+ expect(@check_5003[:eras][0][:subscriber_middle_initial]).to eq('L')
1314
+ end
1315
+ it 'returns the Subscriber suffix' do
1316
+ expect(@check_5003[:eras][0][:subscriber_suffix]).to eq('Sr.')
1317
+ end
1318
+ it 'returns the Subscriber ID' do
1319
+ expect(@check_5003[:eras][0][:subscriber_id]).to eq('YPB123456789009')
1320
+ end
1321
+ it 'returns the rendering provider last_name (titleized)' do
1322
+ expect(@check_5003[:eras][0][:rendering_provider_last_name]).to eq('Jones')
1323
+ end
1324
+ it 'returns the rendering provider first name (titleized)' do
1325
+ expect(@check_5003[:eras][0][:rendering_provider_first_name]).to eq('Alice')
1326
+ end
1327
+ it 'returns the rendering provider NPI' do
1328
+ expect(@check_5003[:eras][0][:rendering_provider_npi]).to eq('1116359906')
1329
+ end
1330
+ it 'returns the Total charge amount (integer)' do
1331
+ expect(@check_5003[:eras][0][:charge_amount]).to eq(30000)
1332
+ end
1333
+ it 'returns the Total payment amount (integer)' do
1334
+ expect(@check_5003[:eras][0][:payment_amount]).to eq(15000)
1335
+ end
1336
+ it 'returns the Account number' do
1337
+ expect(@check_5003[:eras][0][:account_number]).to eq('200200964A52')
1338
+ end
1339
+ it 'returns the Claim status code' do
1340
+ expect(@check_5003[:eras][0][:claim_status_code]).to eq('1')
1341
+ end
1342
+ it 'returns the Claim status code description' do
1343
+ expect(@check_5003[:eras][0][:status]).to eq("PROCESSED AS PRIMARY")
1344
+ end
1345
+ it 'returns the Payer claim control number' do
1346
+ expect(@check_5003[:eras][0][:payer_claim_control_number]).to eq('94151100100')
1347
+ end
1348
+ it 'returns the Claim statement period start' do
1349
+ expect(@check_5003[:eras][0][:claim_statement_period_start]).to eq(nil)
1350
+ end
1351
+ it 'returns the Claim statement period end' do
1352
+ expect(@check_5003[:eras][0][:claim_statement_period_end]).to eq(nil)
1353
+ end
1354
+
1355
+ context 'Line item #0' do
1356
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1357
+ expect(@check_5003[:eras][0][:line_items][0][:service_date]).to eq("12/31/2010")
1358
+ end
1359
+ it 'returns the CPT code' do
1360
+ expect(@check_5003[:eras][0][:line_items][0][:cpt_code]).to eq("59430")
1361
+ end
1362
+ it 'returns the Charge amount (integer)' do
1363
+ expect(@check_5003[:eras][0][:line_items][0][:charge_amount]).to eq(10100)
1364
+ end
1365
+ it 'returns the Payment amount (integer)' do
1366
+ expect(@check_5003[:eras][0][:line_items][0][:payment_amount]).to eq(5050)
1367
+ end
1368
+ it 'returns the Total adjustment amount (integer)' do
1369
+ expect(@check_5003[:eras][0][:line_items][0][:total_adjustment_amount]).to eq(5050)
1370
+ end
1371
+ it 'returns the Remark code' do
1372
+ expect(@check_5003[:eras][0][:line_items][0][:remark_code]).to eq(nil)
1373
+ end
1374
+ it 'returns the Remarks' do
1375
+ expect(@check_5003[:eras][0][:line_items][0][:remarks]).to eq(nil)
1376
+ end
1377
+ it 'returns the Reference number' do
1378
+ expect(@check_5003[:eras][0][:line_items][0][:reference_number]).to eq('0001')
1379
+ end
1380
+ context 'Adjustment group #0' do
1381
+ it 'returns the Adjustment group' do
1382
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq("Contractual Obligation")
1383
+ end
1384
+ it 'returns the Adjustment group code' do
1385
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group_code]).to eq("CO")
1386
+ end
1387
+ it 'returns the Adjustment amount (integer)' do
1388
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(2550)
1389
+ end
1390
+ it 'returns the Reason code' do
1391
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][0][:reason_code]).to eq('42')
1392
+ end
1393
+ it 'returns the Translated reason code' do
1394
+ expect(@check_5003[: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)")
1395
+ end
1396
+ end
1397
+ context 'Adjustment group #1' do
1398
+ it 'returns the Adjustment group' do
1399
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group]).to eq("Patient Responsibility")
1400
+ end
1401
+ it 'returns the Adjustment group code' do
1402
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group_code]).to eq("PR")
1403
+ end
1404
+ it 'returns the Adjustment amount (integer)' do
1405
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_amount]).to eq(2500)
1406
+ end
1407
+ it 'returns the Reason code' do
1408
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][1][:reason_code]).to eq('2')
1409
+ end
1410
+ it 'returns the Translated reason code' do
1411
+ expect(@check_5003[:eras][0][:line_items][0][:adjustment_groups][1][:translated_reason_code]).to eq("Coinsurance Amount")
1412
+ end
1413
+ end
1414
+ end
1415
+ context 'Line item #1' do
1416
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1417
+ expect(@check_5003[:eras][0][:line_items][1][:service_date]).to eq("12/31/2010")
1418
+ end
1419
+ it 'returns the CPT code' do
1420
+ expect(@check_5003[:eras][0][:line_items][1][:cpt_code]).to eq("59440")
1421
+ end
1422
+ it 'returns the Charge amount (integer)' do
1423
+ expect(@check_5003[:eras][0][:line_items][1][:charge_amount]).to eq(10000)
1424
+ end
1425
+ it 'returns the Payment amount (integer)' do
1426
+ expect(@check_5003[:eras][0][:line_items][1][:payment_amount]).to eq(5000)
1427
+ end
1428
+ it 'returns the Total adjustment amount (integer)' do
1429
+ expect(@check_5003[:eras][0][:line_items][1][:total_adjustment_amount]).to eq(5000)
1430
+ end
1431
+ it 'returns the Remark code' do
1432
+ expect(@check_5003[:eras][0][:line_items][1][:remark_code]).to eq(nil)
1433
+ end
1434
+ it 'returns the Remarks' do
1435
+ expect(@check_5003[:eras][0][:line_items][1][:remarks]).to eq(nil)
1436
+ end
1437
+ it 'returns the Reference number' do
1438
+ expect(@check_5003[:eras][0][:line_items][1][:reference_number]).to eq('0002')
1439
+ end
1440
+ context 'Adjustment group #0' do
1441
+ it 'returns the Adjustment group' do
1442
+ expect(@check_5003[:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group]).to eq("Patient Responsibility")
1443
+ end
1444
+ it 'returns the Adjustment group code' do
1445
+ expect(@check_5003[:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group_code]).to eq("PR")
1446
+ end
1447
+ it 'returns the Adjustment amount (integer)' do
1448
+ expect(@check_5003[:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_amount]).to eq(5000)
1449
+ end
1450
+ it 'returns the Reason code' do
1451
+ expect(@check_5003[:eras][0][:line_items][1][:adjustment_groups][0][:reason_code]).to eq('3')
1452
+ end
1453
+ it 'returns the Translated reason code' do
1454
+ expect(@check_5003[:eras][0][:line_items][1][:adjustment_groups][0][:translated_reason_code]).to eq("Co-payment Amount")
1455
+ end
1456
+ end
1457
+ end
1458
+ context 'Line item #2' do
1459
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1460
+ expect(@check_5003[:eras][0][:line_items][2][:service_date]).to eq("12/31/2010")
1461
+ end
1462
+ it 'returns the CPT code' do
1463
+ expect(@check_5003[:eras][0][:line_items][2][:cpt_code]).to eq("59426")
1464
+ end
1465
+ it 'returns the Charge amount (integer)' do
1466
+ expect(@check_5003[:eras][0][:line_items][2][:charge_amount]).to eq(9900)
1467
+ end
1468
+ it 'returns the Payment amount (integer)' do
1469
+ expect(@check_5003[:eras][0][:line_items][2][:payment_amount]).to eq(4950)
1470
+ end
1471
+ it 'returns the Total adjustment amount (integer)' do
1472
+ expect(@check_5003[:eras][0][:line_items][2][:total_adjustment_amount]).to eq(4950)
1473
+ end
1474
+ it 'returns the Remark code' do
1475
+ expect(@check_5003[:eras][0][:line_items][2][:remark_code]).to eq(nil)
1476
+ end
1477
+ it 'returns the Remarks' do
1478
+ expect(@check_5003[:eras][0][:line_items][2][:remarks]).to eq(nil)
1479
+ end
1480
+ it 'returns the Reference number' do
1481
+ expect(@check_5003[:eras][0][:line_items][2][:reference_number]).to eq('0003')
1482
+ end
1483
+ end
1484
+ end
1485
+ end
1486
+
1487
+ context 'Check #5010' do
1488
+ it 'returns the check number' do
1489
+ expect(@check_5010[:check_number]).to eq('5010')
1490
+ end
1491
+ it 'returns the transaction handling code' do
1492
+ expect(@check_5010[:transaction_handling_code]).to eq('I')
1493
+ end
1494
+ it 'returns the credit debit flag' do
1495
+ expect(@check_5010[:credit_debit_flag]).to eq('C')
1496
+ end
1497
+ it 'returns the payment method code' do
1498
+ expect(@check_5010[:payment_method_code]).to eq('ACH')
1499
+ end
1500
+ it 'returns the amount' do
1501
+ expect(@check_5010[:amount]).to eq(30000)
1502
+ end
1503
+ it 'returns the number of claims' do
1504
+ expect(@check_5010[:number_of_claims]).to eq(1)
1505
+ end
1506
+ it 'returns the NPI or Tax ID of payee' do
1507
+ expect(@check_5010[:npi_tax_id]).to eq('0987654321')
1508
+ end
1509
+ it 'returns the Check payee' do
1510
+ expect(@check_5010[:payee]).to eq('XYZ HEALTHCARE CORPORATION')
1511
+ end
1512
+ it 'returns the Payer name' do
1513
+ expect(@check_5010[:payer_name]).to eq('BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA')
1514
+ end
1515
+ it 'returns the Payer address' do
1516
+ expect(@check_5010[:payer_address]).to eq('P O BOX 2291')
1517
+ end
1518
+ it 'returns the Payer city' do
1519
+ expect(@check_5010[:payer_city]).to eq('DURHAM')
1520
+ end
1521
+ it 'returns the Payer state' do
1522
+ expect(@check_5010[:payer_state]).to eq('NC')
1523
+ end
1524
+ it 'returns the Payer zip code' do
1525
+ expect(@check_5010[:payer_zip_code]).to eq('27702')
1526
+ end
1527
+ it 'returns the Payer tax id' do
1528
+ expect(@check_5010[:payer_tax_id]).to eq('60-894904')
1529
+ end
1530
+ it 'returns the Payer EDI id' do
1531
+ expect(@check_5010[:payer_edi_id]).to eq(nil)
1532
+ end
1533
+ it 'returns the Check date (string mm/dd/yyyy)' do
1534
+ expect(@check_5010[:date]).to eq('01/09/2026')
1535
+ end
1536
+ context 'ERA #0' do
1537
+ it 'returns the Patient ID' do
1538
+ expect(@check_5010[:eras][0][:patient_id]).to eq(nil)
1539
+ end
1540
+ it 'returns the Patient name' do
1541
+ expect(@check_5010[:eras][0][:patient_name]).to eq('DOUGH,MARY')
1542
+ end
1543
+ it 'returns the Patient last name (titleized)' do
1544
+ expect(@check_5010[:eras][0][:patient_last_name]).to eq('Dough')
1545
+ end
1546
+ it 'returns the Patient first name (titleized)' do
1547
+ expect(@check_5010[:eras][0][:patient_first_name]).to eq('Mary')
1548
+ end
1549
+ it 'returns the Subscriber last name (titleized)' do
1550
+ expect(@check_5010[:eras][0][:subscriber_first_name]).to eq('Marty')
1551
+ end
1552
+ it 'returns the Subscriber last name (titleized)' do
1553
+ expect(@check_5010[:eras][0][:subscriber_last_name]).to eq('Dough')
1554
+ end
1555
+ it 'returns the Subscriber name (titleized)' do
1556
+ expect(@check_5010[:eras][0][:subscriber_name]).to eq('DOUGH,MARTY')
1557
+ end
1558
+ it 'returns the Subscriber middle initial' do
1559
+ expect(@check_5010[:eras][0][:subscriber_middle_initial]).to eq('L')
1560
+ end
1561
+ it 'returns the Subscriber suffix' do
1562
+ expect(@check_5010[:eras][0][:subscriber_suffix]).to eq('Sr.')
1563
+ end
1564
+ it 'returns the Subscriber ID' do
1565
+ expect(@check_5010[:eras][0][:subscriber_id]).to eq('YPB123456789009')
1566
+ end
1567
+ it 'returns the rendering provider last_name (titleized)' do
1568
+ expect(@check_5010[:eras][0][:rendering_provider_last_name]).to eq('Jones')
1569
+ end
1570
+ it 'returns the rendering provider first name (titleized)' do
1571
+ expect(@check_5010[:eras][0][:rendering_provider_first_name]).to eq('Alice')
1572
+ end
1573
+ it 'returns the rendering provider NPI' do
1574
+ expect(@check_5010[:eras][0][:rendering_provider_npi]).to eq('1116359906')
1575
+ end
1576
+ it 'returns the Total charge amount (integer)' do
1577
+ expect(@check_5010[:eras][0][:charge_amount]).to eq(30000)
1578
+ end
1579
+ it 'returns the Total payment amount (integer)' do
1580
+ expect(@check_5010[:eras][0][:payment_amount]).to eq(15000)
1581
+ end
1582
+ it 'returns the Account number' do
1583
+ expect(@check_5010[:eras][0][:account_number]).to eq('200200964A52')
1584
+ end
1585
+ it 'returns the Claim status code' do
1586
+ expect(@check_5010[:eras][0][:claim_status_code]).to eq('1')
1587
+ end
1588
+ it 'returns the Claim status code description' do
1589
+ expect(@check_5010[:eras][0][:status]).to eq("PROCESSED AS PRIMARY")
1590
+ end
1591
+ it 'returns the Payer claim control number' do
1592
+ expect(@check_5010[:eras][0][:payer_claim_control_number]).to eq('94151100100')
1593
+ end
1594
+ it 'returns the Claim statement period start' do
1595
+ expect(@check_5010[:eras][0][:claim_statement_period_start]).to eq(nil)
1596
+ end
1597
+ it 'returns the Claim statement period end' do
1598
+ expect(@check_5010[:eras][0][:claim_statement_period_end]).to eq(nil)
1599
+ end
1600
+
1601
+ context 'Line item #0' do
1602
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1603
+ expect(@check_5010[:eras][0][:line_items][0][:service_date]).to eq("12/31/2010")
1604
+ end
1605
+ it 'returns the CPT code' do
1606
+ expect(@check_5010[:eras][0][:line_items][0][:cpt_code]).to eq("59430")
1607
+ end
1608
+ it 'returns the Charge amount (integer)' do
1609
+ expect(@check_5010[:eras][0][:line_items][0][:charge_amount]).to eq(10100)
1610
+ end
1611
+ it 'returns the Payment amount (integer)' do
1612
+ expect(@check_5010[:eras][0][:line_items][0][:payment_amount]).to eq(5050)
1613
+ end
1614
+ it 'returns the Total adjustment amount (integer)' do
1615
+ expect(@check_5010[:eras][0][:line_items][0][:total_adjustment_amount]).to eq(5050)
1616
+ end
1617
+ it 'returns the Remark code' do
1618
+ expect(@check_5010[:eras][0][:line_items][0][:remark_code]).to eq(nil)
1619
+ end
1620
+ it 'returns the Remarks' do
1621
+ expect(@check_5010[:eras][0][:line_items][0][:remarks]).to eq(nil)
1622
+ end
1623
+ it 'returns the Reference number' do
1624
+ expect(@check_5010[:eras][0][:line_items][0][:reference_number]).to eq('0001')
1625
+ end
1626
+ context 'Adjustment group #0' do
1627
+ it 'returns the Adjustment group' do
1628
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group]).to eq("Contractual Obligation")
1629
+ end
1630
+ it 'returns the Adjustment group code' do
1631
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_group_code]).to eq("CO")
1632
+ end
1633
+ it 'returns the Adjustment amount (integer)' do
1634
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][0][:adjustment_amount]).to eq(2550)
1635
+ end
1636
+ it 'returns the Reason code' do
1637
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][0][:reason_code]).to eq('42')
1638
+ end
1639
+ it 'returns the Translated reason code' do
1640
+ expect(@check_5010[: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)")
1641
+ end
1642
+ end
1643
+ context 'Adjustment group #1' do
1644
+ it 'returns the Adjustment group' do
1645
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group]).to eq("Patient Responsibility")
1646
+ end
1647
+ it 'returns the Adjustment group code' do
1648
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_group_code]).to eq("PR")
1649
+ end
1650
+ it 'returns the Adjustment amount (integer)' do
1651
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][1][:adjustment_amount]).to eq(2500)
1652
+ end
1653
+ it 'returns the Reason code' do
1654
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][1][:reason_code]).to eq('2')
1655
+ end
1656
+ it 'returns the Translated reason code' do
1657
+ expect(@check_5010[:eras][0][:line_items][0][:adjustment_groups][1][:translated_reason_code]).to eq("Coinsurance Amount")
1658
+ end
1659
+ end
1660
+ end
1661
+ context 'Line item #1' do
1662
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1663
+ expect(@check_5010[:eras][0][:line_items][1][:service_date]).to eq("12/31/2010")
1664
+ end
1665
+ it 'returns the CPT code' do
1666
+ expect(@check_5010[:eras][0][:line_items][1][:cpt_code]).to eq("59440")
1667
+ end
1668
+ it 'returns the Charge amount (integer)' do
1669
+ expect(@check_5010[:eras][0][:line_items][1][:charge_amount]).to eq(10000)
1670
+ end
1671
+ it 'returns the Payment amount (integer)' do
1672
+ expect(@check_5010[:eras][0][:line_items][1][:payment_amount]).to eq(5000)
1673
+ end
1674
+ it 'returns the Total adjustment amount (integer)' do
1675
+ expect(@check_5010[:eras][0][:line_items][1][:total_adjustment_amount]).to eq(5000)
1676
+ end
1677
+ it 'returns the Remark code' do
1678
+ expect(@check_5010[:eras][0][:line_items][1][:remark_code]).to eq(nil)
1679
+ end
1680
+ it 'returns the Remarks' do
1681
+ expect(@check_5010[:eras][0][:line_items][1][:remarks]).to eq(nil)
1682
+ end
1683
+ it 'returns the Reference number' do
1684
+ expect(@check_5010[:eras][0][:line_items][1][:reference_number]).to eq('0002')
1685
+ end
1686
+ context 'Adjustment group #0' do
1687
+ it 'returns the Adjustment group' do
1688
+ expect(@check_5010[:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group]).to eq("Patient Responsibility")
1689
+ end
1690
+ it 'returns the Adjustment group code' do
1691
+ expect(@check_5010[:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_group_code]).to eq("PR")
1692
+ end
1693
+ it 'returns the Adjustment amount (integer)' do
1694
+ expect(@check_5010[:eras][0][:line_items][1][:adjustment_groups][0][:adjustment_amount]).to eq(5000)
1695
+ end
1696
+ it 'returns the Reason code' do
1697
+ expect(@check_5010[:eras][0][:line_items][1][:adjustment_groups][0][:reason_code]).to eq('3')
1698
+ end
1699
+ it 'returns the Translated reason code' do
1700
+ expect(@check_5010[:eras][0][:line_items][1][:adjustment_groups][0][:translated_reason_code]).to eq("Co-payment Amount")
1701
+ end
1702
+ end
1703
+ end
1704
+ context 'Line item #2' do
1705
+ it 'returns the Date of service (string mm/dd/yyyy)' do
1706
+ expect(@check_5010[:eras][0][:line_items][2][:service_date]).to eq("12/31/2010")
1707
+ end
1708
+ it 'returns the CPT code' do
1709
+ expect(@check_5010[:eras][0][:line_items][2][:cpt_code]).to eq("59426")
1710
+ end
1711
+ it 'returns the Charge amount (integer)' do
1712
+ expect(@check_5010[:eras][0][:line_items][2][:charge_amount]).to eq(9900)
1713
+ end
1714
+ it 'returns the Payment amount (integer)' do
1715
+ expect(@check_5010[:eras][0][:line_items][2][:payment_amount]).to eq(4950)
1716
+ end
1717
+ it 'returns the Total adjustment amount (integer)' do
1718
+ expect(@check_5010[:eras][0][:line_items][2][:total_adjustment_amount]).to eq(4950)
1719
+ end
1720
+ it 'returns the Remark code' do
1721
+ expect(@check_5010[:eras][0][:line_items][2][:remark_code]).to eq(nil)
1722
+ end
1723
+ it 'returns the Remarks' do
1724
+ expect(@check_5010[:eras][0][:line_items][2][:remarks]).to eq(nil)
1725
+ end
1726
+ it 'returns the Reference number' do
1727
+ expect(@check_5010[:eras][0][:line_items][2][:reference_number]).to eq('0003')
1728
+ end
1729
+ end
1730
+ end
1731
+ end
1732
+ end
887
1733
  end
888
1734
 
889
1735
  context 'Human readable' do
@@ -1002,10 +1848,10 @@ Check# Patient ID Last,First Charge Amt
1002
1848
  it 'returns the Patient name' do
1003
1849
  expect(@era[:checks]['201812215555555555'][:eras][0][:patient_name]).to eq('DOE JR,DAVIS')
1004
1850
  end
1005
- it 'returns the Patient last name (titlized)' do
1851
+ it 'returns the Patient last name (titleized)' do
1006
1852
  expect(@era[:checks]['201812215555555555'][:eras][0][:patient_last_name]).to eq('Doe Jr')
1007
1853
  end
1008
- it 'returns the Patient first name (titlized)' do
1854
+ it 'returns the Patient first name (titleized)' do
1009
1855
  expect(@era[:checks]['201812215555555555'][:eras][0][:patient_first_name]).to eq('Davis')
1010
1856
  end
1011
1857
  it 'returns the Total charge amount (integer)' do
@@ -1133,10 +1979,10 @@ Check# Patient ID Last,First Charge Amt
1133
1979
  it 'returns the Patient name' do
1134
1980
  expect(@era[:checks]['201812215555555556'][:eras][0][:patient_name]).to eq('DOE,JANE')
1135
1981
  end
1136
- it 'returns the Patient last name (titlized)' do
1982
+ it 'returns the Patient last name (titleized)' do
1137
1983
  expect(@era[:checks]['201812215555555556'][:eras][0][:patient_last_name]).to eq('Doe')
1138
1984
  end
1139
- it 'returns the Patient first name (titlized)' do
1985
+ it 'returns the Patient first name (titleized)' do
1140
1986
  expect(@era[:checks]['201812215555555556'][:eras][0][:patient_first_name]).to eq('Jane')
1141
1987
  end
1142
1988
  it 'returns the Total charge amount (integer)' do
@@ -1248,10 +2094,10 @@ Check# Patient ID Last,First Charge Amt
1248
2094
  it 'returns the Patient name' do
1249
2095
  expect(@era[:checks]['201812215555555556'][:eras][1][:patient_name]).to eq('SMITH,JOSEPH')
1250
2096
  end
1251
- it 'returns the Patient last name (titlized)' do
2097
+ it 'returns the Patient last name (titleized)' do
1252
2098
  expect(@era[:checks]['201812215555555556'][:eras][1][:patient_last_name]).to eq('Smith')
1253
2099
  end
1254
- it 'returns the Patient first name (titlized)' do
2100
+ it 'returns the Patient first name (titleized)' do
1255
2101
  expect(@era[:checks]['201812215555555556'][:eras][1][:patient_first_name]).to eq('Joseph')
1256
2102
  end
1257
2103
  it 'returns the Total charge amount (integer)' do
@@ -1363,10 +2209,10 @@ Check# Patient ID Last,First Charge Amt
1363
2209
  it 'returns the Patient name' do
1364
2210
  expect(@era[:checks]['201812215555555557'][:eras][0][:patient_name]).to eq('LASTNAME,')
1365
2211
  end
1366
- it 'returns the Patient last name (titlized)' do
2212
+ it 'returns the Patient last name (titleized)' do
1367
2213
  expect(@era[:checks]['201812215555555557'][:eras][0][:patient_last_name]).to eq('Lastname')
1368
2214
  end
1369
- it 'returns the Patient first name (titlized)' do
2215
+ it 'returns the Patient first name (titleized)' do
1370
2216
  expect(@era[:checks]['201812215555555557'][:eras][0][:patient_first_name]).to eq(nil)
1371
2217
  end
1372
2218
  it 'returns the Total charge amount (integer)' do
@@ -1450,10 +2296,10 @@ Check# Patient ID Last,First Charge Amt
1450
2296
  it 'returns the Patient name' do
1451
2297
  expect(@era[:checks]['201812215555555557'][:eras][1][:patient_name]).to eq('WORLD,HELLO')
1452
2298
  end
1453
- it 'returns the Patient last name (titlized)' do
2299
+ it 'returns the Patient last name (titleized)' do
1454
2300
  expect(@era[:checks]['201812215555555557'][:eras][1][:patient_last_name]).to eq('World')
1455
2301
  end
1456
- it 'returns the Patient first name (titlized)' do
2302
+ it 'returns the Patient first name (titleized)' do
1457
2303
  expect(@era[:checks]['201812215555555557'][:eras][1][:patient_first_name]).to eq('Hello')
1458
2304
  end
1459
2305
  it 'returns the Total charge amount (integer)' do