change_health 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +22 -8
- data/lib/change_health/request/report.rb +17 -4
- data/lib/change_health/request/submission.rb +21 -1
- data/lib/change_health/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c125bdbe69dd6012d726e7ec54364c9535520520beeb4b7503dfc2b8eaf53a04
|
4
|
+
data.tar.gz: 1645afbc96aed15798aab5603445c63892593924ae8fcac0c8490d166fa46919
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb574a463704359781dbddee731ce6f298916bbbb37a95dd1f44790aa56e6ba730e916a67655266f1d80dc6a47924140b3ec53fde6425e982fc000ab2b259765
|
7
|
+
data.tar.gz: 63162fe79c441191d1a73ebc3967d66bc9f20d1f7cfae7126771c17c08bed61905933e188a66d527835a32f2192a7d1e7246c220b34b06d043577e4fd6dc1a6e
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [2.2.1] - [2021-11-15-21]
|
8
|
+
### Added
|
9
|
+
Custom Headers for Reports API and Professional Claims API
|
10
|
+
* Report
|
11
|
+
* Submission
|
12
|
+
|
7
13
|
## [2.2.0] - [2021-11-04-21]
|
8
14
|
### Added
|
9
15
|
Ability to hit [Claim Responses and Reports](https://developers.changehealthcare.com/eligibilityandclaims/docs/claims-responses-and-reports-getting-started)
|
data/README.md
CHANGED
@@ -174,6 +174,12 @@ claim_information = ChangeHealth::Models::Claim::ClaimInformation.new(
|
|
174
174
|
service_lines: [service_line1, service_line2]
|
175
175
|
)
|
176
176
|
|
177
|
+
professional_headers = {
|
178
|
+
submitter_id: '111000',
|
179
|
+
biller_id: '000111',
|
180
|
+
username: '222333hey',
|
181
|
+
password: 'builder1'
|
182
|
+
}
|
177
183
|
|
178
184
|
claim_submission = ChangeHealth::Request::Claim::Submission.new(
|
179
185
|
trading_partner_service_id: "9496",
|
@@ -181,10 +187,13 @@ claim_submission = ChangeHealth::Request::Claim::Submission.new(
|
|
181
187
|
receiver: receiver,
|
182
188
|
subscriber: subscriber,
|
183
189
|
providers: [provider],
|
184
|
-
claim_information: claim_information
|
190
|
+
claim_information: claim_information,
|
191
|
+
headers: professional_headers
|
185
192
|
)
|
186
193
|
|
187
194
|
claim_submission_data = claim_submission.submission
|
195
|
+
|
196
|
+
validation = claim_submission.validation
|
188
197
|
```
|
189
198
|
|
190
199
|
### Claim Reports
|
@@ -192,21 +201,26 @@ claim_submission_data = claim_submission.submission
|
|
192
201
|
```ruby
|
193
202
|
ChangeHealth::Request::Claim::Report.ping # Test your connection
|
194
203
|
|
195
|
-
|
204
|
+
report_headers = {
|
205
|
+
username: '111000john',
|
206
|
+
password: 'WeInfuse1'
|
207
|
+
}
|
208
|
+
|
209
|
+
report_list = ChangeHealth::Request::Claim::Report.report_list(headers: report_headers)
|
196
210
|
|
197
211
|
report_list.report_names
|
198
212
|
# ["X3000000.XX", "R5000000.XY", "R5000000.XX", "X3000000.AB", "X3000000.AC", "X3000000.ZZ", "R5000000.XZ", "R5000000.YZ", "R5000000.WA", "R5000000.WB", "R5000000.WC"]
|
199
213
|
|
200
|
-
report1_edi = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: false)
|
214
|
+
report1_edi = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: false, headers: report_headers)
|
201
215
|
# Report in edi format
|
202
216
|
|
203
|
-
report1_json = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: true)
|
217
|
+
report1_json = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: true, headers: report_headers)
|
204
218
|
# Report in json format
|
205
219
|
|
206
|
-
reports_json = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name)}
|
220
|
+
reports_json = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name, headers: report_headers)}
|
207
221
|
# all reports in json format
|
208
222
|
|
209
|
-
reports_edi = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name, as_json_report: false)}
|
223
|
+
reports_edi = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name, as_json_report: false, headers: report_headers)}
|
210
224
|
# all reports in edi format
|
211
225
|
```
|
212
226
|
|
@@ -216,8 +230,8 @@ reports_edi = report_list.report_names.map {|report_name| ChangeHealth::Request:
|
|
216
230
|
ChangeHealth.configure do |c|
|
217
231
|
c.client_id = ENV['CHANGE_HEALTH_CLIENT_ID']
|
218
232
|
c.client_secret = ENV['CHANGE_HEALTH_SECRET']
|
219
|
-
c.grant_type = '
|
220
|
-
c.api_endpoint = '
|
233
|
+
c.grant_type = 'client_credentials' # Defaults to client_credentials
|
234
|
+
c.api_endpoint = 'https://sandbox.apigw.changehealthcare.com' # Defaults to Change Health Sandbox endpoint
|
221
235
|
end
|
222
236
|
```
|
223
237
|
|
@@ -5,12 +5,14 @@ module ChangeHealth
|
|
5
5
|
ENDPOINT = '/medicalnetwork/reports/v2'.freeze
|
6
6
|
HEALTH_CHECK_ENDPOINT = ENDPOINT + '/healthcheck'.freeze
|
7
7
|
|
8
|
-
def self.report_list
|
9
|
-
ChangeHealth::
|
8
|
+
def self.report_list(headers: nil)
|
9
|
+
final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
|
10
|
+
ChangeHealth::Response::Claim::ReportListData.new(response: ChangeHealth::Connection.new.request(endpoint: ENDPOINT, verb: :get, headers: final_headers))
|
10
11
|
end
|
11
12
|
|
12
|
-
def self.get_report(report_name, as_json_report: true)
|
13
|
+
def self.get_report(report_name, as_json_report: true, headers: nil)
|
13
14
|
return if report_name.nil? || report_name.empty?
|
15
|
+
final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
|
14
16
|
|
15
17
|
individual_report_endpoint = ENDPOINT + '/' + report_name
|
16
18
|
if as_json_report
|
@@ -23,7 +25,7 @@ module ChangeHealth
|
|
23
25
|
|
24
26
|
ChangeHealth::Response::Claim::ReportData.new(report_name,
|
25
27
|
as_json_report,
|
26
|
-
response: ChangeHealth::Connection.new.request(endpoint: individual_report_endpoint, verb: :get))
|
28
|
+
response: ChangeHealth::Connection.new.request(endpoint: individual_report_endpoint, verb: :get, headers: final_headers))
|
27
29
|
end
|
28
30
|
|
29
31
|
def self.health_check
|
@@ -33,6 +35,17 @@ module ChangeHealth
|
|
33
35
|
def self.ping
|
34
36
|
self.health_check
|
35
37
|
end
|
38
|
+
|
39
|
+
def self.report_headers(headers)
|
40
|
+
if headers
|
41
|
+
extra_headers = {}
|
42
|
+
extra_headers["X-CHC-Reports-Username"] = headers[:username]
|
43
|
+
extra_headers["X-CHC-Reports-Password"] = headers[:password]
|
44
|
+
extra_headers
|
45
|
+
else
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
end
|
36
49
|
end
|
37
50
|
end
|
38
51
|
end
|
@@ -2,9 +2,11 @@ module ChangeHealth
|
|
2
2
|
module Request
|
3
3
|
module Claim
|
4
4
|
class Submission < Hashie::Trash
|
5
|
+
|
5
6
|
ENDPOINT = '/medicalnetwork/professionalclaims/v3'.freeze
|
6
7
|
HEALTH_CHECK_ENDPOINT = ENDPOINT + '/healthcheck'.freeze
|
7
8
|
SUBMISSION_ENDPOINT = ENDPOINT + '/submission'.freeze
|
9
|
+
VALIDATION_ENDPOINT = ENDPOINT + '/validation'.freeze
|
8
10
|
|
9
11
|
property :claimInformation, from: :claim_information, required: false
|
10
12
|
property :controlNumber, from: :control_number, required: true, default: ChangeHealth::Models::CONTROL_NUMBER
|
@@ -12,6 +14,7 @@ module ChangeHealth
|
|
12
14
|
property :receiver, required: false
|
13
15
|
property :submitter, required: false
|
14
16
|
property :subscriber, required: false
|
17
|
+
property :headers, required: false
|
15
18
|
# Need one or the other, trading partner id or trading partner service id
|
16
19
|
property :tradingPartnerId, from: :trading_partner_id, required: false
|
17
20
|
property :tradingPartnerServiceId, from: :trading_partner_service_id, required: false
|
@@ -22,7 +25,11 @@ module ChangeHealth
|
|
22
25
|
end
|
23
26
|
|
24
27
|
def submission
|
25
|
-
ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(endpoint: SUBMISSION_ENDPOINT, body: self.to_h))
|
28
|
+
ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(endpoint: SUBMISSION_ENDPOINT, body: self.to_h, headers: professional_headers))
|
29
|
+
end
|
30
|
+
|
31
|
+
def validation
|
32
|
+
ChangeHealth::Response::Claim::SubmissionData.new(response: ChangeHealth::Connection.new.request(endpoint: VALIDATION_ENDPOINT, body: self.to_h, headers: professional_headers))
|
26
33
|
end
|
27
34
|
|
28
35
|
def self.health_check
|
@@ -32,6 +39,19 @@ module ChangeHealth
|
|
32
39
|
def self.ping
|
33
40
|
self.health_check
|
34
41
|
end
|
42
|
+
|
43
|
+
def professional_headers
|
44
|
+
if self[:headers]
|
45
|
+
extra_headers = {}
|
46
|
+
extra_headers["X-CHC-ClaimSubmission-SubmitterId"] = self[:headers][:submitter_id]
|
47
|
+
extra_headers["X-CHC-ClaimSubmission-BillerId"] = self[:headers][:biller_id]
|
48
|
+
extra_headers["X-CHC-ClaimSubmission-Username"] = self[:headers][:username]
|
49
|
+
extra_headers["X-CHC-ClaimSubmission-Pwd"] = self[:headers][:password]
|
50
|
+
extra_headers
|
51
|
+
else
|
52
|
+
nil
|
53
|
+
end
|
54
|
+
end
|
35
55
|
end
|
36
56
|
end
|
37
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: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Crockett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -192,7 +192,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
- !ruby/object:Gem::Version
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
|
-
|
195
|
+
rubyforge_project:
|
196
|
+
rubygems_version: 2.7.6
|
196
197
|
signing_key:
|
197
198
|
specification_version: 4
|
198
199
|
summary: Ruby wrapper for the ChangeHealth API
|