change_health 4.9.0 → 4.10.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: d4c832c6b386d23d0dcd5ed9458a532e18e544e91f4aa14705e54731343a1da3
4
- data.tar.gz: 3db73ca5d441099f1e692a8380f2f133ca50ef9b6324618a3360f052924cbef3
3
+ metadata.gz: 7a69d56a89a1c2ed046562ff0a03ad608127e1cf0528081e5487f33146387ec0
4
+ data.tar.gz: e5642c14d9b6505265678a06851f3e76a80cbeed668c3870f13ee1c278e22baf
5
5
  SHA512:
6
- metadata.gz: 6f790ed0a6496d1b535c51a28fa9598928d6e71b99626c545f411ce180e0c4f8e92504950ba7e37c184fa25a96a4c35a3fd5b3d5bed89418008429dd09f2652f
7
- data.tar.gz: 841f4642ec6bcbacef9e0c10ad174b26968ffd58ea7d93077e800b4ef20fb02abd73c91cc5bd4bf4dab0872384c24d32c1be7105ffa2afe3ce0fffb97de95b57
6
+ metadata.gz: a9e0f343efd67eef7c40de6df33b6a0766d0f0e32cfe035a1b9eff2fccbacd29b96fa0ca25554ce0070fb470fef4c2514b527ee80adf70fdba2083997219771c
7
+ data.tar.gz: b09505a0d9b2ec94ab473cb1f9bd86aaa2e689fe28b55b52aed37ddd1221968fa9b82e6d0bce62dbea659174457e9d9c52c9c24f2daeb3e9f84518bf58123831
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ 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.10.0] - 2022-12-01
9
+
10
+ ### Added
11
+
12
+ * Request Report - can now pull back any kind of report, not just 277 or 835
13
+
8
14
  # [4.9.0] - 2022-11-11
9
15
 
10
16
  ### Added
@@ -448,7 +454,8 @@ Added the ability to hit professional claim submission API. For more details, se
448
454
  * Authentication
449
455
  * Configuration
450
456
 
451
- [4.8.0]: https://github.com/WeInfuse/change_health/compare/v4.8.0...v4.9.0
457
+ [4.10.0]: https://github.com/WeInfuse/change_health/compare/v4.9.0...v4.10.0
458
+ [4.9.0]: https://github.com/WeInfuse/change_health/compare/v4.8.0...v4.9.0
452
459
  [4.8.0]: https://github.com/WeInfuse/change_health/compare/v4.7.0...v4.8.0
453
460
  [4.7.0]: https://github.com/WeInfuse/change_health/compare/v4.6.0...v4.7.0
454
461
  [4.6.0]: https://github.com/WeInfuse/change_health/compare/v4.5.0...v4.6.0
@@ -7,32 +7,44 @@ module ChangeHealth
7
7
 
8
8
  def self.report_list(headers: nil)
9
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
+ ChangeHealth::Response::Claim::ReportListData.new(response: ChangeHealth::Connection.new.request(
11
+ endpoint: ENDPOINT, verb: :get, headers: final_headers
12
+ ))
11
13
  end
12
14
 
13
15
  def self.get_report(report_name, as_json_report: true, headers: nil)
14
16
  return if report_name.nil? || report_name.empty?
15
- final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
16
17
 
17
- report_type = ChangeHealth::Response::Claim::ReportData.report_type(report_name)
18
- return if report_type.nil?
18
+ final_headers = ChangeHealth::Request::Claim::Report.report_headers(headers)
19
19
 
20
- individual_report_endpoint = ENDPOINT + '/' + report_name
20
+ individual_report_endpoint = "#{ENDPOINT}/#{report_name}"
21
21
 
22
22
  # https://developers.changehealthcare.com/eligibilityandclaims/docs/what-file-types-does-this-api-get-from-the-mailbox
23
- individual_report_endpoint += '/' + report_type if as_json_report
23
+ if as_json_report
24
+ report_type = ChangeHealth::Response::Claim::ReportData.report_type(report_name)
25
+ individual_report_endpoint += "/#{report_type}"
26
+ end
24
27
 
25
- response = ChangeHealth::Connection.new.request(endpoint: individual_report_endpoint, verb: :get, headers: final_headers)
28
+ response = ChangeHealth::Connection.new.request(
29
+ endpoint: individual_report_endpoint,
30
+ verb: :get,
31
+ headers: final_headers
32
+ )
26
33
  if ChangeHealth::Response::Claim::ReportData.is_277?(report_name)
27
34
  ChangeHealth::Response::Claim::Report277Data
28
35
  .new(report_name,
29
36
  as_json_report,
30
37
  response: response)
31
- else
38
+ elsif ChangeHealth::Response::Claim::ReportData.is_835?(report_name)
32
39
  ChangeHealth::Response::Claim::Report835Data
33
40
  .new(report_name,
34
41
  as_json_report,
35
42
  response: response)
43
+ else
44
+ ChangeHealth::Response::Claim::ReportData
45
+ .new(report_name,
46
+ as_json_report,
47
+ response: response)
36
48
  end
37
49
  end
38
50
 
@@ -41,17 +53,15 @@ module ChangeHealth
41
53
  end
42
54
 
43
55
  def self.ping
44
- self.health_check
56
+ health_check
45
57
  end
46
58
 
47
59
  def self.report_headers(headers)
48
60
  if headers
49
61
  extra_headers = {}
50
- extra_headers["X-CHC-Reports-Username"] = headers[:username]
51
- extra_headers["X-CHC-Reports-Password"] = headers[:password]
62
+ extra_headers['X-CHC-Reports-Username'] = headers[:username]
63
+ extra_headers['X-CHC-Reports-Password'] = headers[:password]
52
64
  extra_headers
53
- else
54
- nil
55
65
  end
56
66
  end
57
67
  end
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '4.9.0'.freeze
2
+ VERSION = '4.10.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: 4.9.0
4
+ version: 4.10.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-11-11 00:00:00.000000000 Z
11
+ date: 2022-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty