change_health 3.5.3 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 601bff416950731a5af885161eedc34e97d79a8f746e96459229a483683bd5a1
4
- data.tar.gz: e66cfc8da889738869f830d3c46aa9176d08159405daa4865a083d544587da99
3
+ metadata.gz: 9bbc1e710e4746b0aa9a3b4b3189d512a331866898146784d8e9581b29067197
4
+ data.tar.gz: 348dcd9c463548cc237a1e505aacb0c66616d63e478ae404ea3a18fe335a7545
5
5
  SHA512:
6
- metadata.gz: aba95ecb3b61500e430a0112b5ba126104ce37ac31a1308ac29103f28d2b2b9a33c6b1e71acc137cf2a8c2f651749534a9e16cf1e1295afcccc264f2d66bf997
7
- data.tar.gz: e45adcf2fb3410c067db15503fb15b3cc053ab69111f4afec47bcdae76c5f95bd5c78c61e5c612ea20d836e9b4b5b51ba4e43eb65836ff331923e3b24e4e45dd
6
+ metadata.gz: 0a14286f7f3d39c38ae891c7d2094dd99df356a4169f23b3fe72daa8eaa5a7353d2aa79f8d3c12f74ceb2f73d2d63688fc463a5f746786243f978d7b70de864d
7
+ data.tar.gz: 064e0cab9b729afade6eb158ea093bbd15c512dea122f91561edc3f0c0f0daa5c805c995a4bd953f7fcf123d0209f8ee3b471356825f6c19453f83f6cec004a5
data/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ # [4.1.0] - 2022-06-17
9
+
10
+ ### Added
11
+ Report835Claim - Add another way to get `service_provider_npi`
12
+
13
+ # [4.0.0] - 2022-05-26
14
+
15
+ ### Changed
16
+ The assumption that only one payment would be in a report835 was wrong. Corrected that by adding in a model to hold the payment information - Report835Payment. Removed payment related info from Report835Data and Report835Claim. See README for usage
17
+ * check_issue_or_eft_effective_date
18
+ * check_or_eft_trace_number
19
+ * payer_identifier
20
+ * payment_method_code
21
+ * report_creation_date
22
+ * total_actual_provider_payment_amount
23
+
24
+ # [3.5.4] - 2022-05-18
25
+
26
+ * Used dig on `service_provider_npi` variable assigning because it produces way fewer bugs
27
+
7
28
  # [3.5.3] - 2022-05-18
8
29
 
9
30
  * Added new ways to assign `patient_member_id` and `service_provider_npi` for claim reports returned by insurance
@@ -352,6 +373,9 @@ Added the ability to hit professional claim submission API. For more details, se
352
373
  * Authentication
353
374
  * Configuration
354
375
 
376
+ [4.1.0]: https://github.com/WeInfuse/change_health/compare/v4.0.0...v4.1.0
377
+ [4.0.0]: https://github.com/WeInfuse/change_health/compare/v3.5.4...v4.0.0
378
+ [3.5.4]: https://github.com/WeInfuse/change_health/compare/v3.5.3...v3.5.4
355
379
  [3.5.3]: https://github.com/WeInfuse/change_health/compare/v3.5.2...v3.5.3
356
380
  [3.5.2]: https://github.com/WeInfuse/change_health/compare/v3.5.1...v3.5.2
357
381
  [3.5.1]: https://github.com/WeInfuse/change_health/compare/v3.5.0...v3.5.1
data/README.md CHANGED
@@ -243,66 +243,68 @@ From a report, you can get an array of claims
243
243
  #### Report 277
244
244
 
