dock_health_api 0.5.1 → 0.5.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e13712f9ae22b6eb2596f030be20bb2c893c5f6808911e715560e10444016606
4
- data.tar.gz: 6f920ca3cba06475d053c4c8213e6a50c2112f3ae6eaa95b3475713bfb9973b3
3
+ metadata.gz: a5eeb9f59f16fe42adb6f9eabaa1d1f445f7731cb49c6c8f61f7fe7d4539ecb3
4
+ data.tar.gz: 1870c4a56fff1be1afcbf129cdf72d02d1bbad07ca4fe13220c7a849512f3e6c
5
5
  SHA512:
6
- metadata.gz: 40905d8789ab5848e6903fca585678a8872318f6931e63fb1b90ddf72e03a70e063b88101bf214d2b83458fa9ce6f698b6155b74a8040c487e4ce0c18fa6e673
7
- data.tar.gz: 0f0461e6cef1b1d1941b834ffb258dfdf8918a57f453c16fb4e8d24051a021bc6c4bf48c7e9c19b63124a88756d0e7fb6d1535b2b6ba0d69db30aaf1d3c3a15c
6
+ metadata.gz: ce5e2a6922f5a305894afce45d0ee8adac737352e06cbee8c216cace500cc176f2e757d18d42e2e5771c722e815656849ef0d37405f3512d09f4626113844f23
7
+ data.tar.gz: fb61b708c14f301f53f05fb70c29d2f8a19f2431454a048865fb69f85f8674c430db872a7079a3cfbe4b47c1c1b79e98315d512b0901580ab38cecfb560b516b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dock_health_api (0.5.0)
4
+ dock_health_api (0.5.4)
5
5
  oauth2 (~> 1.4)
6
6
  ostruct
7
7
  rspec (~> 3.0)
data/bin/console CHANGED
@@ -18,6 +18,7 @@ DockHealthApi.org_id = ENV["DOCK_ORG"]
18
18
  DockHealthApi.user_id = ENV["DOCK_USER"]
19
19
  DockHealthApi.api = ENV["DOCK_HEALTH_API"]
20
20
  DockHealthApi.token_url = ENV["DOCK_HEALTH_AUTH_URL"]
21
+ DockHealthApi.iframe_base_url = ENV["DOCK_HEALTH_IFRAME_BASE_URL"]
21
22
 
22
23
  require "irb"
23
24
  IRB.start(__FILE__)
@@ -1,6 +1,18 @@
1
1
  module DockHealthApi
2
2
  class Config
3
- attr_accessor :api_key, :api_secret, :api_base, :token_url, :resource_url, :org_id, :user_id, :api, :iframe_token, :token, :iframe_token_expires_at, :token_expires_at, :debug
4
-
3
+ attr_accessor :api_key,
4
+ :api_secret,
5
+ :api_base,
6
+ :token_url,
7
+ :resource_url,
8
+ :org_id,
9
+ :user_id,
10
+ :api,
11
+ :iframe_token,
12
+ :token,
13
+ :iframe_token_expires_at,
14
+ :token_expires_at,
15
+ :debug,
16
+ :iframe_base_url
5
17
  end
6
18
  end
@@ -6,7 +6,7 @@ module DockHealthApi
6
6
  return response if client.config.debug || params.empty?
7
7
  search_result = response
8
8
  params.each do |p|
9
- search_result = response.select { |list| list[p[0].to_s] == p[1] }
9
+ search_result = search_result.select { |list| list[p[0].to_s] == p[1] }
10
10
  end
11
11
  return search_result
12
12
  end
@@ -0,0 +1,9 @@
1
+ module DockHealthApi
2
+ class CustomStatus < Resource
3
+ extend DockHealthApi::Crud::List
4
+
5
+ def self.resource_url
6
+ "#{client.config.resource_url}/api/#{url_version}/configuration/status"
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module DockHealthApi
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.4"
3
3
  end
@@ -27,9 +27,9 @@ module DockHealthApi
27
27
  autoload :Developer, "dock_health_api/resources/developer"
28
28
  autoload :Organization, "dock_health_api/resources/organization"
29
29
  autoload :CustomField, "dock_health_api/resources/customfield"
30
+ autoload :CustomStatus, "dock_health_api/resources/customstatus"
30
31
 
31
32
  @config = DockHealthApi::Config.new
