allscripts_unity_client 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/allscripts_unity_client.rb +1 -0
- data/lib/allscripts_unity_client/client_options.rb +6 -1
- data/lib/allscripts_unity_client/json_client_driver.rb +1 -1
- data/lib/allscripts_unity_client/unity_request.rb +9 -2
- data/lib/allscripts_unity_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b116562b821aba2354693ae0c558db8fb45d7854b4da7167a5159f0069308049
|
4
|
+
data.tar.gz: dce828cd7de3875c3b165fca31625c3b084d6970bb2e3edd6232d8a44cb37075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8f4a8e409752a922352ea4465f23b468fc264df61d913ad2f11f337090d9a527d8dd105737448bad5e1bad462ea18d821813402bcf5ce8dda3a7ad24e8bb426
|
7
|
+
data.tar.gz: 852a4ad6fb74b4d089a5fe5bc178321589ffd4bb9c468e4c015856b38b77fd44f3d761466c2392ef9eea5eb7510a5110632d080ae5cf482e92dab8f768fc9852
|
@@ -3,7 +3,7 @@ module AllscriptsUnityClient
|
|
3
3
|
# Contains various options for Unity configuration.
|
4
4
|
class ClientOptions
|
5
5
|
attr_accessor :proxy, :logger, :ca_file, :ca_path, :timeout, :ehr_userid, :ehr_password
|
6
|
-
attr_reader :base_unity_url, :username, :password, :appname, :timezone
|
6
|
+
attr_reader :base_unity_url, :username, :password, :appname, :timezone, :raw_dates
|
7
7
|
|
8
8
|
# Constructor.
|
9
9
|
#
|
@@ -34,6 +34,7 @@ module AllscriptsUnityClient
|
|
34
34
|
|
35
35
|
self.timezone = options[:timezone]
|
36
36
|
self.base_unity_url = options[:base_unity_url]
|
37
|
+
self.raw_dates = options[:raw_dates]
|
37
38
|
|
38
39
|
validate_options
|
39
40
|
end
|
@@ -96,6 +97,10 @@ module AllscriptsUnityClient
|
|
96
97
|
end
|
97
98
|
end
|
98
99
|
|
100
|
+
def raw_dates=(raw_dates)
|
101
|
+
@raw_dates = raw_dates || false
|
102
|
+
end
|
103
|
+
|
99
104
|
# Return true if proxy is set and not empty.
|
100
105
|
def proxy?
|
101
106
|
!@proxy.to_s.strip.empty?
|
@@ -52,7 +52,7 @@ module AllscriptsUnityClient
|
|
52
52
|
raise UnauthenticatedError, "#{parameters[:action]} for #{@options.base_unity_url}"
|
53
53
|
end
|
54
54
|
|
55
|
-
request = JSONUnityRequest.new(parameters, @options.timezone, @options.appname, @security_token)
|
55
|
+
request = JSONUnityRequest.new(parameters, @options.timezone, @options.appname, @security_token, @options.raw_dates)
|
56
56
|
request_hash = request.to_hash
|
57
57
|
request_data = MultiJson.dump(request_hash)
|
58
58
|
|
@@ -2,7 +2,7 @@ module AllscriptsUnityClient
|
|
2
2
|
|
3
3
|
# Transform a Unity request into a Hash suitable for sending using Savon.
|
4
4
|
class UnityRequest
|
5
|
-
attr_accessor :parameters, :appname, :security_token, :timezone
|
5
|
+
attr_accessor :parameters, :appname, :security_token, :timezone, :raw_dates
|
6
6
|
|
7
7
|
# Constructor.
|
8
8
|
#
|
@@ -26,7 +26,7 @@ module AllscriptsUnityClient
|
|
26
26
|
# timezone:: An ActiveSupport::TimeZone instance.
|
27
27
|
# appname:: The Unity license appname.
|
28
28
|
# security_token:: A security token from the Unity GetSecurityToken call.
|
29
|
-
def initialize(parameters, timezone, appname, security_token)
|
29
|
+
def initialize(parameters, timezone, appname, security_token, raw_dates=false)
|
30
30
|
raise ArgumentError, 'parameters can not be nil' if parameters.nil?
|
31
31
|
raise ArgumentError, 'timezone can not be nil' if timezone.nil?
|
32
32
|
raise ArgumentError, 'appname can not be nil' if appname.nil?
|
@@ -36,6 +36,7 @@ module AllscriptsUnityClient
|
|
36
36
|
@security_token = security_token
|
37
37
|
@parameters = parameters
|
38
38
|
@timezone = timezone
|
39
|
+
@raw_dates = raw_dates
|
39
40
|
end
|
40
41
|
|
41
42
|
# Convert the parameters to a Hash for Savon with all possible dates
|
@@ -72,11 +73,17 @@ module AllscriptsUnityClient
|
|
72
73
|
|
73
74
|
protected
|
74
75
|
|
76
|
+
def use_raw_dates?
|
77
|
+
@raw_dates || false
|
78
|
+
end
|
79
|
+
|
75
80
|
def process_date(value)
|
76
81
|
if value && (value.is_a?(Time) || value.is_a?(DateTime) || value.is_a?(ActiveSupport::TimeWithZone))
|
77
82
|
return value.in_time_zone(@timezone).iso8601
|
78
83
|
end
|
79
84
|
|
85
|
+
return value if use_raw_dates?
|
86
|
+
|
80
87
|
date = Utilities::try_to_encode_as_date(ActiveSupport::TimeZone['Etc/UTC'], value)
|
81
88
|
|
82
89
|
if date && date.is_a?(ActiveSupport::TimeWithZone)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allscripts_unity_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- healthfinch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|