change_health 5.13.2 → 5.14.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: 0c95b37ea0d630e1b501ad965c147d322c1be1bbd9298b5c0da933fd9aa445b5
4
- data.tar.gz: 33c0714782d1d1aca7c5ea4653ca02886287c885d66922a863ab18d5cc4a31a5
3
+ metadata.gz: 48a9d4f78c8b44747e2f593a4cb24fa6050d586fe991c4fda19097e232d493ae
4
+ data.tar.gz: bc14ef980d21d8f86e883fb1089b8751225c90770ac6b893b11a64ca9342be79
5
5
  SHA512:
6
- metadata.gz: 921d83689411006e810ffd34ef3bab0be2b6442ca1623f0b2be26035433d1915cb7bcd3a58e98cc61a53f0300a16766cd90215701c08a14c49b68ae258261fb0
7
- data.tar.gz: 58ed6ee76be49d56149b2b0329a81fe5d71c9d6736170fc311f1027cf0feb304b2c5fa29f17a3965a9cf91a2b08a29f20d906223eebc3482cc619ce559c5a431
6
+ metadata.gz: 3b1b7588b4d23e366e4e53ce1deefea29ee56f03216768e9af36130342f1abedef3ed086960487181c34a39e4e481b7ac3594a3ce45920ca2c3f5327f7be4a9c
7
+ data.tar.gz: fdf31926f445379f99b9a8645b7be6f5529f8a38c3936a044264330572f1bd7a3ac818d216de3da418abd9e23dce60ff17de5534949925cad7ac95415dd1304c
data/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ 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
+ # [5.14.0] - 2024-06-11
9
+
10
+ ### Added
11
+
12
+ * The following report methods can override the base URI, endpoint, and authentication headers per request if needed:
13
+ - `ChangeHealth::Request::Claim::Report.report_list`
14
+ - `ChangeHealth::Request::Claim::Report.get_report`
15
+ - `ChangeHealth::Request::Claim::Report.delete_report`
16
+
17
+ Provide the following parameters to override the defaults set in Configuration:
18
+ - `base_uri`
19
+ - `endpoint`
20
+ - `auth_headers` - an empty hash can also be provided (`{}`), which will issue a request to the authentication endpoint instead of using the configured headers.
21
+
22
+ # [5.13.3] - 2024-05-20
23
+
24
+ ### Fixed
25
+
26
+ * Grab "id" per claim for ChangeHealth::Response::Claim::Report835Claim INSTEAD of per transaction. B/c each transaction is a payment, not a claim
27
+
8
28
  # [5.13.2] - 2024-05-16
9
29
 
10
30
  ### Fixed
@@ -686,6 +706,8 @@ Added the ability to hit professional claim submission API. For more details, se
686
706
  * Authentication
687
707
  * Configuration
688
708
 
709
+ [5.14.0]: https://github.com/WeInfuse/change_health/compare/v5.13.3...v5.14.0
710
+ [5.13.3]: https://github.com/WeInfuse/change_health/compare/v5.13.2...v5.13.3
689
711
  [5.13.2]: https://github.com/WeInfuse/change_health/compare/v5.13.1...v5.13.2
690
712
  [5.13.1]: https://github.com/WeInfuse/change_health/compare/v5.13.0...v5.13.1
691
713
  [5.13.0]: https://github.com/WeInfuse/change_health/compare/v5.12.1...v5.13.0
@@ -9,14 +9,15 @@ module ChangeHealth
9
9
  @request_time = nil
10
10
  end
11
11
 
12
- def authenticate
12
+ def authenticate(base_uri: nil)
13
13
  if (self.expires?)
14
+ base_uri ||= Connection.base_uri
14
15
  request = {
15
16
  body: { client_id: ChangeHealth.configuration.client_id, client_secret: ChangeHealth.configuration.client_secret, grant_type: ChangeHealth.configuration.grant_type },
16
17
  endpoint: AUTH_ENDPOINT
17
18
  }
18
19
 
19
- response = Connection.new.request(**request, auth: false)
20
+ response = Connection.new.request(**request, auth: false, base_uri: base_uri)
20
21
 
