change_health 2.1.0 → 2.2.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: 962d95245a21c89b96048449a0111165eee7b3a392f00a2f1cddf8924bf98150
4
- data.tar.gz: 8b0127fb08968b20213728ffdc08afc0ae33a53a5d9c620efa916c8cc82f285f
3
+ metadata.gz: 8a1ce76c1da3af060d7c36a7a3f22c9e9bb1920b2db4f0f2cb9060ec777c1854
4
+ data.tar.gz: 2e4553b586e4bf8b13db083f423853708132a0686dac5ec27beea6223e740a0d
5
5
  SHA512:
6
- metadata.gz: 0e64c195c18b7fb2cbaf028141af3eab9ab2fbecfeb0750c1d706f81c9b12502d747a8a6d765228a9f731aa7c653ba6023a476677419e307089cbc15e320e93f
7
- data.tar.gz: 8c598d163710ae6d9f2a4a048d4f2697beb6f308eba526f3ca449962e920065a3a128f10769d38307fa7efaff3d13df7c4c57e16333dbc593bde48a99e745749
6
+ metadata.gz: c15e9b053bdbfbfca3700a3d95971517aa0c07654267cc704ce4d210cc264d6d1f9aab08ccad3c165a59b3d8d56fc82bf4be5c69f6c2155c1127fa4ee5fed5ea
7
+ data.tar.gz: 5a83d9c160bef86e5a296fea12335cc56cbac2959e1841e3f9382cee6b902586138be8e8e61328c0d3579afec5f904fa4712a9ccf8e8e7c89613e15ae663f668
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ 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.0] - [2021-11-04-21]
8
+ ### Added
9
+ Ability to hit [Claim Responses and Reports](https://developers.changehealthcare.com/eligibilityandclaims/docs/claims-responses-and-reports-getting-started)
10
+ * Report
11
+ * ReportListData
12
+ * ReportData
13
+
7
14
  ## [2.1.0] - [2021-10-12]
8
15
  ### Changed
9
16
  Model#to_h enhanced to change empty values AKA "" to nil. Reason: If a field is empty, Change Healthcare responds with an error - `Invalid value. Item must not be blank value.`. If the empty field is optional, Change Healthcare will accept the field as nil without error. If the empty field is required, Change Healthcare will return an error if the value is empty or nil.
@@ -167,6 +174,7 @@ Added the ability to hit professional claim submission API. For more details, se
167
174
  - Authentication
168
175
  - Configuration
169
176
 
177
+ [2.2.0]: https://github.com/WeInfuse/change_health/compare/v2.1.0...v2.2.0
170
178
  [2.1.0]: https://github.com/WeInfuse/change_health/compare/v2.0.0...v2.1.0
171
179
  [2.0.0]: https://github.com/WeInfuse/change_health/compare/v1.0.3...v2.0.0
172
180
  [1.0.3]: https://github.com/WeInfuse/change_health/compare/v1.0.2...v1.0.3
data/README.md CHANGED
@@ -83,10 +83,10 @@ true
83
83
  trading_partners = ChangeHealth::Request::TradingPartner.query("Aetna")
84
84
 
85
85
  trading_partners.first.name
86
- "Aetna"
86
+ # "Aetna"
87
87
 
88
88
  trading_partners.first.service_id
89
- "ABC123"
89
+ # "ABC123"
90
90
  ```
91
91
 
92
92
  ### Claim Submission
@@ -187,6 +187,29 @@ claim_submission = ChangeHealth::Request::Claim::Submission.new(
187
187
  claim_submission_data = claim_submission.submission
188
188
  ```
189
189
 
190
+ ### Claim Reports
191
+ [Change Healthcare Claim Responses and Reports Guide](https://developers.changehealthcare.com/eligibilityandclaims/docs/claims-responses-and-reports-getting-started)
192
+ ```ruby
193
+ ChangeHealth::Request::Claim::Report.ping # Test your connection
194
+
195
+ report_list = ChangeHealth::Request::Claim::Report.report_list
196
+
197
+ report_list.report_names
198
+ # ["X3000000.XX", "R5000000.XY", "R5000000.XX", "X3000000.AB", "X3000000.AC", "X3000000.ZZ", "R5000000.XZ", "R5000000.YZ", "R5000000.WA", "R5000000.WB", "R5000000.WC"]
199
+
200
+ report1_edi = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: false)
201
+ # Report in edi format
202
+
203
+ report1_json = ChangeHealth::Request::Claim::Report.get_report(report_list.report_names.first, as_json_report: true)
204
+ # Report in json format
205
+
206
+ reports_json = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name)}
207
+ # all reports in json format
208
+
209
+ reports_edi = report_list.report_names.map {|report_name| ChangeHealth::Request::Claim::Report.get_report(report_name, as_json_report: false)}
210
+ # all reports in edi format
211
+ ```
212
+
190
213
  ### Configuration
191
214
 
192
215
  ```ruby
@@ -1,4 +1,5 @@
1
1
  module ChangeHealth
2
+ # TODO: This should be the response module/folder... next major release
2
3
  module Models
3
4
  class Error
4
5
  attr_reader :data
@@ -0,0 +1,39 @@
1
+ module ChangeHealth
2
+ module Request
3
+ module Claim
4
+ class Report
5
+ ENDPOINT = '/medicalnetwork/reports/v2'.freeze
6
+ HEALTH_CHECK_ENDPOINT = ENDPOINT + '/healthcheck'.freeze
7
+
8
+ def self.report_list
9
+ ChangeHealth::Response::Claim::ReportListData.new(response: ChangeHealth::Connection.new.request(endpoint: ENDPOINT, verb: :get))
10
+ end
11
+
12
+ def self.get_report(report_name, as_json_report: true)
13
+ return if report_name.nil? || report_name.empty?
14
+
15
+ individual_report_endpoint = ENDPOINT + '/' + report_name
16
+ if as_json_report
17
+ # https://developers.changehealthcare.com/eligibilityandclaims/docs/what-file-types-does-this-api-get-from-the-mailbox
18
+ report_type = ChangeHealth::Response::Claim::ReportData.report_type(report_name)
19
+ return if report_type.nil?
20
+
21
+ individual_report_endpoint += '/' + report_type
22
+ end
23
+
24
+ ChangeHealth::Response::Claim::ReportData.new(report_name,
25
+ as_json_report,
26
+ response: ChangeHealth::Connection.new.request(endpoint: individual_report_endpoint, verb: :get))
27
+ end
28
+
29
+ def self.health_check
30
+ ChangeHealth::Connection.new.request(endpoint: HEALTH_CHECK_ENDPOINT, verb: :get)
31
+ end
32
+
33
+ def self.ping
34
+ self.health_check
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,45 @@
1
+ module ChangeHealth
2
+ module Response
3
+ module Claim
4
+ class ReportData < ChangeHealth::Response::ResponseData
5
+ attr_reader :report_name, :json
6
+ alias_method :json?, :json
7
+
8
+ def initialize(report_name, json, data: nil, response: nil)
9
+ super(data: data, response: response)
10
+ @report_name = report_name
11
+ @json = json
12
+ end
13
+
14
+ def edi?
15
+ !@json
16
+ end
17
+
18
+ def report_type
19
+ self.class.report_type(@report_name)
20
+ end
21
+
22
+ def self.report_type(report_name)
23
+ return '277' if is_277?(report_name)
24
+ return '835' if is_835?(report_name)
25
+ end
26
+
27
+ def is_277?
28
+ self.class.is_277?(@report_name)
29
+ end
30
+
31
+ def self.is_277?(report_name)
32
+ report_name.start_with?('X3')
33
+ end
34
+
35
+ def is_835?
36
+ self.class.is_835?(@report_name)
37
+ end
38
+
39
+ def self.is_835?(report_name)
40
+ report_name.start_with?('R5')
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,13 @@
1
+ module ChangeHealth
2
+ module Response
3
+ module Claim
4
+ class ReportListData < ChangeHealth::Response::ResponseData
5
+
6
+ def report_names
7
+ @raw.dig('reports')
8
+ end
9
+
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module ChangeHealth
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.2.0'.freeze
3
3
  end
data/lib/change_health.rb CHANGED
@@ -18,9 +18,12 @@ require 'change_health/models/eligibility/subscriber'
18
18
  require 'change_health/models/trading_partner/trading_partner'
19
19
  require 'change_health/request/eligibility'
20
20
  require 'change_health/request/submission'
21
+ require 'change_health/request/report'
21
22
  require 'change_health/request/trading_partner'
22
23
  require 'change_health/response/response_data'
23
24
  require 'change_health/response/claim/submission/submission_data'
25
+ require 'change_health/response/claim/report/report_list_data'
26
+ require 'change_health/response/claim/report/report_data'
24
27
  require 'change_health/response/eligibility/eligibility_benefit'
25
28
  require 'change_health/response/eligibility/eligibility_benefits'
26
29
  require 'change_health/response/eligibility/eligibility_data'
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.1.0
4
+ version: 2.2.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: 2021-10-12 00:00:00.000000000 Z
11
+ date: 2021-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -159,8 +159,11 @@ files:
159
159
  - lib/change_health/models/model.rb
160
160
  - lib/change_health/models/trading_partner/trading_partner.rb
161
161
  - lib/change_health/request/eligibility.rb
162
+ - lib/change_health/request/report.rb
162
163
  - lib/change_health/request/submission.rb
163
164
  - lib/change_health/request/trading_partner.rb
165
+ - lib/change_health/response/claim/report/report_data.rb
166
+ - lib/change_health/response/claim/report/report_list_data.rb
164
167
  - lib/change_health/response/claim/submission/submission_data.rb
165
168
  - lib/change_health/response/eligibility/eligibility_benefit.rb
166
169
  - lib/change_health/response/eligibility/eligibility_benefits.rb