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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c003a74a76f503f46662eb6b56b843ca3ea29426
4
- data.tar.gz: 208198fca66aa6f518572c6295faec98e00e76d8
3
+ metadata.gz: 0d8051afba1193c910b31434586127a5bd5b1c43
4
+ data.tar.gz: dc627d3c86e882820acc2e81b37c2ea9b23a4486
5
5
  SHA512:
6
- metadata.gz: 07e71684c2ad7e3080b716aca35a802f99de7ddbe94232dabddaf186dece37d19a988ac2d1673ff48a43d99a5ca95b68dcad0c4b3861e471e0af1db065feae84
7
- data.tar.gz: b5a02af06709e7c03ab9842b9c1d305e70a2dc2aa0b86f1d6da1d5fc78de8e233225a3a7d52dd478e2ce6d996d3c9db123bf5255e9f7d581852a80d9913eecc8
6
+ metadata.gz: 99d5023b9a78d380b904c7c0b1013f38bc0afd20a26ecdb88835d83342c5376994d3c300c7d8f76e6fe0f64ee7f1e0e113c9feb239d38bf96f78b755d475cb54
7
+ data.tar.gz: 45b0101a7c20d6c517ce583e98e30859c7e98750ef33278ef0944df544125732e5d0b800100b86397966f328b2bce1abb952f1a79a0e34b2abd232f652a27c13
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .idea
@@ -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
- "#{BASE_URL}/#{AUTH_PATH[@version]}/token",
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
- "#{BASE_URL}/#{@version}/#{endpoint}",
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: { departmentid: department_id, allergies: allergies.to_json }
303
+ params: params.merge!(departmentid: department_id, allergies: allergies.to_json)
296
304
  )
297
305
  end
298
306
 
@@ -1,3 +1,3 @@
1
1
  module AthenaHealth
2
- VERSION = '1.0.41'.freeze
2
+ VERSION = '1.0.42'.freeze
3
3
  end
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.41
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-09-12 00:00:00.000000000 Z
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.5.1
203
+ rubygems_version: 2.6.4
204
204
  signing_key:
205
205
  specification_version: 4
206
206
  summary: Ruby wrapper for Athenahealth API.