change_health 3.5.4 → 4.2.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: 8952c67e30c7585a6b8f4183e444f1a67ea6d81a89e52c2a6748c2362f5c1eae
4
- data.tar.gz: ac88b77be6c178e77cb7ea341fa0cd9a3796aa6012712142e4bb71953f3cb220
3
+ metadata.gz: 2637bc096949ab2c8f7b81fa9309775c6eaa85c11deccc290ffcb9f4bb1087bf
4
+ data.tar.gz: ff804042b7637317f61235c0c9a1a3b14ce3e0e5dd2b50abeb35e5d4ca186626
5
5
  SHA512:
6
- metadata.gz: dee82a6f161a6b74c6eba6ba352ed1daa64cb7b9cbd5ba51992aba3928d2957f401e6cadf86295667dbcaf62d82f36d1190e6aef3559304f2904b34f5bf869e0
7
- data.tar.gz: 862e3585d1c3f077dfe1a1a8341c55afb574c4ed05d16c50d347a446b26c667a26452585d034c47b36682c95ee914eace40ba418ec426ec87ac8b6c0f8b456f5
6
+ metadata.gz: 78583b56f70eebd10a5548c027255fe3634c364d2e8851ae2c3b59f3d4c2d2fa3320a05b443b8d580bc75dbe6ab31d6b51968b4d563965c1431b53dafa901ed3
7
+ data.tar.gz: 95ee855e844601a69b79a3298b4a04cac51bb5294635f4691187a2db2542c32d31fd289dba0ae5ef78ebfd35f475b966519348e86ef17c354bf79a36ec597c39
data/CHANGELOG.md CHANGED
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
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
7
 
8
+ # [4.2.0] - 2022-06-23
9
+
10
+ ### Added
11
+ * Dependent for Claim Submission
12
+
13
+ # [4.1.0] - 2022-06-17
14
+
15
+ ### Added
16
+ Report835Claim - Add another way to get `service_provider_npi`
17
+
18
+ # [4.0.0] - 2022-05-26
19
+
20
+ ### Changed
21
+ 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
22
+ * check_issue_or_eft_effective_date
23
+ * check_or_eft_trace_number
24
+ * payer_identifier
25
+ * payment_method_code
26
+ * report_creation_date
27
+ * total_actual_provider_payment_amount
28
+
8
29
  # [3.5.4] - 2022-05-18
9
30
 
10
31
  * Used dig on `service_provider_npi` variable assigning because it produces way fewer bugs
@@ -357,6 +378,9 @@ Added the ability to hit professional claim submission API. For more details, se
357
378
  * Authentication
358
379
  * Configuration
359
380
 
381
+ [4.2.0]: https://github.com/WeInfuse/change_health/compare/v4.1.0...v4.2.0
382
+ [4.1.0]: https://github.com/WeInfuse/change_health/compare/v4.0.0...v4.1.0
383
+ [4.0.0]: https://github.com/WeInfuse/change_health/compare/v3.5.4...v4.0.0
360
384
  [3.5.4]: https://github.com/WeInfuse/change_health/compare/v3.5.3...v3.5.4
361
385
  [3.5.3]: https://github.com/WeInfuse/change_health/compare/v3.5.2...v3.5.3
362
386
  [3.5.2]: https://github.com/WeInfuse/change_health/compare/v3.5.1...v3.5.2
data/README.md CHANGED
@@ -113,7 +113,7 @@ address = ChangeHealth::Models::Claim::Address.new(
113
113
  address1: "123 address1",
114
114
  city: "city1",
115
115
  state: "wa",
116
- postalCode: "98101-0000"
116
+ postalCode: "981010000"
117
117
  )
118
118
 
