era_835_parser 0.1.11 → 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 +4 -4
- data/README.md +20 -6
- data/lib/era_835_parser/parser.rb +61 -25
- data/lib/era_835_parser/version.rb +1 -1
- data/spec/era_835_parser_spec.rb +306 -24
- data/spec/example_1.835 +1 -1
- data/spec/example_2.835 +1 -1
- data/spec/example_3.835 +1 -0
- data/spec/example_5.835 +34 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee6d77b1fca8cdd052544e74a5932c84a01ead1ef7bca1c1270a7c9ba397b804
|
|
4
|
+
data.tar.gz: c0cb958f109b14f7cee14e1f80799e58ccdddbff95c5e7478747c21c07527fc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 (
|
|
48
|
-
puts individual_era[:patient_first_name] # Patient first name (
|
|
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 (
|
|
51
|
-
puts individual_era[:rendering_provider_first_name] # Rendering provider first name (
|
|
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 = ''
|
|
@@ -67,6 +68,7 @@ module Era835Parser
|
|
|
67
68
|
service_date = false
|
|
68
69
|
floating_adjustment_group_code = nil
|
|
69
70
|
returned_reference_number = false
|
|
71
|
+
payer_edi_id = false
|
|
70
72
|
|
|
71
73
|
file_or_file_path = !file.nil? ? file : file_path
|
|
72
74
|
opened_file = file_or_file_path.respond_to?(:write) ? file_or_file_path : open(file_or_file_path)
|
|
@@ -843,56 +845,84 @@ module Era835Parser
|
|
|
843
845
|
when 1
|
|
844
846
|
# Patient Identifier Code
|
|
845
847
|
# puts "Patient Identifier Code: #{element}"
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
patient_loop = false
|
|
850
|
-
end
|
|
851
|
-
if element == "82"
|
|
852
|
-
rendering_provider_loop = true
|
|
853
|
-
else
|
|
854
|
-
rendering_provider_loop = false
|
|
855
|
-
end
|
|
848
|
+
patient_loop = element == "QC"
|
|
849
|
+
subscriber_loop = element == 'IL'
|
|
850
|
+
rendering_provider_loop = element == "82"
|
|
856
851
|
when 2
|
|
857
852
|
# Entity Type Qualifier
|
|
858
853
|
# puts "Entity Type Qualifier: #{element}"
|
|
859
854
|
when 3
|
|
860
855
|
# Patient Last Name
|
|
861
856
|
# puts "Patient Last Name: #{element}"
|
|
862
|
-
if claim_payment_information_loop
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
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
|
|
867
867
|
end
|
|
868
868
|
when 4
|
|
869
869
|
# Patient First Name
|
|
870
870
|
# puts "Patient First Name: #{element}"
|
|
871
|
-
if claim_payment_information_loop
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
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
|
|
878
884
|
end
|
|
879
885
|
when 5
|
|
880
886
|
# Patient Middle Initial
|
|
881
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
|
|
882
896
|
when 6
|
|
883
897
|
# Name Prefix
|
|
884
898
|
# puts "Name Prefix: #{element}"
|
|
885
899
|
when 7
|
|
886
900
|
# Patient Name Suffix
|
|
887
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
|
|
888
910
|
when 8
|
|
889
911
|
# Identification Code Qualifier
|
|
890
912
|
# puts "Identification Code Qualifier: #{element}"
|
|
891
913
|
when 9
|
|
892
|
-
# Patient Member Number
|
|
914
|
+
# Patient Member Number or rendering provider NPI number
|
|
893
915
|
# puts "Patient Member Number: #{element}"
|
|
894
|
-
if claim_payment_information_loop
|
|
895
|
-
|
|
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
|
|
896
926
|
end
|
|
897
927
|
end
|
|
898
928
|
when "SVC"
|
|
@@ -962,6 +992,7 @@ module Era835Parser
|
|
|
962
992
|
# Additional Payee Identification Qualifier
|
|
963
993
|
# puts "Additional Payee Identification Qualifier: #{element}"
|
|
964
994
|
returned_reference_number = true if element == '6R'
|
|
995
|
+
payer_edi_id = true if element == '2U'
|
|
965
996
|
when 2
|
|
966
997
|
# Reference Identification Code
|
|
967
998
|
# puts "Reference Identification Code: #{element}"
|
|
@@ -969,6 +1000,11 @@ module Era835Parser
|
|
|
969
1000
|
individual_line_item[:reference_number] = element
|
|
970
1001
|
returned_reference_number = false
|
|
971
1002
|
end
|
|
1003
|
+
|
|
1004
|
+
if payer_edi_id
|
|
1005
|
+
era[:checks][check[:check_number]][:payer_edi_id] = element
|
|
1006
|
+
payer_edi_id = false
|
|
1007
|
+
end
|
|
972
1008
|
when 3
|
|
973
1009
|
# Additional Payee Identification Qualifier
|
|
974
1010
|
# puts "Additional Payee Identification Qualifier: #{element}"
|
data/spec/era_835_parser_spec.rb
CHANGED
|
@@ -65,6 +65,9 @@ RSpec.describe Era835Parser::Parser do
|
|
|
65
65
|
it 'returns the Payer tax id' do
|
|
66
66
|
expect(@era[:checks]['70408535'][:payer_tax_id]).to eq('57-14001')
|
|
67
67
|
end
|
|
68
|
+
it 'returns the Payer EDI id' do
|
|
69
|
+
expect(@era[:checks]['70408535'][:payer_edi_id]).to eq('11111')
|
|
70
|
+
end
|
|
68
71
|
it 'returns the Check date (string mm/dd/yyyy)' do
|
|
69
72
|
expect(@era[:checks]['70408535'][:date]).to eq('09/23/2010')
|
|
70
73
|
end
|
|
@@ -75,10 +78,10 @@ RSpec.describe Era835Parser::Parser do
|
|
|
75
78
|
it 'returns the Patient name' do
|
|
76
79
|
expect(@era[:checks]['70408535'][:eras][0][:patient_name]).to eq('RABBIT,ROGER')
|
|
77
80
|
end
|
|
78
|
-
it 'returns the Patient last name (
|
|
81
|
+
it 'returns the Patient last name (titleized)' do
|
|
79
82
|
expect(@era[:checks]['70408535'][:eras][0][:patient_last_name]).to eq('Rabbit')
|
|
80
83
|
end
|
|
81
|
-
it 'returns the Patient first name (
|
|
84
|
+
it 'returns the Patient first name (titleized)' do
|
|
82
85
|
expect(@era[:checks]['70408535'][:eras][0][:patient_first_name]).to eq('Roger')
|
|
83
86
|
end
|
|
84
87
|
it 'returns the Total charge amount (integer)' do
|
|
@@ -90,7 +93,7 @@ RSpec.describe Era835Parser::Parser do
|
|
|
90
93
|
it 'returns the Account number' do
|
|
91
94
|
expect(@era[:checks]['70408535'][:eras][0][:account_number]).to eq('474623UB001CW0321')
|
|
92
95
|
end
|
|
93
|
-
it 'returns the
|
|
96
|
+
it 'returns the Claim status code' do
|
|
94
97
|
expect(@era[:checks]['70408535'][:eras][0][:claim_status_code]).to eq('1')
|
|
95
98
|
end
|
|
96
99
|
it 'returns the Claim status code description' do
|
|
@@ -185,7 +188,7 @@ RSpec.describe Era835Parser::Parser do
|
|
|
185
188
|
end
|
|
186
189
|
end
|
|
187
190
|
|
|
188
|
-
context 'Check #
|
|
191
|
+
context 'Check #02790758' do
|
|
189
192
|
it 'returns the check number' do
|
|
190
193
|
expect(@era[:checks]['02790758'][:check_number]).to eq('02790758')
|
|
191
194
|
end
|
|
@@ -219,6 +222,9 @@ RSpec.describe Era835Parser::Parser do
|
|
|
219
222
|
it 'returns the Payer tax id' do
|
|
220
223
|
expect(@era[:checks]['02790758'][:payer_tax_id]).to eq('60-894904')
|
|
221
224
|
end
|
|
225
|
+
it 'returns the Payer EDI id' do
|
|
226
|
+
expect(@era[:checks]['02790758'][:payer_edi_id]).to eq('22222')
|
|
227
|
+
end
|
|
222
228
|
it 'returns the Check date (string mm/dd/yyyy)' do
|
|
223
229
|
expect(@era[:checks]['02790758'][:date]).to eq('01/08/2011')
|
|
224
230
|
end
|
|
@@ -229,10 +235,10 @@ RSpec.describe Era835Parser::Parser do
|
|
|
229
235
|
it 'returns the Patient name' do
|
|
230
236
|
expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
|
|
231
237
|
end
|
|
232
|
-
it 'returns the Patient last name (
|
|
238
|
+
it 'returns the Patient last name (titleized)' do
|
|
233
239
|
expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
|
|
234
240
|
end
|
|
235
|
-
it 'returns the Patient first name (
|
|
241
|
+
it 'returns the Patient first name (titleized)' do
|
|
236
242
|
expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
|
|
237
243
|
end
|
|
238
244
|
it 'returns the Total charge amount (integer)' do
|
|
@@ -244,7 +250,7 @@ RSpec.describe Era835Parser::Parser do
|
|
|
244
250
|
it 'returns the Account number' do
|
|
245
251
|
expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
|
|
246
252
|
end
|
|
247
|
-
it 'returns the
|
|
253
|
+
it 'returns the Claim status code' do
|
|
248
254
|
expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
|
|
249
255
|
end
|
|
250
256
|
it 'returns the Claim status code description' do
|
|
@@ -425,7 +431,7 @@ RSpec.describe Era835Parser::Parser do
|
|
|
425
431
|
end
|
|
426
432
|
end
|
|
427
433
|
|
|
428
|
-
context 'Check #
|
|
434
|
+
context 'Check #02790758' do
|
|
429
435
|
it 'returns the check number' do
|
|
430
436
|
expect(@era[:checks]['02790758'][:check_number]).to eq('02790758')
|
|
431
437
|
end
|
|
@@ -459,6 +465,9 @@ RSpec.describe Era835Parser::Parser do
|
|
|
459
465
|
it 'returns the Payer tax id' do
|
|
460
466
|
expect(@era[:checks]['02790758'][:payer_tax_id]).to eq('60-894904')
|
|
461
467
|
end
|
|
468
|
+
it 'returns the Payer EDI id' do
|
|
469
|
+
expect(@era[:checks]['02790758'][:payer_edi_id]).to eq('33333')
|
|
470
|
+
end
|
|
462
471
|
it 'returns the Check date (string mm/dd/yyyy)' do
|
|
463
472
|
expect(@era[:checks]['02790758'][:date]).to eq('01/08/2011')
|
|
464
473
|
end
|
|
@@ -469,10 +478,10 @@ RSpec.describe Era835Parser::Parser do
|
|
|
469
478
|
it 'returns the Patient name' do
|
|
470
479
|
expect(@era[:checks]['02790758'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
|
|
471
480
|
end
|
|
472
|
-
it 'returns the Patient last name (
|
|
481
|
+
it 'returns the Patient last name (titleized)' do
|
|
473
482
|
expect(@era[:checks]['02790758'][:eras][0][:patient_last_name]).to eq('Dough')
|
|
474
483
|
end
|
|
475
|
-
it 'returns the Patient first name (
|
|
484
|
+
it 'returns the Patient first name (titleized)' do
|
|
476
485
|
expect(@era[:checks]['02790758'][:eras][0][:patient_first_name]).to eq('Mary')
|
|
477
486
|
end
|
|
478
487
|
it 'returns the Total charge amount (integer)' do
|
|
@@ -484,7 +493,7 @@ RSpec.describe Era835Parser::Parser do
|
|
|
484
493
|
it 'returns the Account number' do
|
|
485
494
|
expect(@era[:checks]['02790758'][:eras][0][:account_number]).to eq('200200964A52')
|
|
486
495
|
end
|
|
487
|
-
it 'returns the
|
|
496
|
+
it 'returns the Claim status code' do
|
|
488
497
|
expect(@era[:checks]['02790758'][:eras][0][:claim_status_code]).to eq('1')
|
|
489
498
|
end
|
|
490
499
|
it 'returns the Claim status code description' do
|
|
@@ -699,6 +708,9 @@ RSpec.describe Era835Parser::Parser do
|
|
|
699
708
|
it 'returns the Payer tax id' do
|
|
700
709
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_tax_id]).to eq('60-894904')
|
|
701
710
|
end
|
|
711
|
+
it 'returns the Payer EDI id' do
|
|
712
|
+
expect(@era[:checks]['0123456789012345678901234567890123456789'][:payer_edi_id]).to eq(nil)
|
|
713
|
+
end
|
|
702
714
|
it 'returns the Check date (string mm/dd/yyyy)' do
|
|
703
715
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:date]).to eq('01/08/2011')
|
|
704
716
|
end
|
|
@@ -709,12 +721,282 @@ RSpec.describe Era835Parser::Parser do
|
|
|
709
721
|
it 'returns the Patient name' do
|
|
710
722
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_name]).to eq('DOUGH,MARY')
|
|
711
723
|
end
|
|
712
|
-
it 'returns the Patient last name (
|
|
724
|
+
it 'returns the Patient last name (titleized)' do
|
|
725
|
+
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_last_name]).to eq('Dough')
|
|
726
|
+
end
|
|
727
|
+
it 'returns the Patient first name (titleized)' do
|
|
728
|
+
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_first_name]).to eq('Mary')
|
|
729
|
+
end
|
|
730
|
+
it 'returns the Total charge amount (integer)' do
|
|
731
|
+
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:charge_amount]).to eq(210000)
|
|
732
|
+
end
|
|
733
|
+
it 'returns the Total payment amount (integer)' do
|
|
734
|
+
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:payment_amount]).to eq(192286)
|
|
735
|
+
end
|
|
736
|
+
it 'returns the Account number' do
|
|
737
|
+
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:account_number]).to eq('200200964A52')
|
|
738
|
+
end
|
|
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
|
|
713
968
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_last_name]).to eq('Dough')
|
|
714
969
|
end
|
|
715
|
-
it 'returns the Patient first name (
|
|
970
|
+
it 'returns the Patient first name (titleized)' do
|
|
716
971
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:patient_first_name]).to eq('Mary')
|
|
717
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
|
|
718
1000
|
it 'returns the Total charge amount (integer)' do
|
|
719
1001
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:charge_amount]).to eq(210000)
|
|
720
1002
|
end
|
|
@@ -724,7 +1006,7 @@ RSpec.describe Era835Parser::Parser do
|
|
|
724
1006
|
it 'returns the Account number' do
|
|
725
1007
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:account_number]).to eq('200200964A52')
|
|
726
1008
|
end
|
|
727
|
-
it 'returns the
|
|
1009
|
+
it 'returns the Claim status code' do
|
|
728
1010
|
expect(@era[:checks]['0123456789012345678901234567890123456789'][:eras][0][:claim_status_code]).to eq('1')
|
|
729
1011
|
end
|
|
730
1012
|
it 'returns the Claim status code description' do
|
|
@@ -990,10 +1272,10 @@ Check# Patient ID Last,First Charge Amt
|
|
|
990
1272
|
it 'returns the Patient name' do
|
|
991
1273
|
expect(@era[:checks]['201812215555555555'][:eras][0][:patient_name]).to eq('DOE JR,DAVIS')
|
|
992
1274
|
end
|
|
993
|
-
it 'returns the Patient last name (
|
|
1275
|
+
it 'returns the Patient last name (titleized)' do
|
|
994
1276
|
expect(@era[:checks]['201812215555555555'][:eras][0][:patient_last_name]).to eq('Doe Jr')
|
|
995
1277
|
end
|
|
996
|
-
it 'returns the Patient first name (
|
|
1278
|
+
it 'returns the Patient first name (titleized)' do
|
|
997
1279
|
expect(@era[:checks]['201812215555555555'][:eras][0][:patient_first_name]).to eq('Davis')
|
|
998
1280
|
end
|
|
999
1281
|
it 'returns the Total charge amount (integer)' do
|
|
@@ -1121,10 +1403,10 @@ Check# Patient ID Last,First Charge Amt
|
|
|
1121
1403
|
it 'returns the Patient name' do
|
|
1122
1404
|
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_name]).to eq('DOE,JANE')
|
|
1123
1405
|
end
|
|
1124
|
-
it 'returns the Patient last name (
|
|
1406
|
+
it 'returns the Patient last name (titleized)' do
|
|
1125
1407
|
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_last_name]).to eq('Doe')
|
|
1126
1408
|
end
|
|
1127
|
-
it 'returns the Patient first name (
|
|
1409
|
+
it 'returns the Patient first name (titleized)' do
|
|
1128
1410
|
expect(@era[:checks]['201812215555555556'][:eras][0][:patient_first_name]).to eq('Jane')
|
|
1129
1411
|
end
|
|
1130
1412
|
it 'returns the Total charge amount (integer)' do
|
|
@@ -1236,10 +1518,10 @@ Check# Patient ID Last,First Charge Amt
|
|
|
1236
1518
|
it 'returns the Patient name' do
|
|
1237
1519
|
expect(@era[:checks]['201812215555555556'][:eras][1][:patient_name]).to eq('SMITH,JOSEPH')
|
|
1238
1520
|
end
|
|
1239
|
-
it 'returns the Patient last name (
|
|
1521
|
+
it 'returns the Patient last name (titleized)' do
|
|
1240
1522
|
expect(@era[:checks]['201812215555555556'][:eras][1][:patient_last_name]).to eq('Smith')
|
|
1241
1523
|
end
|
|
1242
|
-
it 'returns the Patient first name (
|
|
1524
|
+
it 'returns the Patient first name (titleized)' do
|
|
1243
1525
|
expect(@era[:checks]['201812215555555556'][:eras][1][:patient_first_name]).to eq('Joseph')
|
|
1244
1526
|
end
|
|
1245
1527
|
it 'returns the Total charge amount (integer)' do
|
|
@@ -1351,10 +1633,10 @@ Check# Patient ID Last,First Charge Amt
|
|
|
1351
1633
|
it 'returns the Patient name' do
|
|
1352
1634
|
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_name]).to eq('LASTNAME,')
|
|
1353
1635
|
end
|
|
1354
|
-
it 'returns the Patient last name (
|
|
1636
|
+
it 'returns the Patient last name (titleized)' do
|
|
1355
1637
|
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_last_name]).to eq('Lastname')
|
|
1356
1638
|
end
|
|
1357
|
-
it 'returns the Patient first name (
|
|
1639
|
+
it 'returns the Patient first name (titleized)' do
|
|
1358
1640
|
expect(@era[:checks]['201812215555555557'][:eras][0][:patient_first_name]).to eq(nil)
|
|
1359
1641
|
end
|
|
1360
1642
|
it 'returns the Total charge amount (integer)' do
|
|
@@ -1438,10 +1720,10 @@ Check# Patient ID Last,First Charge Amt
|
|
|
1438
1720
|
it 'returns the Patient name' do
|
|
1439
1721
|
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_name]).to eq('WORLD,HELLO')
|
|
1440
1722
|
end
|
|
1441
|
-
it 'returns the Patient last name (
|
|
1723
|
+
it 'returns the Patient last name (titleized)' do
|
|
1442
1724
|
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_last_name]).to eq('World')
|
|
1443
1725
|
end
|
|
1444
|
-
it 'returns the Patient first name (
|
|
1726
|
+
it 'returns the Patient first name (titleized)' do
|
|
1445
1727
|
expect(@era[:checks]['201812215555555557'][:eras][1][:patient_first_name]).to eq('Hello')
|
|
1446
1728
|
end
|
|
1447
1729
|
it 'returns the Total charge amount (integer)' do
|
data/spec/example_1.835
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ST*835*1234~BPR*I*15096.46*C*CHK************20100923~TRN*1*70408535*15714001~REF*F2*slca435w~DTM*405*20100923~N1*PR*NC TEACHERS & STATE EMPLOYEES HEALTH PLAN & HEALTH CHOICE~N3*P O BOX 30025~N4*DURHAM*NC*27702~PER*CX**TE*8002144844~N1*PE*ACME UNIV HLTH SYS INC*XX*1234567890~N3*P O BOX AAA1~N4*DURHAM*NC*27701~REF*TJ*123456789~CLP*474623UB001CW0321*1*3740.6*5451.04**15*80209000000*11*1**397*0.7309~CAS*CO*94*-1710.44~NM1*QC*1*Rabbit*Roger*B***MI* RUN123456789~MIA*0~REF*EA*CW0321~DTM*232*20100307~DTM*233*20100310~DTM*50*20100918~AMT*AU*5451.04~SE*21*1234~
|
|
1
|
+
ST*835*1234~BPR*I*15096.46*C*CHK************20100923~TRN*1*70408535*15714001~REF*F2*slca435w~DTM*405*20100923~N1*PR*NC TEACHERS & STATE EMPLOYEES HEALTH PLAN & HEALTH CHOICE~N3*P O BOX 30025~N4*DURHAM*NC*27702~REF*2U*11111~PER*CX**TE*8002144844~N1*PE*ACME UNIV HLTH SYS INC*XX*1234567890~N3*P O BOX AAA1~N4*DURHAM*NC*27701~REF*TJ*123456789~CLP*474623UB001CW0321*1*3740.6*5451.04**15*80209000000*11*1**397*0.7309~CAS*CO*94*-1710.44~NM1*QC*1*Rabbit*Roger*B***MI* RUN123456789~MIA*0~REF*EA*CW0321~DTM*232*20100307~DTM*233*20100310~DTM*50*20100918~AMT*AU*5451.04~SE*21*1234~
|
data/spec/example_2.835
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ST*835*1234~BPR*I*1922.86*C*CHK************20110108~TRN*1*02790758*560894904~REF*F2*LCLA438D~DTM*405*20110104~N1*PR*BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA~N3*P O BOX 2291~N4*DURHAM*NC*27702~PER*CX*TE*8005554844~N1*PE*XYZ HEALTHCARE CORPORATION*XX*0987654321~N3*P O BOX XYZ~N4*CHARLOTTE*NC*28234~REF*TJ*123456789~LX*1~CLP*200200964A52*1*2100*1922.86*142.54*15*94151100100~NM1*QC*1*Dough*Mary****MI* YPB123456789001~DTM*050*20110103~SVC*HC:59430*1210*1057.86**1*HC:59410~DTM*472*20101231~CAS*CO*42*34.6~CAS*PR*2*117.54~REF*6R*0001~AMT*B6*1175.4~SVC*HC:59440*890*865**1*HC:59410~DTM*472*20101231~CAS*PR*3*25~REF*6R*0002~SVC*HC:59426*742*742**1~DTM*472*20101231~REF*6R*0003~AMT*B6*742~SE*33*1234~
|
|
1
|
+
ST*835*1234~BPR*I*1922.86*C*CHK************20110108~TRN*1*02790758*560894904~REF*F2*LCLA438D~DTM*405*20110104~N1*PR*BLUE CROSS AND BLUE SHIELD OF NORTH CAROLINA~N3*P O BOX 2291~N4*DURHAM*NC*27702~REF*2U*22222~PER*CX*TE*8005554844~N1*PE*XYZ HEALTHCARE CORPORATION*XX*0987654321~N3*P O BOX XYZ~N4*CHARLOTTE*NC*28234~REF*TJ*123456789~LX*1~CLP*200200964A52*1*2100*1922.86*142.54*15*94151100100~NM1*QC*1*Dough*Mary****MI* YPB123456789001~DTM*050*20110103~SVC*HC:59430*1210*1057.86**1*HC:59410~DTM*472*20101231~CAS*CO*42*34.6~CAS*PR*2*117.54~REF*6R*0001~AMT*B6*1175.4~SVC*HC:59440*890*865**1*HC:59410~DTM*472*20101231~CAS*PR*3*25~REF*6R*0002~SVC*HC:59426*742*742**1~DTM*472*20101231~REF*6R*0003~AMT*B6*742~SE*33*1234~
|
data/spec/example_3.835
CHANGED
data/spec/example_5.835
ADDED
|
@@ -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.
|
|
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:
|
|
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
|