245
245
  ```ruby
246
- report_277_data = ChangeHealth::Request::Claim::Report.get_report("X3000000.AB", as_json_report: true)
246
+ report277_data = ChangeHealth::Request::Claim::Report.get_report("X3000000.AB", as_json_report: true)
247
247
 
248
- report_277_data.payer_name
248
+ report277_data.payer_name
249
249
  # "PREMERA"
250
250
 
251
- report_277_data.report_creation_date
251
+ report277_data.report_creation_date
252
252
  # Tue, 01 Dec 2020
253
253
 
254
- claim_277 = report_277_data.claims.first
255
- claim_277.payer_name
254
+ claim277 = report277_data.claims.first
255
+ claim277.payer_name
256
256
  # "PREMERA"
257
257
 
258
- claim_277.report_name
258
+ claim277.report_name
259
259
  # "X3000000.AB"
260
260
 
261
- claim_277.patient_first_name
261
+ claim277.patient_first_name
262
262
  # "JOHNONE"
263
263
 
264
- claim_277.report_creation_date
264
+ claim277.report_creation_date
265
265
  # Tue, 01 Dec 2020
266
266
 
267
267
  # Report 277 specific below
268
- claim_277.latest_status_category_codes
268
+ claim277.latest_status_category_codes
269
269
  # ["F1"]
270
270
 
271
- claim_277.total_charge_amount
271
+ claim277.total_charge_amount
272
272
  # "100"
273
273
 
274
- claim_277.procedure_codes
274
+ claim277.procedure_codes
275
275
  # ["97161"]
276
276
  ```
277
277
 
278
278
  #### Report 835
279
279
 
280
280
  ```ruby
281
- report_835_data = ChangeHealth::Request::Claim::Report.get_report("R5000000.XY", as_json_report: true)
281
+ report835_data = ChangeHealth::Request::Claim::Report.get_report("R5000000.XY", as_json_report: true)
282
282
 
283
- report_835_data.payment_method_code
283
+ payment835 = report835_data.payments.first
284
+
285
+ payment835.payment_method_code
284
286
  # "ACH"
285
287
 
286
- report_835_data.total_actual_provider_payment_amount
288
+ payment835.total_actual_provider_payment_amount
287
289
  # "2563.13"
288
290
 
289
- claim_835 = report_835_data.claims.first
290
- claim_835.payer_name
291
+ claim835 = payment835.claims.first
292
+ claim835.payer_name
291
293
  # "NATIONAL GOVERNMENT SERVICES, INC."
292
294
 
293
- claim_835.patient_first_name
295
+ claim835.patient_first_name
294
296
  # "JANE"
295
297
 
296
- claim_835.patient_member_id
298
+ claim835.patient_member_id
297
299
  # "7SL5RA7XR19"
298
300
 
299
- claim_835.report_creation_date
301
+ claim835.report_creation_date
300
302
  # Wed, 22 Apr 2020
301
303
 
302
- claim_835.procedure_codes
304
+ claim835.procedure_codes
303
305
  # ["21210", "21026", "21208", "30580"]
304
306
 
305
- claim_835.service_lines.map(&:line_item_charge_amount)
307
+ claim835.service_lines.map(&:line_item_charge_amount)
306
308
  # ["3600", "1890", "1836", "1680"]
307
309
  ```
308
310
 
@@ -2,15 +2,10 @@ module ChangeHealth
2
2
  module Response
3
3
  module Claim
4
4
  class Report835Claim < ReportClaim
5
- property :check_issue_or_eft_effective_date, required: false
6
- property :check_or_eft_trace_number, required: false
7
5
  property :claim_payment_remark_codes, required: false
8
6
  property :patient_control_number, required: false
9
7
  property :payer_claim_control_number, required: false
10
- property :payer_identifier, required: false
11
- property :payment_method_code, required: false
12
8
  property :service_lines, required: false
13
- property :total_actual_provider_payment_amount, required: false
14
9
  property :total_charge_amount, required: false
15
10
 
16
11
  def procedure_codes
@@ -7,14 +7,6 @@ module ChangeHealth
7
7
  @raw['transactions']
8
8
  end
9
9
 
