athena_health 1.0.41 → 1.0.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/athena_health/connection.rb +4 -3
- data/lib/athena_health/endpoints/patients.rb +10 -2
- data/lib/athena_health/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d8051afba1193c910b31434586127a5bd5b1c43
|
4
|
+
data.tar.gz: dc627d3c86e882820acc2e81b37c2ea9b23a4486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d5023b9a78d380b904c7c0b1013f38bc0afd20a26ecdb88835d83342c5376994d3c300c7d8f76e6fe0f64ee7f1e0e113c9feb239d38bf96f78b755d475cb54
|
7
|
+
data.tar.gz: 45b0101a7c20d6c517ce583e98e30859c7e98750ef33278ef0944df544125732e5d0b800100b86397966f328b2bce1abb952f1a79a0e34b2abd232f652a27c13
|
data/.gitignore
CHANGED
@@ -5,16 +5,17 @@ module AthenaHealth
|
|
5
5
|
BASE_URL = 'https://api.athenahealth.com'.freeze
|
6
6
|
AUTH_PATH = { 'v1' => 'oauth', 'preview1' => 'oauthpreview', 'openpreview1' => 'oauthopenpreview' }
|
7
7
|
|
8
|
-
def initialize(version:, key:, secret:, token: nil)
|
8
|
+
def initialize(version:, key:, secret:, token: nil, base_url: BASE_URL)
|
9
9
|
@version = version
|
10
10
|
@key = key
|
11
11
|
@secret = secret
|
12
12
|
@token = token
|
13
|
+
@base_url = base_url
|
13
14
|
end
|
14
15
|
|
15
16
|
def authenticate
|
16
17
|
response = Typhoeus.post(
|
17
|
-
"#{
|
18
|
+
"#{@base_url}/#{AUTH_PATH[@version]}/token",
|
18
19
|
userpwd: "#{@key}:#{@secret}",
|
19
20
|
body: { grant_type: 'client_credentials' }
|
20
21
|
).response_body
|
@@ -26,7 +27,7 @@ module AthenaHealth
|
|
26
27
|
authenticate if @token.nil?
|
27
28
|
|
28
29
|
response = Typhoeus::Request.new(
|
29
|
-
"#{
|
30
|
+
"#{@base_url}/#{@version}/#{endpoint}",
|
30
31
|
method: method,
|
31
32
|
headers: { "Authorization" => "Bearer #{@token}"},
|
32
33
|
params: params,
|
@@ -278,6 +278,14 @@ module AthenaHealth
|
|
278
278
|
)
|
279
279
|
end
|
280
280
|
|
281
|
+
def update_patient_medications(practice_id:, department_id:, patient_id:, params: {})
|
282
|
+
response = @api.call(
|
283
|
+
endpoint: "#{practice_id}/chart/#{patient_id}/medications",
|
284
|
+
method: :put,
|
285
|
+
body: params.merge!(departmentid: department_id)
|
286
|
+
)
|
287
|
+
end
|
288
|
+
|
281
289
|
def patient_allergies(practice_id:, department_id:, patient_id:, params: {})
|
282
290
|
response = @api.call(
|
283
291
|
endpoint: "#{practice_id}/chart/#{patient_id}/allergies",
|
@@ -288,11 +296,11 @@ module AthenaHealth
|
|
288
296
|
UserAllergyCollection.new(response)
|
289
297
|
end
|
290
298
|
|
291
|
-
def update_patient_allergies(practice_id:, department_id:, patient_id:, allergies:)
|
299
|
+
def update_patient_allergies(practice_id:, department_id:, patient_id:, allergies:, params: {})
|
292
300
|
response = @api.call(
|
293
301
|
endpoint: "#{practice_id}/chart/#{patient_id}/allergies",
|
294
302
|
method: :put,
|
295
|
-
params:
|
303
|
+
params: params.merge!(departmentid: department_id, allergies: allergies.to_json)
|
296
304
|
)
|
297
305
|
end
|
298
306
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: athena_health
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mateusz Urbański
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
202
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.6.4
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: Ruby wrapper for Athenahealth API.
|