change_health 5.4.1 → 5.5.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: 662e2ffab8b29a602148c99d26a99b1d19bf4ddb8fdf70f8307e0099ea39283b
4
- data.tar.gz: 7d521347d6d866e0bf47bf592d1ec4ba18a008311a81a2d3835be048b92ef54e
3
+ metadata.gz: 68c9d3df25d6f47b5a970058fc6aef97b372a605a2be2a7f81569b665b6d69ba
4
+ data.tar.gz: 79b1857e502ab8e6fae635e230a5d22362c814b3aadb161d912d53d970cf00e4
5
5
  SHA512:
6
- metadata.gz: '064021867b8b53a42d923fb58285698360313fb7742022fe625487bde8d372c8aa7ccdf2aca67f9cf68fce45678943e4ba5466d1449ead7175b45ceb56365c2f'
7
- data.tar.gz: 1846e1127af573bcc7373f277aea0e668b7c1554318f37f43a4e120fc6603e8dfa57d08c39511397c148accf14914dd52061ef64e74d42611df284e1a037c75e
6
+ metadata.gz: f5a37f908a5da6a9b1c2cb09bc19f94355c54b1eebea564faba52746f22c9fefce045d0f95b51a7aac932bdb6be0e953a7d945baa46f6ea66aa341fcb8a43a69
7
+ data.tar.gz: 60c0fbc7030dd5caee716952620e2b09c7b7d320a7249d26f3937ee22e75164b049ac3d9b99391b8a609ca6f325eba028ef96e6033c7dccb240e407f9547caed
data/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ 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.5.0] - 2024-03-06
9
+
10
+ ### Added
11
+
12
+ * Added new configuration options for endpoint overrides and different authorization
13
+ * Now Ruby 3.x compatible
14
+ * Changed eligibilty to use new override option
15
+
16
+ # [5.4.2] - 2023-10-31
17
+
18
+ ### Added
19
+
20
+ * Added demoProjectIdentifier attribute to ChangeHealth::Models::Claim::ClaimSupplementalInformation
21
+
8
22
  # [5.4.1] - 2023-10-30
9
23
 
10
24
  ### Added
@@ -593,6 +607,8 @@ Added the ability to hit professional claim submission API. For more details, se
593
607
  * Authentication
594
608
  * Configuration
595
609
 
610
+ [5.5.0]: https://github.com/WeInfuse/change_health/compare/v5.4.2...v5.5.0
611
+ [5.4.2]: https://github.com/WeInfuse/change_health/compare/v5.4.1...v5.4.2
596
612
  [5.4.1]: https://github.com/WeInfuse/change_health/compare/v5.4.0...v5.4.1
597
613
  [5.4.0]: https://github.com/WeInfuse/change_health/compare/v5.3.1...v5.4.0
598
614
  [5.3.1]: https://github.com/WeInfuse/change_health/compare/v5.3.0...v5.3.1
data/README.md CHANGED
@@ -363,6 +363,14 @@ claim_submission = ChangeHealth::Request::Claim::Submission.new(
363
363
  billing_pay_to_address_name: billing_pay_to_address_name
364
364
  )
365
365
 
366
+ claim_supplemental_information = ChangeHealth::Models::Claim::ClaimSupplementalInformation.new(
367
+ claim_control_number: 'claimControlNumber',
368
+ demo_project_identifier: 'demoProjectIdentifier',
369
+ prior_authorization_number: 'priorAuthorizationNumber',
370
+ referral_number: 'referralNumber',
371
+ report_information: 'reportInformation'
372
+ )
373
+
366
374
  claim_submission_data = claim_submission.submission(is_professional: false)
367
375
 
368
376
  validation = claim_submission.validation(is_professional: false)
@@ -21,12 +21,22 @@ module ChangeHealth
21
21
  self.class.send(verb.to_s, endpoint, query: query, body: body, headers: headers)
22
22
  end
23
23
 
24
+ def self.endpoint_for(klass)
25
+ endpoint_options = ChangeHealth.configuration.endpoints || {}
26
+
27
+ endpoint_options[klass.to_s] || endpoint_options[klass.to_s.to_sym] || klass::ENDPOINT
28
+ end
29
+
24
30
  private
25
31
 
26
32
  def auth_header
27
- @auth ||= Authentication.new
33
+ if ChangeHealth.configuration.auth_headers.nil?
34
+ @auth ||= Authentication.new
28
35
 
29
- @auth.authenticate.access_header
36
+ @auth.authenticate.access_header
37
+ else
38
+ ChangeHealth.configuration.auth_headers
39
+ end
30
40
  end
31
41
  end
32
42
  end
@@ -3,6 +3,7 @@ module ChangeHealth
3
3
  module Claim
4
4
  class ClaimSupplementalInformation < Model
5
5
  property :claimControlNumber, from: :claim_control_number
6
+ property :demoProjectIdentifier, from: :demo_project_identifier
6
7
  property :priorAuthorizationNumber, from: :prior_authorization_number