10
- def check_or_eft_trace_number
11
- transactions&.first&.dig('paymentAndRemitReassociationDetails', 'checkOrEFTTraceNumber')
12
- end
13
-
14
- def check_issue_or_eft_effective_date
15
- ChangeHealth::Models::PARSE_DATE.call(transactions&.first&.dig('financialInformation', 'checkIssueOrEFTEffectiveDate'))
16
- end
17
-
18
10
  def payer_identification
19
11
  transactions&.first&.dig('payer', 'payerIdentificationNumber')
20
12
  end
@@ -24,34 +16,41 @@ module ChangeHealth
24
16
  transactions&.first&.dig('payer')&.dig('name')
25
17
  end
26
18
 
27
- def payer_identifier
28
- ChangeHealth::Models::PARSE_DATE.call(transactions&.first&.dig('financialInformation', 'payerIdentifier'))
29
- end
30
-
31
- def payment_method_code
32
- transactions&.first&.dig('financialInformation', 'paymentMethodCode')
33
- end
34
-
35
19
  def report_creation_date
36
- ChangeHealth::Models::PARSE_DATE.call(transactions&.first&.dig('productionDate'))
20
+ payments.map(&:report_creation_date).min
37
21
  end
38
22
 
39
- def total_actual_provider_payment_amount
40
- transactions&.first&.dig('financialInformation', 'totalActualProviderPaymentAmount')
23
+ def claims
24
+ payments.flat_map(&:claims).compact
41
25
  end
42
26
 
43
- def claims
44
- report_claims = []
27
+ def payments
28
+ report_payments = []
45
29
 
46
30
  transactions&.each do |transaction|
47
- transaction['detailInfo']&.each do |detail_info|
48
- detail_info['paymentInfo']&.each do |payment_info|
31
+ check_or_eft_trace_number = transaction.dig('paymentAndRemitReassociationDetails', 'checkOrEFTTraceNumber')
32
+ check_issue_or_eft_effective_date =
33
+ ChangeHealth::Models::PARSE_DATE.call(
34
+ transaction.dig('financialInformation', 'checkIssueOrEFTEffectiveDate')
35
+ )
36
+ payer_identifier = transaction.dig('financialInformation', 'payerIdentifier')
37
+ payment_method_code = transaction.dig('financialInformation', 'paymentMethodCode')
38
+ report_creation_date = ChangeHealth::Models::PARSE_DATE.call(transaction.dig('productionDate'))
39
+ total_actual_provider_payment_amount =
40
+ transaction.dig('financialInformation', 'totalActualProviderPaymentAmount')
41
+ claims = transaction['detailInfo']&.flat_map do |detail_info|
42
+ detail_info['paymentInfo']&.map do |payment_info|
49
43
  patient_control_number = payment_info.dig('claimPaymentInfo', 'patientControlNumber')
50
44
  patient_first_name = payment_info.dig('patientName', 'firstName')
51
45
  patient_last_name = payment_info.dig('patientName', 'lastName')
52
- patient_member_id = payment_info.dig('patientName', 'memberId') || payment_info.dig('subscriber', 'memberId')
46
+ patient_member_id =
47
+ payment_info.dig('patientName', 'memberId') ||
48
+ payment_info.dig('subscriber', 'memberId')
53
49
  payer_claim_control_number = payment_info.dig('claimPaymentInfo', 'payerClaimControlNumber')
54
- service_provider_npi = payment_info.dig('renderingProvider', 'npi') || detail_info['providerSummaryInformation']['providerIdentifier']
50
+ service_provider_npi =
51
+ payment_info.dig('renderingProvider', 'npi') ||
52
+ detail_info.dig('providerSummaryInformation', 'providerIdentifier') ||
53
+ transaction.dig('payee', 'npi')
55
54
  total_charge_amount = payment_info.dig('claimPaymentInfo', 'totalClaimChargeAmount')
56
55
 
57
56
  claim_payment_remark_codes = []
@@ -114,9 +113,7 @@ module ChangeHealth
114
113
  )
115
114
  end
116
115
 