21
22
  if (false == response.ok?)
22
23
  @response = nil
@@ -13,12 +13,22 @@ module ChangeHealth
13
13
 
14
14
  format :json
15
15
 
16
- def request(endpoint:, query: nil, body: nil, headers: {}, auth: true, verb: :post)
16
+ def request(
17
+ endpoint:,
18
+ query: nil,
19
+ body: nil,
20
+ headers: {},
21
+ auth: true,
22
+ verb: :post,
23
+ base_uri: nil,
24
+ auth_headers: nil
25
+ )
26
+ base_uri ||= Connection.base_uri
17
27
  body = body.to_json if body.is_a?(Hash)
18
28
  headers = {} if headers.nil?
19
- headers = auth_header.merge(headers) if auth
29
+ headers = auth_header(base_uri: base_uri, auth_headers: auth_headers).merge(headers) if auth
20
30
 
21
- self.class.send(verb.to_s, endpoint, query: query, body: body, headers: headers)
31
+ self.class.send(verb.to_s, endpoint, query: query, body: body, headers: headers, base_uri: base_uri)
22
32
  end
23
33
 
24
34
  def self.endpoint_for(klass, default_endpoint: nil)
@@ -30,13 +40,15 @@ module ChangeHealth
30
40
 
31
41
  private
32
42
 
33
- def auth_header
34
- if ChangeHealth.configuration.auth_headers.nil?
43
+ def auth_header(base_uri: nil, auth_headers: nil)
44
+ auth_headers ||= ChangeHealth.configuration.auth_headers
45
+
46
+ if auth_headers.nil? || auth_headers.empty?
35
47
  @auth ||= Authentication.new
36
48
 
37
- @auth.authenticate.access_header
49
+ @auth.authenticate(base_uri: base_uri).access_header
38
50
  else
39
- ChangeHealth.configuration.auth_headers
51
+ auth_headers
40
52
  end
41
53
  end
42
54
  end
@@ -5,11 +5,16 @@ module ChangeHealth
5
5
  ENDPOINT = '/medicalnetwork/reports/v2'.freeze
6
6
  HEALTH_CHECK_ENDPOINT = ENDPOINT + '/healthcheck'.freeze
7
7
 
8
- def self.report_list(headers: nil, more_url: nil)
9
- endpoint = ChangeHealth::Connection.endpoint_for(self) + more_url.to_s
8
+ def self.report_list(headers: nil, more_url: nil, base_uri: nil, endpoint: nil, auth_headers: nil)
9
+ endpoint ||= ChangeHealth::Connection.endpoint_for(self)
10
+ endpoint += more_url.to_s
10
11
  final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
11
12
  ChangeHealth::Response::Claim::ReportListData.new(response: ChangeHealth::Connection.new.request(
12
- endpoint: endpoint, verb: :get, headers: final_headers
13
+ endpoint: endpoint,
14
+ verb: :get,
15
+ headers: final_headers,
16
+ base_uri: base_uri,
17
+ auth_headers: auth_headers
13
18
  ))
14
19
  end
15
20
 
@@ -17,13 +22,16 @@ module ChangeHealth
17
22
  report_name,
18
23
  as_json_report: true,
19
24
  headers: nil,
20
- report_type: nil
25
+ report_type: nil,
26
+ base_uri: nil,
27
+ endpoint: nil,
28
+ auth_headers: nil
21
29
  )
22
30
  return if report_name.nil? || report_name.empty?
23
31
 
24
32
  final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
25
33
 
26
- endpoint = ChangeHealth::Connection.endpoint_for(self)
34
+ endpoint ||= ChangeHealth::Connection.endpoint_for(self)
27
35
 
28
36
  individual_report_endpoint = "#{endpoint}/#{report_name}"
29
37
 
@@ -38,7 +46,9 @@ module ChangeHealth
38
46
  response = ChangeHealth::Connection.new.request(
39
47
  endpoint: individual_report_endpoint,
40
48
  verb: :get,
41
- headers: final_headers
49
+ headers: final_headers,
50
+ base_uri: base_uri,
51
+ auth_headers: auth_headers
42
52
  )
