change_health 0.9.0 → 0.10.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 +11 -1
- data/README.md +13 -0
- data/lib/change_health/connection.rb +2 -2
- data/lib/change_health/models/trading_partner.rb +11 -0
- data/lib/change_health/request/trading_partner.rb +18 -0
- data/lib/change_health/response/trading_partner_data.rb +27 -0
- data/lib/change_health/response/trading_partners_data.rb +13 -0
- data/lib/change_health/version.rb +1 -1
- data/lib/change_health.rb +4 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8173937050afec203ed5a5caa16d4f4f692b74c0c4e73ce3a2b1688e09c8347
|
4
|
+
data.tar.gz: 6a06f31bdb81ac01808138026049b98b699a1196979788baba791234d87fdb61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9d975e4e0086910b68d995cf29ff74c9dd94698c61b8607aa829a58aaa5e56d0f526565d7c4eff9cd7d379c1870b45e0e0491cb321d8624ceb37ba4ed6a2060
|
7
|
+
data.tar.gz: 1a52136f240f4a689627f99e36b60477542312bd49c1fc37388ebbeccbc7755b615ff8f48ee317a4485a578e0e764ed0700d37eea4bb3a9b72da08bbcb94ff43
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,14 @@ 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
|
+
## [0.10.0] - [2020-04-09]
|
8
|
+
### Added
|
9
|
+
- Add Trading Partner API querying capability
|
10
|
+
- Request::TradingPartner
|
11
|
+
- Response::TradingPartnerData
|
12
|
+
- Response::TradingPartnersData
|
13
|
+
- Models::TradingPartner
|
14
|
+
|
7
15
|
## [0.9.0] - [2020-04-08]
|
8
16
|
### Added
|
9
17
|
- Added EligibilityBenefit#medicare?
|
@@ -62,10 +70,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
62
70
|
- Provider
|
63
71
|
- Subscriber
|
64
72
|
- Encounter
|
65
|
-
- Eligibility
|
73
|
+
- Eligibility
|
66
74
|
- Authentication
|
67
75
|
- Configuration
|
68
76
|
|
77
|
+
[0.10.0]: https://github.com/WeInfuse/change_health/compare/v0.9.0...v0.10.0
|
78
|
+
[0.9.0]: https://github.com/WeInfuse/change_health/compare/v0.8.0...v0.9.0
|
69
79
|
[0.8.0]: https://github.com/WeInfuse/change_health/compare/v0.7.0...v0.8.0
|
70
80
|
[0.7.0]: https://github.com/WeInfuse/change_health/compare/v0.6.0...v0.7.0
|
71
81
|
[0.6.0]: https://github.com/WeInfuse/change_health/compare/v0.5.0...v0.6.0
|
data/README.md
CHANGED
@@ -25,6 +25,7 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
Make sure you're [configured](#configuration)!
|
27
27
|
|
28
|
+
### Eligibility
|
28
29
|
```ruby
|
29
30
|
ChangeHealth::Models::Eligibility.ping # Test your connection
|
30
31
|
|
@@ -74,6 +75,18 @@ edata.raw == edata.response.parsed_response
|
|
74
75
|
true
|
75
76
|
```
|
76
77
|
|
78
|
+
### Trading Partners
|
79
|
+
```ruby
|
80
|
+
# Query trading partners using a wildcard search
|
81
|
+
# Returns Array of ChangeHealth::Models::TradingPartner Objects
|
82
|
+
trading_partners = ChangeHealth::Request::TradingPartner.query("Aetna")
|
83
|
+
|
84
|
+
trading_partners.first.name
|
85
|
+
"Aetna"
|
86
|
+
|
87
|
+
trading_partners.first.service_id
|
88
|
+
"ABC123"
|
89
|
+
```
|
77
90
|
### Configuration
|
78
91
|
|
79
92
|
```ruby
|
@@ -13,11 +13,11 @@ module ChangeHealth
|
|
13
13
|
|
14
14
|
format :json
|
15
15
|
|
16
|
-
def request(endpoint: , body: nil, headers: {}, auth: true, verb: :post)
|
16
|
+
def request(endpoint: , query: nil, body: nil, headers: {}, auth: true, verb: :post)
|
17
17
|
body = body.to_json if body.is_a?(Hash)
|
18
18
|
headers = auth_header.merge(headers) if auth
|
19
19
|
|
20
|
-
self.class.send("#{verb}", endpoint, body: body, headers: headers)
|
20
|
+
self.class.send("#{verb}", endpoint, query: query, body: body, headers: headers)
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Models
|
3
|
+
class TradingPartner < Hashie::Trash
|
4
|
+
include Hashie::Extensions::IndifferentAccess
|
5
|
+
include Hashie::Extensions::IgnoreUndeclared
|
6
|
+
|
7
|
+
property :service_id, required: true
|
8
|
+
property :name, required: true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Request
|
3
|
+
class TradingPartner < Hashie::Trash
|
4
|
+
ENDPOINT = '/tradingpartners/v7/partners'.freeze
|
5
|
+
|
6
|
+
def self.query(term)
|
7
|
+
params = {
|
8
|
+
query: term,
|
9
|
+
serviceName: 'medicalEligibility',
|
10
|
+
strictFilters: true
|
11
|
+
}
|
12
|
+
response = ChangeHealth::Connection.new.request(endpoint: ENDPOINT, verb: :get, query: params)
|
13
|
+
trading_partners_data = ChangeHealth::Response::TradingPartnersData.new(response).medical_eligibility_enabled
|
14
|
+
trading_partners_data.map {|partner| ChangeHealth::Models::TradingPartner.new(name: partner.name, service_id: partner.medical_eligibility_service_id) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
class TradingPartnerData
|
4
|
+
def initialize(trading_partner_data)
|
5
|
+
@raw = trading_partner_data
|
6
|
+
end
|
7
|
+
|
8
|
+
def name
|
9
|
+
@raw.dig('tradingPartnerName')
|
10
|
+
end
|
11
|
+
|
12
|
+
def services
|
13
|
+
@raw.dig('clearingHouses', 'legacyExchange')
|
14
|
+
end
|
15
|
+
|
16
|
+
def medical_eligibility_service
|
17
|
+
return nil unless services
|
18
|
+
services.detect {|service| service.dig('serviceName') == 'medicalEligibility' }
|
19
|
+
end
|
20
|
+
|
21
|
+
def medical_eligibility_service_id
|
22
|
+
return nil unless medical_eligibility_service
|
23
|
+
medical_eligibility_service.dig('serviceConnections', 'direct', 'serviceId')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ChangeHealth
|
2
|
+
module Response
|
3
|
+
class TradingPartnersData < Array
|
4
|
+
def initialize(trading_partners)
|
5
|
+
super(trading_partners.map {|trading_partner| ChangeHealth::Response::TradingPartnerData.new(trading_partner) })
|
6
|
+
end
|
7
|
+
|
8
|
+
def medical_eligibility_enabled
|
9
|
+
self.reject {|partner| nil == partner.medical_eligibility_service_id }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/change_health.rb
CHANGED
@@ -9,6 +9,10 @@ require 'change_health/models/eligibility'
|
|
9
9
|
require 'change_health/models/eligibility_data'
|
10
10
|
require 'change_health/models/eligibility_benefit'
|
11
11
|
require 'change_health/models/eligibility_benefits'
|
12
|
+
require 'change_health/models/trading_partner'
|
13
|
+
require 'change_health/request/trading_partner'
|
14
|
+
require 'change_health/response/trading_partner_data'
|
15
|
+
require 'change_health/response/trading_partners_data'
|
12
16
|
require 'change_health/models/encounter'
|
13
17
|
require 'change_health/models/provider'
|
14
18
|
require 'change_health/models/subscriber'
|
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: 0.
|
4
|
+
version: 0.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: 2020-04-
|
11
|
+
date: 2020-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -154,6 +154,10 @@ files:
|
|
154
154
|
- lib/change_health/models/model.rb
|
155
155
|
- lib/change_health/models/provider.rb
|
156
156
|
- lib/change_health/models/subscriber.rb
|
157
|
+
- lib/change_health/models/trading_partner.rb
|
158
|
+
- lib/change_health/request/trading_partner.rb
|
159
|
+
- lib/change_health/response/trading_partner_data.rb
|
160
|
+
- lib/change_health/response/trading_partners_data.rb
|
157
161
|
- lib/change_health/version.rb
|
158
162
|
homepage: https://github.com/WeInfuse/change_health
|
159
163
|
licenses:
|