117
- report_claims << Report835Claim.new(
118
- check_issue_or_eft_effective_date: check_issue_or_eft_effective_date,
119
- check_or_eft_trace_number: check_or_eft_trace_number,
116
+ Report835Claim.new(
120
117
  claim_payment_remark_codes: claim_payment_remark_codes,
121
118
  patient_control_number: patient_control_number,
122
119
  patient_first_name: patient_first_name,
@@ -124,23 +121,31 @@ module ChangeHealth
124
121
  patient_member_id: patient_member_id,
125
122
  payer_claim_control_number: payer_claim_control_number,
126
123
  payer_identification: payer_identification,
127
- payer_identifier: payer_identifier,
128
124
  payer_name: payer_name,
129
- payment_method_code: payment_method_code,
130
125
  report_creation_date: report_creation_date,
131
126
  report_name: report_name,
132
127
  service_date_begin: service_date_begin,
133
128
  service_date_end: service_date_end,
134
129
  service_lines: service_lines,
135
130
  service_provider_npi: service_provider_npi,
136
- total_actual_provider_payment_amount: total_actual_provider_payment_amount,
137
131
  total_charge_amount: total_charge_amount
138
132
  )
139
133
  end
140
134
  end
135
+ report_payments << Report835Payment.new(
136
+ check_issue_or_eft_effective_date: check_issue_or_eft_effective_date,
137
+ check_or_eft_trace_number: check_or_eft_trace_number,
138
+ claims: claims,
139
+ payer_identifier: payer_identifier,
140
+ payer_name: payer_name,
141
+ payment_method_code: payment_method_code,
142
+ report_creation_date: report_creation_date,
143
+ report_name: report_name,
144
+ total_actual_provider_payment_amount: total_actual_provider_payment_amount
145
+ )
141
146
  end
142
147
 
143
- report_claims
148
+ report_payments
144
149
  end
145
150
  end
146
151
  end
@@ -0,0 +1,17 @@
1
+ module ChangeHealth
2
+ module Response
3
+ module Claim
4
+ class Report835Payment < Hashie::Trash
5
+ property :check_issue_or_eft_effective_date, required: false
6
+ property :check_or_eft_trace_number, required: false
7
+ property :claims, required: false
8
+ property :payer_identifier, required: false
9
+ property :payer_name, required: false
10
+ property :payment_method_code, required: false
11
+ property :report_creation_date, required: false
12
+ property :report_name, required: false
13
+ property :total_actual_provider_payment_amount, required: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '3.5.3'.freeze
2
+ VERSION = '4.1.0'.freeze
3
3
  end
data/lib/change_health.rb CHANGED
@@ -33,6 +33,7 @@ require 'change_health/response/claim/report/report_277_claim'
33
33
  require 'change_health/response/claim/report/report_277_info_claim_status'
34
34
  require 'change_health/response/claim/report/report_835_claim'
35
35
  require 'change_health/response/claim/report/report_835_health_care_check_remark_code'
36
+ require 'change_health/response/claim/report/report_835_payment'
36
37
  require 'change_health/response/claim/report/report_835_service_adjustment'
37
38
  require 'change_health/response/claim/report/report_835_service_line'
38
39
  require 'change_health/response/eligibility/eligibility_benefit'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: change_health
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.3
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Crockett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-18 00:00:00.000000000 Z
11
+ date: 2022-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -169,6 +169,7 @@ files:
169
169
  - lib/change_health/response/claim/report/report_835_claim.rb
170
170
  - lib/change_health/response/claim/report/report_835_data.rb
171
171
  - lib/change_health/response/claim/report/report_835_health_care_check_remark_code.rb
172
+ - lib/change_health/response/claim/report/report_835_payment.rb
172
173
  - lib/change_health/response/claim/report/report_835_service_adjustment.rb
173
174
  - lib/change_health/response/claim/report/report_835_service_line.rb
174
175
  - lib/change_health/response/claim/report/report_claim.rb