change_health 5.13.3 → 5.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/lib/change_health/authentication.rb +3 -2
- data/lib/change_health/connection.rb +19 -7
- data/lib/change_health/request/report.rb +21 -9
- data/lib/change_health/request/submission.rb +4 -2
- data/lib/change_health/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb987215842bdd0968fdaa773aaafdc61b866a201696f22b834acaea3e278c79
|
4
|
+
data.tar.gz: b8aafcf2bb2104f2855182820cc61ed2ea0e2ba7cd3e346202d0ad32b402732d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc3d044369eda8d3155e2691133e49ac6b5e6d94d60caee2cd5d1583e7cae20fe4caee403dc32c163193de681066c0b21fead3bd7258cf6f598d696cf3c028d9
|
7
|
+
data.tar.gz: 1c2fd48215812e643213b916320ef4c2d45c61bfb0f794daf6ef3e3bd9c9524f66c8d0bcc892a14df80e02005372a6bb72f7836a28159ab9a46e5f0cb6af5269
|
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.15.0] - 2024-06-19
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
* Ability to accept alternate `base_uri` and `auth_headers` in submission.
|
13
|
+
|
14
|
+
# [5.14.0] - 2024-06-11
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
* The following report methods can override the base URI, endpoint, and authentication headers per request if needed:
|
19
|
+
- `ChangeHealth::Request::Claim::Report.report_list`
|
20
|
+
- `ChangeHealth::Request::Claim::Report.get_report`
|
21
|
+
- `ChangeHealth::Request::Claim::Report.delete_report`
|
22
|
+
|
23
|
+
Provide the following parameters to override the defaults set in Configuration:
|
24
|
+
- `base_uri`
|
25
|
+
- `endpoint`
|
26
|
+
- `auth_headers` - an empty hash can also be provided (`{}`), which will issue a request to the authentication endpoint instead of using the configured headers.
|
27
|
+
|
8
28
|
# [5.13.3] - 2024-05-20
|
9
29
|
|
10
30
|
### Fixed
|
@@ -692,6 +712,8 @@ Added the ability to hit professional claim submission API. For more details, se
|
|
692
712
|
* Authentication
|
693
713
|
* Configuration
|
694
714
|
|
715
|
+
[5.15.0]: https://github.com/WeInfuse/change_health/compare/v5.14.0...v5.15.0
|
716
|
+
[5.14.0]: https://github.com/WeInfuse/change_health/compare/v5.13.3...v5.14.0
|
695
717
|
[5.13.3]: https://github.com/WeInfuse/change_health/compare/v5.13.2...v5.13.3
|
696
718
|
[5.13.2]: https://github.com/WeInfuse/change_health/compare/v5.13.1...v5.13.2
|
697
719
|
[5.13.1]: https://github.com/WeInfuse/change_health/compare/v5.13.0...v5.13.1
|
@@ -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(
|
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
|
-
|
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
|
-
|
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
|
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,
|
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
|
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
|
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
|
|
@@ -40,7 +40,7 @@ module ChangeHealth
|
|
40
40
|
self[:providers] << provider
|
41
41
|
end
|
42
42
|
|
43
|
-
def submission(is_professional: true, headers: nil)
|
43
|
+
def submission(is_professional: true, headers: nil, base_uri: nil, auth_headers: nil)
|
44
44
|
headers ||= is_professional ? professional_headers : institutional_headers
|
45
45
|
ChangeHealth::Response::Claim::SubmissionData.new(
|
46
46
|
response: ChangeHealth::Connection.new.request(
|
@@ -48,8 +48,10 @@ module ChangeHealth
|
|
48
48
|
is_professional: is_professional,
|
49
49
|
suffix: SUBMISSION_SUFFIX
|
50
50
|
),
|
51
|
+
base_uri: base_uri,
|
51
52
|
body: to_h,
|
52
|
-
headers: headers
|
53
|
+
headers: headers,
|
54
|
+
auth_headers: auth_headers
|
53
55
|
)
|
54
56
|
)
|
55
57
|
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.
|
4
|
+
version: 5.15.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-
|
11
|
+
date: 2024-06-20 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
|
@@ -221,8 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
|
-
rubygems_version: 3.
|
225
|
-
signing_key:
|
224
|
+
rubygems_version: 3.5.11
|
225
|
+
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Ruby wrapper for the ChangeHealth API
|
228
228
|
test_files: []
|