allscripts_unity_client 5.0.0 → 5.1.1
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/lib/allscripts_unity_client/client.rb +2 -1
- 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
- data/lib/allscripts_unity_client.rb +1 -0
- 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: de275ad2051cce3acb984a1f6356f57c5fadabaf4791a70d5db78e06a7428c44
|
4
|
+
data.tar.gz: c1686b38780d4e7bd66a332a9aff911f57dfa789d27fdfd4a70906e38b6a8f93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38dc5a1f56ff0b512511f7bd609215631971083e9564feae4656fdc32fb1f8df8e10a39c12ccd8d2a7c840a3c7024bb6809ce4958c512c5586155484f41e9c60
|
7
|
+
data.tar.gz: c2781793c88040f2d1c25c1ddd324187605ec263d5a37be1290313864ef900afe56c0d36af91160e29debdd46e1ae55199862086350919c926b38b16060109c8
|
@@ -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.1
|
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: 2022-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|