43
53
  if ChangeHealth::Response::Claim::ReportData.is_277?(report_name)
44
54
  ChangeHealth::Response::Claim::Report277Data
@@ -58,18 +68,20 @@ module ChangeHealth
58
68
  end
59
69
  end
60
70
 
61
- def self.delete_report(report_name, headers: nil)
71
+ def self.delete_report(report_name, headers: nil, base_uri: nil, endpoint: nil, auth_headers: nil)
62
72
  return if report_name.nil? || report_name.empty?
63
73
 
64
74
  final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
65
75
 
66
- endpoint = ChangeHealth::Connection.endpoint_for(self)
76
+ endpoint ||= ChangeHealth::Connection.endpoint_for(self)
67
77
  individual_report_endpoint = "#{endpoint}/#{report_name}"
68
78
 
69
79
  ChangeHealth::Connection.new.request(
70
80
  endpoint: individual_report_endpoint,
71
81
  verb: :delete,
72
- headers: final_headers
82
+ headers: final_headers,
83
+ base_uri: base_uri,
84
+ auth_headers: auth_headers
73
85
  )
74
86
  end
75
87
 
@@ -28,7 +28,7 @@ module ChangeHealth
28
28
  report_payments = []
29
29
 
30
30
  transactions&.each do |transaction|
31
- id = transaction.dig('id')
31
+ payment_id = transaction.dig('id')
32
32
  check_or_eft_trace_number = transaction.dig('paymentAndRemitReassociationDetails', 'checkOrEFTTraceNumber')
33
33
  check_issue_or_eft_effective_date =
34
34
  ChangeHealth::Models::PARSE_DATE.call(
@@ -56,6 +56,7 @@ module ChangeHealth
56
56
  total_actual_provider_payment_amount =
57
57
  transaction.dig('financialInformation', 'totalActualProviderPaymentAmount')
58
58
  claims = transaction['detailInfo']&.flat_map do |detail_info|
59
+ claim_id = detail_info.dig('id')
59
60
  detail_info['paymentInfo']&.map do |payment_info|
60
61
  claim_payment_amount = payment_info.dig('claimPaymentInfo', 'claimPaymentAmount')
61
62
  claim_status_code = payment_info.dig('claimPaymentInfo', 'claimStatusCode')
@@ -141,7 +142,7 @@ module ChangeHealth
141
142
  claim_payment_amount: claim_payment_amount,
142
143
  claim_payment_remark_codes: claim_payment_remark_codes,
143
144
  claim_status_code: claim_status_code,
144
- id: id,
145
+ id: claim_id,
145
146
  patient_control_number: patient_control_number,
146
147
  patient_first_name: patient_first_name,
147
148
  patient_last_name: patient_last_name,
@@ -163,7 +164,7 @@ module ChangeHealth
163
164
  check_issue_or_eft_effective_date: check_issue_or_eft_effective_date,
164
165
  check_or_eft_trace_number: check_or_eft_trace_number,
165
166
  claims: claims,
166
- id: id,
167
+ id: payment_id,
167
168
  payer_identifier: payer_identifier,
168
169
  payer_name: payer_name,
169
170
  payer_address: payer_address,
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '5.13.2'.freeze
2
+ VERSION = '5.14.0'.freeze
3
3
  end
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: 5.13.2
4
+ version: 5.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Crockett
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-16 00:00:00.000000000 Z
11
+ date: 2024-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -128,7 +128,7 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0.9'
131
- description:
131
+ description:
132
132
  email:
133
133
  - mike.crockett@weinfuse.com
134
134
  executables: []
@@ -206,7 +206,7 @@ licenses:
206
206
  - MIT
207
207
  metadata:
208
208
  allowed_push_host: https://rubygems.org
209
- post_install_message:
209
+ post_install_message:
210
210
  rdoc_options: []
211
211
  require_paths:
212
212
  - lib
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  version: '0'
223
223
  requirements: []
224
224
  rubygems_version: 3.1.6
225
- signing_key:
225
+ signing_key:
226
226
  specification_version: 4
227
227
  summary: Ruby wrapper for the ChangeHealth API
228
228
  test_files: []