119
119
  subscriber = ChangeHealth::Models::Claim::Subscriber.new(
@@ -125,6 +125,17 @@ subscriber = ChangeHealth::Models::Claim::Subscriber.new(
125
125
  date_of_birth: "02/01/1980",
126
126
  address: address
127
127
  )
128
+
129
+ dependent = ChangeHealth::Models::Claim::Dependent.new(
130
+ address: address,
131
+ date_of_birth: "02/01/1980",
132
+ first_name: "johnone",
133
+ gender: "M",
134
+ last_name: "doetwo",
135
+ member_id: "0000000001",
136
+ relationship_to_subscriber_code: "01"
137
+ )
138
+
128
139
  provider = ChangeHealth::Models::Claim::Provider.new(
129
140
  address: address,
130
141
  employer_id: "000000000",
@@ -191,13 +202,14 @@ professional_headers = {
191
202
  }
192
203
 
193
204
  claim_submission = ChangeHealth::Request::Claim::Submission.new(
194
- trading_partner_service_id: "9496",
195
- submitter: claim_submitter,
205
+ claim_information: claim_information,
206
+ dependent: dependent,
207
+ headers: professional_headers,
208
+ providers: [provider],
196
209
  receiver: receiver,
210
+ submitter: claim_submitter,
197
211
  subscriber: subscriber,
198
- providers: [provider],
199
- claim_information: claim_information,
200
- headers: professional_headers
212
+ trading_partner_service_id: "9496"
201
213
  )
202
214
 
203
215
  claim_submission_data = claim_submission.submission
@@ -243,66 +255,68 @@ From a report, you can get an array of claims
243
255
  #### Report 277
244
256
 
245
257
  ```ruby
246
- report_277_data = ChangeHealth::Request::Claim::Report.get_report("X3000000.AB", as_json_report: true)
258
+ report277_data = ChangeHealth::Request::Claim::Report.get_report("X3000000.AB", as_json_report: true)
247
259
 
248
- report_277_data.payer_name
260
+ report277_data.payer_name
249
261
  # "PREMERA"
250
262
 
251
- report_277_data.report_creation_date
263
+ report277_data.report_creation_date
252
264
  # Tue, 01 Dec 2020
253
265
 
254
- claim_277 = report_277_data.claims.first
255
- claim_277.payer_name
266
+ claim277 = report277_data.claims.first
267
+ claim277.payer_name
256
268
  # "PREMERA"
257
269
 
258
- claim_277.report_name
270
+ claim277.report_name
259
271
  # "X3000000.AB"
260
272
 
261
- claim_277.patient_first_name
273
+ claim277.patient_first_name
262
274
  # "JOHNONE"
263
275
 
264
- claim_277.report_creation_date
276
+ claim277.report_creation_date
265
277
  # Tue, 01 Dec 2020
266
278
 
267
279
  # Report 277 specific below
268
- claim_277.latest_status_category_codes
280
+ claim277.latest_status_category_codes
269
281
  # ["F1"]
270
282
 
271
- claim_277.total_charge_amount
283
+ claim277.total_charge_amount
272
284
  # "100"
273
285
 
274
- claim_277.procedure_codes
286
+ claim277.procedure_codes
275
287
  # ["97161"]
276
288
  ```
277
289
 
278
290
  #### Report 835
279
291
 
280
292
  ```ruby
281
- report_835_data = ChangeHealth::Request::Claim::Report.get_report("R5000000.XY", as_json_report: true)
293
+ report835_data = ChangeHealth::Request::Claim::Report.get_report("R5000000.XY", as_json_report: true)
294
+
295
+ payment835 = report835_data.payments.first
282
296
 
283
- report_835_data.payment_method_code
297
+ payment835.payment_method_code
284
298
  # "ACH"
285
299
 
286
- report_835_data.total_actual_provider_payment_amount
300
+ payment835.total_actual_provider_payment_amount
287
301
  # "2563.13"
288
302
 
289
- claim_835 = report_835_data.claims.first
290
- claim_835.payer_name
303
+ claim835 = payment835.claims.first
304
+ claim835.payer_name
291
305
  # "NATIONAL GOVERNMENT SERVICES, INC."
292
306
 
293
- claim_835.patient_first_name
307
+ claim835.patient_first_name
294
308
  # "JANE"
295
309
 
296
- claim_835.patient_member_id
310
+ claim835.patient_member_id
297
311
  # "7SL5RA7XR19"
298
312
 
299
- claim_835.report_creation_date
313
+ claim835.report_creation_date
300
314
  # Wed, 22 Apr 2020
301
315
 
302
- claim_835.procedure_codes
316
+ claim835.procedure_codes
303
317
  # ["21210", "21026", "21208", "30580"]
304
318
 
305
- claim_835.service_lines.map(&:line_item_charge_amount)
319
+ claim835.service_lines.map(&:line_item_charge_amount)
306
320
  # ["3600", "1890", "1836", "1680"]
307
321
  ```
308
322
 
@@ -0,0 +1,15 @@
1
+ module ChangeHealth
2
+ module Models
3
+ module Claim
4
+ class Dependent < Model
5
+ property :address, required: false
6
+ property :dateOfBirth, from: :date_of_birth, required: false
7
+ property :firstName, from: :first_name, required: false
8
+ property :gender, required: false
9
+ property :lastName, from: :last_name, required: false
10
+ property :memberId, from: :member_id, required: false
11
+ property :relationshipToSubscriberCode, from: :relationship_to_subscriber_code, required: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -9,6 +9,7 @@ module ChangeHealth
9
9
 
10
10
  property :claimInformation, from: :claim_information, required: false
11
11
  property :controlNumber, from: :control_number, required: true, default: ChangeHealth::Models::CONTROL_NUMBER
12
+ property :dependent, required: false
12
13
  property :providers, required: false
13
14
  property :receiver, required: false
14
15
  property :submitter, required: false
@@ -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.dig('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.4'.freeze
2
+ VERSION = '4.2.0'.freeze
3
3
  end
data/lib/change_health.rb CHANGED
@@ -8,6 +8,7 @@ require 'change_health/extensions'
8
8
  require 'change_health/models/model'
9
9
  require 'change_health/models/claim/submission/address'
10
10
  require 'change_health/models/claim/submission/claim_information'
11
+ require 'change_health/models/claim/submission/dependent'
11
12
  require 'change_health/models/claim/submission/drug_identification'
12
13
  require 'change_health/models/claim/submission/provider'
13
14
  require 'change_health/models/claim/submission/service_line'
@@ -33,6 +34,7 @@ require 'change_health/response/claim/report/report_277_claim'
33
34
  require 'change_health/response/claim/report/report_277_info_claim_status'
34
35
  require 'change_health/response/claim/report/report_835_claim'
35
36
  require 'change_health/response/claim/report/report_835_health_care_check_remark_code'
37
+ require 'change_health/response/claim/report/report_835_payment'
36
38
  require 'change_health/response/claim/report/report_835_service_adjustment'
37
39
  require 'change_health/response/claim/report/report_835_service_line'
38
40
  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.4
4
+ version: 4.2.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-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -149,6 +149,7 @@ files:
149
149
  - lib/change_health/extensions.rb
150
150
  - lib/change_health/models/claim/submission/address.rb
151
151
  - lib/change_health/models/claim/submission/claim_information.rb
152
+ - lib/change_health/models/claim/submission/dependent.rb
152
153
  - lib/change_health/models/claim/submission/drug_identification.rb
153
154
  - lib/change_health/models/claim/submission/provider.rb
154
155
  - lib/change_health/models/claim/submission/service_line.rb
@@ -169,6 +170,7 @@ files:
169
170
  - lib/change_health/response/claim/report/report_835_claim.rb
170
171
  - lib/change_health/response/claim/report/report_835_data.rb
171
172
  - lib/change_health/response/claim/report/report_835_health_care_check_remark_code.rb
173
+ - lib/change_health/response/claim/report/report_835_payment.rb
172
174
  - lib/change_health/response/claim/report/report_835_service_adjustment.rb
173
175
  - lib/change_health/response/claim/report/report_835_service_line.rb
174
176
  - lib/change_health/response/claim/report/report_claim.rb