32
- @iframe_base_url = "https://dev.dockhealth.app/#/auth/embedded?"
33
33
 
34
34
  class << self
35
35
  attr_reader :config
@@ -49,6 +49,7 @@ module DockHealthApi
49
49
  def_delegators :@config, :token, :token=
50
50
  def_delegators :@config, :token_expires_at, :token_expires_at=
51
51
  def_delegators :@config, :debug, :debug=
52
+ def_delegators :@config, :iframe_base_url, :iframe_base_url=
52
53
 
53
54
  def receive_iframe_token
54
55
  Client.active_client.iframe_token_connection if iframe_token_expired?
@@ -66,7 +67,7 @@ module DockHealthApi
66
67
  target_type = arg[:target_type]
67
68
  target_id = arg[:target_id]
68
69
 
69
- @iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{dock_user_id}&viewType=#{view_type}&targetType=#{target_type}&targetId=#{target_id}"
70
+ iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{dock_user_id}&viewType=#{view_type}&targetType=#{target_type}&targetId=#{target_id}"
70
71
  end
71
72
 
72
73
  def patient_url(arg={})
@@ -76,7 +77,7 @@ module DockHealthApi
76
77
  dock_user_id = arg[:user_id]
77
78
  target_id = arg[:patient_id]
78
79
 
79
- @iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{dock_user_id}&viewType=#{view_type}&targetType=#{target_type}&targetId=#{target_id}"
80
+ iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{dock_user_id}&viewType=#{view_type}&targetType=#{target_type}&targetId=#{target_id}"
80
81
  end
81
82
 
82
83
 
@@ -84,7 +85,7 @@ module DockHealthApi
84
85
  receive_iframe_token
85
86
  dock_user_id = arg[:user_id]
86
87
 
87
- @iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{dock_user_id}"
88
+ iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{dock_user_id}"
88
89
  end
89
90
 
90
91
  def tasklist_url(arg={})
@@ -93,7 +94,7 @@ module DockHealthApi
93
94
  target_type = "LIST"
94
95
  target_id = arg[:tasklist_id]
95
96
 
96
- @iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{user_id}&viewType=#{view_type}&targetType=#{target_type}&targetId=#{target_id}"
97
+ iframe_base_url+"authToken=#{iframe_token}&dockOrganizationId=#{org_id}&dockUserId=#{user_id}&viewType=#{view_type}&targetType=#{target_type}&targetId=#{target_id}"
97
98
  end
98
99
  end
99
100
  end
@@ -0,0 +1,14 @@
1
+ require 'dock_health_api'
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe DockHealthApi::CustomStatus do
5
+
6
+ describe "#list" do
7
+ context "list all customstatus" do
8
+ it 'should list all customstatus' do
9
+ response = DockHealthApi::CustomStatus.list
10
+ expect(response.first.is_a?(DockHealthApi::CustomStatus))
11
+ end
12
+ end
13
+ end
14
+ end
data/spec/spec_helper.rb CHANGED
@@ -24,4 +24,5 @@ RSpec.configure do |config|
24
24
  DockHealthApi.user_id = ENV["DOCK_USER"]
25
25
  DockHealthApi.api = ENV["DOCK_HEALTH_API"]
26
26
  DockHealthApi.token_url = ENV["DOCK_HEALTH_AUTH_URL"]
27
+ DockHealthApi.iframe_base_url = ENV["DOCK_HEALTH_IFRAME_BASE_URL"]
27
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dock_health_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Magomero
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-20 00:00:00.000000000 Z
12
+ date: 2022-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2
@@ -109,6 +109,7 @@ files:
109
109
  - lib/dock_health_api/object.rb
110
110
  - lib/dock_health_api/resource.rb
111
111
  - lib/dock_health_api/resources/customfield.rb
112
+ - lib/dock_health_api/resources/customstatus.rb
112
113
  - lib/dock_health_api/resources/developer.rb
113
114
  - lib/dock_health_api/resources/organization.rb
114
115
  - lib/dock_health_api/resources/patient.rb
@@ -119,6 +120,7 @@ files:
119
120
  - lib/dock_health_api/version.rb
120
121
  - spec/client_spec.rb
121
122
  - spec/customfield_spec.rb
123
+ - spec/customstatus_spec.rb
122
124
  - spec/developer_spec.rb
123
125
  - spec/dock_health_api_spec.rb
124
126
  - spec/organization.rb