pokitdok-ruby 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/Gemfile +1 -0
- data/Gemfile.lock +13 -0
- data/Guardfile +4 -4
- data/README.md +32 -15
- data/Rakefile +3 -0
- data/VERSION +1 -1
- data/lib/pokitdok.rb +17 -32
- data/pokitdok-ruby.gemspec +6 -4
- data/spec/fixtures/claim.json +44 -114
- data/spec/pokitdok_spec.rb +35 -38
- data/vcr_cassettes/activities.yml +202 -333
- data/vcr_cassettes/auth.yml +4 -4
- data/vcr_cassettes/claims.yml +36 -65
- data/vcr_cassettes/eligibility.yml +73 -93
- data/vcr_cassettes/enrollment.yml +38 -41
- data/vcr_cassettes/files.yml +10 -10
- data/vcr_cassettes/payers.yml +81 -77
- data/vcr_cassettes/providers.yml +308 -297
- metadata +16 -3
- data/vcr_cassettes/insurance_prices.yml +0 -42
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57cf37a5fff162bd158abbceb5d4fed977c78ad3
|
|
4
|
+
data.tar.gz: 0b10d83567181e9a7bc17054be53d70ea65a7c51
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24f245b5279f4e99e5e7d10c3ae490f28a9a4c1fd6ccc89b5e1ff10e81264552ae3eb29cbbd6b296d2c72c14c8a60468e40922099d808331831c0ec27adb968e
|
|
7
|
+
data.tar.gz: c96fe3cfd950cb18f80eb68ed4aafa9a9afc721cd21f675d7f9f63d8f1d0d80f752c2b9012f23d852363a6fdfa5def47ab9915faa0c00aa891e54c26c696db87
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -8,6 +8,12 @@ GEM
|
|
|
8
8
|
celluloid (0.15.2)
|
|
9
9
|
timers (~> 1.1.0)
|
|
10
10
|
coderay (1.1.0)
|
|
11
|
+
coveralls (0.7.0)
|
|
12
|
+
multi_json (~> 1.3)
|
|
13
|
+
rest-client
|
|
14
|
+
simplecov (>= 0.7)
|
|
15
|
+
term-ansicolor
|
|
16
|
+
thor
|
|
11
17
|
crack (0.4.2)
|
|
12
18
|
safe_yaml (~> 1.0.0)
|
|
13
19
|
descendants_tracker (0.0.4)
|
|
@@ -58,6 +64,7 @@ GEM
|
|
|
58
64
|
lumberjack (1.0.6)
|
|
59
65
|
metaclass (0.0.4)
|
|
60
66
|
method_source (0.8.2)
|
|
67
|
+
mime-types (2.3)
|
|
61
68
|
mini_portile (0.6.0)
|
|
62
69
|
minitest (5.3.4)
|
|
63
70
|
minitest-reporters (1.0.4)
|
|
@@ -94,6 +101,8 @@ GEM
|
|
|
94
101
|
ffi (>= 0.5.0)
|
|
95
102
|
rdoc (4.1.1)
|
|
96
103
|
json (~> 1.4)
|
|
104
|
+
rest-client (1.6.7)
|
|
105
|
+
mime-types (>= 1.16)
|
|
97
106
|
rubocop (0.23.0)
|
|
98
107
|
json (>= 1.7.7, < 2)
|
|
99
108
|
parser (~> 2.1.9)
|
|
@@ -108,10 +117,13 @@ GEM
|
|
|
108
117
|
simplecov-html (~> 0.8.0)
|
|
109
118
|
simplecov-html (0.8.0)
|
|
110
119
|
slop (3.5.0)
|
|
120
|
+
term-ansicolor (1.3.0)
|
|
121
|
+
tins (~> 1.0)
|
|
111
122
|
terminal-notifier-guard (1.5.3)
|
|
112
123
|
thor (0.19.1)
|
|
113
124
|
thread_safe (0.3.4)
|
|
114
125
|
timers (1.1.0)
|
|
126
|
+
tins (1.3.0)
|
|
115
127
|
vcr (2.9.2)
|
|
116
128
|
webmock (1.18.0)
|
|
117
129
|
addressable (>= 2.3.6)
|
|
@@ -123,6 +135,7 @@ PLATFORMS
|
|
|
123
135
|
DEPENDENCIES
|
|
124
136
|
ansi (~> 1.4)
|
|
125
137
|
bundler (~> 1.0)
|
|
138
|
+
coveralls
|
|
126
139
|
guard (~> 2.6)
|
|
127
140
|
guard-minitest (~> 2.2)
|
|
128
141
|
guard-rubocop (~> 1.0)
|
data/Guardfile
CHANGED
|
@@ -12,7 +12,7 @@ guard :minitest do
|
|
|
12
12
|
watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
guard :rubocop do
|
|
16
|
-
watch(
|
|
17
|
-
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
|
18
|
-
end
|
|
15
|
+
#guard :rubocop do
|
|
16
|
+
#watch('/lib/*.rb')
|
|
17
|
+
#watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
|
18
|
+
#end
|
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
[](https://travis-ci.org/pokitdok/pokitdok-ruby)
|
|
2
2
|
[](http://badge.fury.io/rb/pokitdok-ruby)
|
|
3
|
+
[](https://www.versioneye.com/user/projects/538e498b46c4739edd0000ee)
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
pokitdok-ruby
|
|
5
7
|
=============
|
|
@@ -37,16 +39,20 @@ pd.providers(zipcode: '29307', radius: '10mi')
|
|
|
37
39
|
pd.providers(zipcode: '29307', radius: '10mi', specialty: 'RHEUMATOLOGY')
|
|
38
40
|
|
|
39
41
|
# Eligibility
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
@eligibility_query = {
|
|
43
|
+
member: {
|
|
44
|
+
birth_date: '1970-01-01',
|
|
45
|
+
first_name: 'Jane',
|
|
46
|
+
last_name: 'Doe',
|
|
47
|
+
id: 'W000000000'
|
|
48
|
+
},
|
|
49
|
+
provider: {
|
|
50
|
+
first_name: 'JEROME',
|
|
51
|
+
last_name: 'AYA-AY',
|
|
52
|
+
npi: '1467560003'
|
|
53
|
+
},
|
|
54
|
+
service_types: ['health_benefit_plan_coverage'],
|
|
55
|
+
trading_partner_id: 'MOCKPAYER'
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
pd.eligibility(params)
|
|
@@ -65,12 +71,23 @@ pd.files('trading_partner_id', 'path/to/a_file.edi')
|
|
|
65
71
|
|
|
66
72
|
```
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
This version of pokitdok-ruby supports, and defaults to using, the new
|
|
75
|
+
PokitDok v4 API. If you'd like to continue using the previous v3 API,
|
|
76
|
+
you can pass a third parameter to PokitDok::Pokitdok.new, like this:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
@pd = PokitDok::PokitDok.new('my_client_id', 'my_client_secret', 'v3')
|
|
80
|
+
```
|
|
70
81
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
## Supported Ruby Versions
|
|
83
|
+
This library aims to support and is tested against these Ruby versions,
|
|
84
|
+
using travis-ci:
|
|
85
|
+
|
|
86
|
+
* 2.1.1
|
|
87
|
+
* 2.0.0
|
|
88
|
+
* 1.9.3
|
|
89
|
+
* JRuby in 1.9 mode
|
|
90
|
+
* Rubinius 2.2.7
|
|
74
91
|
|
|
75
92
|
You may have luck with other interpreters - let us know how it goes.
|
|
76
93
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.3.0
|
data/lib/pokitdok.rb
CHANGED
|
@@ -21,6 +21,8 @@ module PokitDok
|
|
|
21
21
|
|
|
22
22
|
attr_reader :client # :nodoc:
|
|
23
23
|
attr_reader :token # :nodoc:
|
|
24
|
+
attr_reader :api_url
|
|
25
|
+
attr_reader :version
|
|
24
26
|
|
|
25
27
|
# Connect to the PokitDok API with the specified Client ID and Client
|
|
26
28
|
# Secret.
|
|
@@ -29,22 +31,24 @@ module PokitDok
|
|
|
29
31
|
#
|
|
30
32
|
# +client_secret+ your client secret, provided by PokitDok
|
|
31
33
|
#
|
|
32
|
-
def initialize(client_id, client_secret)
|
|
34
|
+
def initialize(client_id, client_secret, version='v4')
|
|
33
35
|
@client_id = client_id
|
|
34
36
|
@client_secret = client_secret
|
|
37
|
+
@version = version
|
|
38
|
+
|
|
39
|
+
@api_url = "#{url_base}/api/#{version}"
|
|
35
40
|
|
|
36
41
|
@client = OAuth2::Client.new(@client_id, @client_secret,
|
|
37
|
-
site: api_url, token_url: '/oauth2/token')
|
|
42
|
+
site: @api_url, token_url: '/oauth2/token')
|
|
38
43
|
refresh_token
|
|
39
44
|
end
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
POKITDOK_URL_BASE + '/api/v3'
|
|
46
|
+
def url_base
|
|
47
|
+
POKITDOK_URL_BASE
|
|
44
48
|
end
|
|
45
49
|
|
|
46
50
|
def user_agent
|
|
47
|
-
"pokitdok-ruby 0.
|
|
51
|
+
"pokitdok-ruby 0.4 #{RUBY_DESCRIPTION}"
|
|
48
52
|
end
|
|
49
53
|
|
|
50
54
|
# returns a standard set of headers to be passed along with all requests
|
|
@@ -62,16 +66,18 @@ module PokitDok
|
|
|
62
66
|
|
|
63
67
|
# Invokes the activities endpoint, with an optional Hash of parameters.
|
|
64
68
|
def activities(params = {})
|
|
65
|
-
response = @token.get('activities',
|
|
69
|
+
response = @token.get('activities/',
|
|
66
70
|
headers: headers,
|
|
67
71
|
params: params)
|
|
68
72
|
JSON.parse(response.body)
|
|
69
73
|
end
|
|
70
74
|
|
|
71
75
|
# Invokes the cash prices endpoint, with an optional Hash of parameters.
|
|
72
|
-
def cash_prices(
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
def cash_prices(params = {})
|
|
77
|
+
response = @token.get('price/cash/',
|
|
78
|
+
headers: headers,
|
|
79
|
+
params: params)
|
|
80
|
+
JSON.parse(response.body)
|
|
75
81
|
end
|
|
76
82
|
|
|
77
83
|
# Invokes the claims endpoint, with an optional Hash of parameters.
|
|
@@ -84,18 +90,6 @@ module PokitDok
|
|
|
84
90
|
JSON.parse(response.body)
|
|
85
91
|
end
|
|
86
92
|
|
|
87
|
-
# Invokes the claims status endpoint, with an optional Hash of parameters.
|
|
88
|
-
def claim_status(_params = {})
|
|
89
|
-
fail NotImplementedError, 'The PokitDok API does not currently support
|
|
90
|
-
this endpoint.'
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# Invokes the deductible endpoint, with an optional Hash of parameters.
|
|
94
|
-
def deductible(_params = {})
|
|
95
|
-
fail NotImplementedError, 'The PokitDok API does not currently support
|
|
96
|
-
this endpoint.'
|
|
97
|
-
end
|
|
98
|
-
|
|
99
93
|
# Invokes the eligibility endpoint, with an optional Hash of parameters.
|
|
100
94
|
def eligibility(params = {})
|
|
101
95
|
response = @token.post('eligibility/',
|
|
@@ -124,7 +118,7 @@ module PokitDok
|
|
|
124
118
|
# +filename+ the path to the file to transmit
|
|
125
119
|
#
|
|
126
120
|
def files(trading_partner_id, filename)
|
|
127
|
-
url = URI.parse(api_url + '/files/')
|
|
121
|
+
url = URI.parse(@api_url + '/files/')
|
|
128
122
|
|
|
129
123
|
File.open(filename) do |f|
|
|
130
124
|
req = Net::HTTP::Post::Multipart.new url.path,
|
|
@@ -141,15 +135,6 @@ module PokitDok
|
|
|
141
135
|
JSON.parse(@response.body)
|
|
142
136
|
end
|
|
143
137
|
|
|
144
|
-
# Invokes the insurance prices endpoint, with an optional Hash of
|
|
145
|
-
# parameters.
|
|
146
|
-
def insurance_prices(params = {})
|
|
147
|
-
response = @token.get('prices/insurance',
|
|
148
|
-
headers: headers,
|
|
149
|
-
params: params)
|
|
150
|
-
JSON.parse(response.body)
|
|
151
|
-
end
|
|
152
|
-
|
|
153
138
|
# Invokes the payers endpoint, with an optional Hash of parameters.
|
|
154
139
|
def payers(params = {})
|
|
155
140
|
response = @token.get('payers', headers: headers, params: params)
|
data/pokitdok-ruby.gemspec
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: pokitdok-ruby 0.
|
|
5
|
+
# stub: pokitdok-ruby 0.3.0 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "pokitdok-ruby"
|
|
9
|
-
s.version = "0.
|
|
9
|
+
s.version = "0.3.0"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib"]
|
|
13
13
|
s.authors = ["John Riney"]
|
|
14
|
-
s.date = "2014-06-
|
|
14
|
+
s.date = "2014-06-06"
|
|
15
15
|
s.description = "Gem for easy access to the PokitDok Platform APIs."
|
|
16
16
|
s.email = "john.riney@pokitdok.com"
|
|
17
17
|
s.extra_rdoc_files = [
|
|
@@ -42,7 +42,6 @@ Gem::Specification.new do |s|
|
|
|
42
42
|
"vcr_cassettes/eligibility.yml",
|
|
43
43
|
"vcr_cassettes/enrollment.yml",
|
|
44
44
|
"vcr_cassettes/files.yml",
|
|
45
|
-
"vcr_cassettes/insurance_prices.yml",
|
|
46
45
|
"vcr_cassettes/payers.yml",
|
|
47
46
|
"vcr_cassettes/providers.yml"
|
|
48
47
|
]
|
|
@@ -72,6 +71,7 @@ Gem::Specification.new do |s|
|
|
|
72
71
|
s.add_development_dependency(%q<guard-minitest>, ["~> 2.2"])
|
|
73
72
|
s.add_development_dependency(%q<terminal-notifier-guard>, ["~> 1.5"])
|
|
74
73
|
s.add_development_dependency(%q<guard-rubocop>, ["~> 1.0"])
|
|
74
|
+
s.add_development_dependency(%q<coveralls>, [">= 0"])
|
|
75
75
|
else
|
|
76
76
|
s.add_dependency(%q<oauth2>, ["~> 0.9"])
|
|
77
77
|
s.add_dependency(%q<multipart-post>, ["~> 2.0"])
|
|
@@ -90,6 +90,7 @@ Gem::Specification.new do |s|
|
|
|
90
90
|
s.add_dependency(%q<guard-minitest>, ["~> 2.2"])
|
|
91
91
|
s.add_dependency(%q<terminal-notifier-guard>, ["~> 1.5"])
|
|
92
92
|
s.add_dependency(%q<guard-rubocop>, ["~> 1.0"])
|
|
93
|
+
s.add_dependency(%q<coveralls>, [">= 0"])
|
|
93
94
|
end
|
|
94
95
|
else
|
|
95
96
|
s.add_dependency(%q<oauth2>, ["~> 0.9"])
|
|
@@ -109,6 +110,7 @@ Gem::Specification.new do |s|
|
|
|
109
110
|
s.add_dependency(%q<guard-minitest>, ["~> 2.2"])
|
|
110
111
|
s.add_dependency(%q<terminal-notifier-guard>, ["~> 1.5"])
|
|
111
112
|
s.add_dependency(%q<guard-rubocop>, ["~> 1.0"])
|
|
113
|
+
s.add_dependency(%q<coveralls>, [">= 0"])
|
|
112
114
|
end
|
|
113
115
|
end
|
|
114
116
|
|
data/spec/fixtures/claim.json
CHANGED
|
@@ -1,116 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"patient_control_number": "26462967",
|
|
47
|
-
"provider_signature_on_file": "Y",
|
|
48
|
-
"ref": [
|
|
49
|
-
{
|
|
50
|
-
"id_code": "1234567890",
|
|
51
|
-
"id_type": "Claim Number"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
"service_lines": [
|
|
55
|
-
{
|
|
56
|
-
"dates": [
|
|
57
|
-
{
|
|
58
|
-
"date_qualifier": "Service Date",
|
|
59
|
-
"date_value": "04/16/2014"
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
"medical_charge_amount": {
|
|
63
|
-
"amount": "40.0",
|
|
64
|
-
"currency": "USD"
|
|
65
|
-
},
|
|
66
|
-
"medical_diagnosis_code": "1",
|
|
67
|
-
"medical_procedure_identifier": "HC:99213",
|
|
68
|
-
"medical_service_quantity": "1.0",
|
|
69
|
-
"medical_service_unit": "Unit"
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
"payer": {
|
|
74
|
-
"entity_identifier": "Payer",
|
|
75
|
-
"entity_type": "Non-Person",
|
|
76
|
-
"id_code": "HPHC",
|
|
77
|
-
"id_type": "Payor Identification",
|
|
78
|
-
"last_org_name": "HARVARD PILGRIM HEALTH CARE"
|
|
79
|
-
},
|
|
80
|
-
"receiver": {
|
|
81
|
-
"entity_identifier": "Receiver",
|
|
82
|
-
"entity_type": "Non-Person",
|
|
83
|
-
"id_code": "HPHC",
|
|
84
|
-
"id_type": "ETIN",
|
|
85
|
-
"last_org_name": "HPHC"
|
|
86
|
-
},
|
|
87
|
-
"submitter": {
|
|
88
|
-
"entity_identifier": "Submitter",
|
|
89
|
-
"entity_type": "Non-Person",
|
|
90
|
-
"id_code": "123456789",
|
|
91
|
-
"id_type": "ETIN",
|
|
92
|
-
"last_org_name": "ACME, INC."
|
|
93
|
-
},
|
|
94
|
-
"subscriber": {
|
|
95
|
-
"address_line_1": "123 MAIN ST",
|
|
96
|
-
"birth_date": "Sat May 1 00:00:00 1943",
|
|
97
|
-
"city": "BURLINGTON",
|
|
98
|
-
"claim_filing_code": "Health Maintenance Organization",
|
|
99
|
-
"entity_identifier": "Subscriber",
|
|
100
|
-
"entity_type": "Person",
|
|
101
|
-
"first_name": "TED",
|
|
102
|
-
"gender_code": "Male",
|
|
103
|
-
"group_number": "12312-A",
|
|
104
|
-
"id_code": "HP123456700",
|
|
105
|
-
"id_type": "Member ID",
|
|
106
|
-
"is_patient": true,
|
|
107
|
-
"last_org_name": "SMITH",
|
|
108
|
-
"payer_responsibility": "Primary",
|
|
109
|
-
"postal_code": "01803",
|
|
110
|
-
"relationship_code": "Self",
|
|
111
|
-
"state": "MA"
|
|
112
|
-
},
|
|
113
|
-
"trading_partner_id": "MOCKPAYER",
|
|
114
|
-
"transaction_purpose_code": "Original",
|
|
115
|
-
"transaction_type": "Reporting"
|
|
2
|
+
"transaction_code": "chargeable",
|
|
3
|
+
"trading_partner_id": "MOCKPAYER",
|
|
4
|
+
"billing_provider": {
|
|
5
|
+
"taxonomy_code": "207Q00000X",
|
|
6
|
+
"first_name": "Jerome",
|
|
7
|
+
"last_name": "Aya-Ay",
|
|
8
|
+
"npi": "1467560003",
|
|
9
|
+
"address": {
|
|
10
|
+
"address_lines": ["8311 WARREN H ABERNATHY HWY"],
|
|
11
|
+
"city": "SPARTANBURG",
|
|
12
|
+
"state": "SC",
|
|
13
|
+
"zipcode": "29301"
|
|
14
|
+
},
|
|
15
|
+
"tax_id": "123456789"
|
|
16
|
+
},
|
|
17
|
+
"subscriber": {
|
|
18
|
+
"first_name": "Jane",
|
|
19
|
+
"last_name": "Doe",
|
|
20
|
+
"member_id": "W000000000",
|
|
21
|
+
"address": {
|
|
22
|
+
"address_lines": ["123 N MAIN ST"],
|
|
23
|
+
"city": "SPARTANBURG",
|
|
24
|
+
"state": "SC",
|
|
25
|
+
"zipcode": "29301"
|
|
26
|
+
},
|
|
27
|
+
"birth_date": "1970-01-01",
|
|
28
|
+
"gender": "female"
|
|
29
|
+
},
|
|
30
|
+
"claim": {
|
|
31
|
+
"total_charge_amount": 60.0,
|
|
32
|
+
"service_lines": [
|
|
33
|
+
{
|
|
34
|
+
"procedure_code": "99213",
|
|
35
|
+
"charge_amount": 60.0,
|
|
36
|
+
"unit_count": 1.0,
|
|
37
|
+
"diagnosis_codes": ["487.1"],
|
|
38
|
+
"service_date": "2014-06-01"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"payer": {
|
|
43
|
+
"organization_name": "Acme Ins Co",
|
|
44
|
+
"plan_id": "1234567890"
|
|
45
|
+
}
|
|
116
46
|
}
|
data/spec/pokitdok_spec.rb
CHANGED
|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
|
4
4
|
|
|
5
5
|
CLIENT_ID = '4nhMZTpLxBxmiocveVb5'
|
|
6
6
|
CLIENT_SECRET = 'HUIpG9fFf9Qku9mh0lO50SPSDiju3D9Cjx17oeCN'
|
|
7
|
-
POKITDOK_TEST_URL = 'http://localhost:5002
|
|
7
|
+
POKITDOK_TEST_URL = 'http://localhost:5002'
|
|
8
8
|
|
|
9
9
|
def check_meta_and_data(result)
|
|
10
10
|
refute_empty result['meta']
|
|
@@ -14,13 +14,22 @@ end
|
|
|
14
14
|
describe PokitDok do
|
|
15
15
|
describe 'Authenticated functions' do
|
|
16
16
|
before do
|
|
17
|
-
PokitDok::PokitDok.any_instance.stubs(:
|
|
18
|
-
|
|
17
|
+
PokitDok::PokitDok.any_instance.stubs(:url_base).returns(POKITDOK_TEST_URL)
|
|
18
|
+
|
|
19
19
|
VCR.use_cassette 'auth' do
|
|
20
20
|
@pokitdok = PokitDok::PokitDok.new(CLIENT_ID, CLIENT_SECRET)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
it 'should default to the v4 api specification' do
|
|
25
|
+
@pokitdok.api_url.must_equal 'http://localhost:5002/api/v4'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'should revert to the v3 api specification if requested' do
|
|
29
|
+
@pokitdok3 = PokitDok::PokitDok.new(CLIENT_ID, CLIENT_SECRET, 'v3')
|
|
30
|
+
@pokitdok3.api_url.must_equal 'http://localhost:5002/api/v3'
|
|
31
|
+
end
|
|
32
|
+
|
|
24
33
|
it 'should instantiate with a client id and client secret' do
|
|
25
34
|
refute_nil(@pokitdok, 'New PokitDok was nil.')
|
|
26
35
|
end
|
|
@@ -45,8 +54,16 @@ describe PokitDok do
|
|
|
45
54
|
end
|
|
46
55
|
|
|
47
56
|
describe 'Cash Prices endpoint' do
|
|
48
|
-
it '
|
|
49
|
-
|
|
57
|
+
it 'should expose the cash prices endpoint' do
|
|
58
|
+
skip 'in development'
|
|
59
|
+
query = { cpt_code: '12345', zip_code: '75201' }
|
|
60
|
+
|
|
61
|
+
VCR.use_cassette 'cash_prices' do
|
|
62
|
+
@prices = @pokitdok.cash_prices query
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
check_meta_and_data @prices
|
|
66
|
+
refute_empty @prices['data']
|
|
50
67
|
end
|
|
51
68
|
end
|
|
52
69
|
|
|
@@ -64,30 +81,22 @@ describe PokitDok do
|
|
|
64
81
|
end
|
|
65
82
|
end
|
|
66
83
|
|
|
67
|
-
describe 'Claims Status endpoint' do
|
|
68
|
-
it 'is unimplemented' do
|
|
69
|
-
proc { @pokitdok.claim_status }.must_raise(NotImplementedError)
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
describe 'Deductible endpoint' do
|
|
74
|
-
it 'is unimplemented' do
|
|
75
|
-
proc { @pokitdok.deductible }.must_raise(NotImplementedError)
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
|
|
79
84
|
describe 'Eligibility endpoint' do
|
|
80
85
|
it 'should expose the eligibility endpoint' do
|
|
81
86
|
@eligibility_query = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
member: {
|
|
88
|
+
birth_date: '1970-01-01',
|
|
89
|
+
first_name: 'Jane',
|
|
90
|
+
last_name: 'Doe',
|
|
91
|
+
id: 'W000000000'
|
|
92
|
+
},
|
|
93
|
+
provider: {
|
|
94
|
+
first_name: 'JEROME',
|
|
95
|
+
last_name: 'AYA-AY',
|
|
96
|
+
npi: '1467560003'
|
|
97
|
+
},
|
|
98
|
+
service_types: ['health_benefit_plan_coverage'],
|
|
99
|
+
trading_partner_id: 'MOCKPAYER'
|
|
91
100
|
}
|
|
92
101
|
|
|
93
102
|
VCR.use_cassette 'eligibility' do
|
|
@@ -127,18 +136,6 @@ describe PokitDok do
|
|
|
127
136
|
end
|
|
128
137
|
end
|
|
129
138
|
|
|
130
|
-
describe 'Insurance Prices endpoint' do
|
|
131
|
-
it 'should expose the insurance prices endpoint' do
|
|
132
|
-
VCR.use_cassette 'insurance_prices' do
|
|
133
|
-
@prices = @pokitdok.insurance_prices(zip_code: '54321',
|
|
134
|
-
cpt_code: '12345')
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
check_meta_and_data @prices
|
|
138
|
-
refute_empty @prices['data']
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
|
|
142
139
|
describe 'Payers endpoint' do
|
|
143
140
|
it 'should expose the payers endpoint' do
|
|
144
141
|
VCR.use_cassette 'payers' do
|