7
8
  property :referralNumber, from: :referral_number
8
9
  property :reportInformation, from: :report_information
@@ -25,7 +25,9 @@ module ChangeHealth
25
25
  end
26
26
 
27
27
  def query
28
- ChangeHealth::Response::EligibilityData.new(response: ChangeHealth::Connection.new.request(endpoint: ENDPOINT, body: self.to_h))
28
+ endpoint = ChangeHealth::Connection.endpoint_for(self.class)
29
+
30
+ ChangeHealth::Response::EligibilityData.new(response: ChangeHealth::Connection.new.request(endpoint: endpoint, body: self.to_h))
29
31
  end
30
32
 
31
33
  def self.health_check
@@ -42,12 +42,12 @@ module ChangeHealth
42
42
  method_name = "#{method}_#{type_mod}"
43
43
 
44
44
  define_method(method_name) do |**kwargs|
45
- self.send(method).send("#{type_mod}s").where(kwargs).first
45
+ self.send(method).send("#{type_mod}s").where(**kwargs).first
46
46
  end
47
47
 
48
48
  if ('copayment' == type_mod)
49
49
  define_method(method_name.gsub('copayment', 'copay')) do |**kwargs|
50
- self.send(method_name, kwargs)
50
+ self.send(method_name, **kwargs)
51
51
  end
52
52
  end
53
53
  end
@@ -57,24 +57,24 @@ module ChangeHealth
57
57
  method_name = "#{method}_#{type_mod}_#{time_mod}"
58
58
 
59
59
  define_method(method_name) do |**kwargs|
60
- self.send(method).send("#{type_mod}s").send("#{time_mod}s").where(kwargs).first || self.send(method).send("#{type_mod}s").where(kwargs).first
60
+ self.send(method).send("#{type_mod}s").send("#{time_mod}s").where(**kwargs).first || self.send(method).send("#{type_mod}s").where(**kwargs).first
61
61
  end
62
62
 
63
63
  if ('out_of_pocket' == type_mod)
64
64
  define_method(method_name.gsub('out_of_pocket', 'oop')) do |**kwargs|
65
- self.send(method_name, kwargs)
65
+ self.send(method_name, **kwargs)
66
66
  end
67
67
 
68
68
  if ('year' == time_mod)
69
69
  define_method(method_name.gsub('out_of_pocket', 'oop').gsub('year', 'total')) do |**kwargs|
70
- self.send(method_name, kwargs)
70
+ self.send(method_name, **kwargs)
71
71
  end
72
72
  end
73
73
  end
74
74
 
75
75
  if ('year' == time_mod)
76
76
  define_method(method_name.gsub('year', 'total')) do |**kwargs|
77
- self.send(method_name, kwargs)
77
+ self.send(method_name, **kwargs)
78
78
  end
79
79
  end
80
80
  end
@@ -66,7 +66,7 @@ module ChangeHealth
66
66
  end
67
67
 
68
68
  def medicare?(**kwargs)
69
- false == benefits.empty? && benefits.where(kwargs).all? {|b| b.medicare? }
69
+ false == benefits.empty? && benefits.where(**kwargs).all? {|b| b.medicare? }
70
70
  end
71
71
 
72
72
  def plan?(name)
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '5.4.1'.freeze
2
+ VERSION = '5.5.0'.freeze
3
3
  end
data/lib/change_health.rb CHANGED
@@ -61,11 +61,13 @@ require 'change_health/response/trading_partner/trading_partners_data'
61
61
 
62
62
  module ChangeHealth
63
63
  class Configuration
64
- attr_accessor :client_id, :client_secret, :grant_type
64
+ attr_accessor :client_id, :client_secret, :grant_type, :auth_headers, :endpoints
65
65
 
66
66
  def initialize
67
+ @auth_headers = nil
67
68
  @client_id = nil
68
69
  @client_secret = nil
70
+ @endpoints = nil
69
71
  @grant_type = :client_credentials
70
72
  end
71
73
 
@@ -79,16 +81,20 @@ module ChangeHealth
79
81
 
80
82
  def to_h
81
83
  {
84
+ auth_headers: @auth_headers,
82
85
  client_id: @client_id,
83
86
  client_secret: @client_secret,
87
+ endpoints: @endpoints,
84
88
  grant_type: @grant_type,
85
89
  api_endpoint: api_endpoint
86
90
  }
87
91
  end
88
92
 
89
93
  def from_h(h)
94
+ self.auth_headers = h[:auth_headers]
90
95
  self.client_id = h[:client_id]
91
96
  self.client_secret = h[:client_secret]
97
+ self.endpoints = h[:endpoints]
92
98
  self.grant_type = h[:grant_type]
93
99
  self.api_endpoint = h[:api_endpoint]
94
100
 
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.4.1
4
+ version: 5.5.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: 2023-10-31 00:00:00.000000000 Z
11
+ date: 2024-03-06 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: []