allscripts_unity_client 1.3.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +66 -66
  3. data/allscripts_unity_client.gemspec +32 -32
  4. data/lib/allscripts_unity_client/client.rb +215 -205
  5. data/lib/allscripts_unity_client/client_driver.rb +15 -42
  6. data/lib/allscripts_unity_client/client_options.rb +68 -0
  7. data/lib/allscripts_unity_client/json_client_driver.rb +46 -50
  8. data/lib/allscripts_unity_client/json_unity_request.rb +20 -20
  9. data/lib/allscripts_unity_client/json_unity_response.rb +1 -1
  10. data/lib/allscripts_unity_client/soap_client_driver.rb +29 -29
  11. data/lib/allscripts_unity_client/timezone.rb +15 -10
  12. data/lib/allscripts_unity_client/unity_request.rb +17 -17
  13. data/lib/allscripts_unity_client/unity_response.rb +3 -3
  14. data/lib/allscripts_unity_client/utilities.rb +5 -5
  15. data/lib/allscripts_unity_client/version.rb +1 -1
  16. data/lib/allscripts_unity_client.rb +21 -25
  17. data/spec/allscripts_unity_client_spec.rb +12 -16
  18. data/spec/client_driver_spec.rb +1 -49
  19. data/spec/client_options_spec.rb +134 -0
  20. data/spec/client_spec.rb +9 -9
  21. data/spec/factories/allscripts_unity_client_parameters_factory.rb +2 -2
  22. data/spec/factories/client_driver_factory.rb +4 -5
  23. data/spec/factories/client_factory.rb +2 -2
  24. data/spec/factories/client_options.rb +13 -0
  25. data/spec/factories/json_client_driver_factory.rb +1 -1
  26. data/spec/factories/json_unity_request_factory.rb +1 -1
  27. data/spec/factories/json_unity_response_factory.rb +1 -1
  28. data/spec/factories/magic_request_factory.rb +4 -4
  29. data/spec/factories/soap_client_driver_factory.rb +1 -1
  30. data/spec/factories/timezone_factory.rb +2 -2
  31. data/spec/factories/unity_request_factory.rb +3 -3
  32. data/spec/factories/unity_response_factory.rb +2 -2
  33. data/spec/json_client_driver_spec.rb +18 -86
  34. data/spec/json_unity_request_spec.rb +7 -7
  35. data/spec/json_unity_response_spec.rb +6 -6
  36. data/spec/soap_client_driver_spec.rb +20 -82
  37. data/spec/spec_helper.rb +5 -9
  38. data/spec/support/shared_examples_for_client_driver.rb +37 -58
  39. data/spec/support/shared_examples_for_unity_request.rb +13 -13
  40. data/spec/support/shared_examples_for_unity_response.rb +4 -4
  41. data/spec/timezone_spec.rb +31 -11
  42. data/spec/unity_request_spec.rb +7 -7
  43. data/spec/unity_response_spec.rb +4 -4
  44. data/spec/utilities_spec.rb +2 -2
  45. metadata +30 -57
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ecd96ba97fa670be830e0a85f10e577201e6363b
4
+ data.tar.gz: 87af8b8cbf7ebcea83ef5b0cf69d0ad67f3d2ab6
5
+ SHA512:
6
+ metadata.gz: b0c13a8a52bca8a0ad7a26ca837f1d8820922dd952ac08ccba9a23c03331731f141757ebcd7a7489f322ece978f4742dc630728cf30e40c4ceaeb905bb5e6a9d
7
+ data.tar.gz: 83b22d9a877b32fe3014450e4ab4500baedd05b945a7f81367046d8823afd4b873cc0db14a615a79ede8a5767db92315c69b87308e9dda4e456e91b3b7f41586
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Allscripts Unity Client [![Build Status](https://travis-ci.org/healthfinch/allscripts-unity-client.png?branch=version1)](https://travis-ci.org/healthfinch/allscripts-unity-client) [![Coverage Status](https://coveralls.io/repos/healthfinch/allscripts-unity-client/badge.png?branch=version1)](https://coveralls.io/r/healthfinch/allscripts-unity-client?branch=version1)
1
+ # Allscripts Unity Client [![Build Status](https://travis-ci.org/healthfinch/allscripts-unity-client.png?branch=master)](https://travis-ci.org/healthfinch/allscripts-unity-client) [![Coverage Status](https://coveralls.io/repos/healthfinch/allscripts-unity-client/badge.png?branch=master)](https://coveralls.io/r/healthfinch/allscripts-unity-client?branch=master)
2
2
 
3
3
  The `allscripts_unity_client` gem is a Ruby client for the Allscripts Unity API. See http://remotecentral.allscripts.com/UnityAPIReference for more documentation on the API.
4
4
 
@@ -25,10 +25,10 @@ A Unity API client can be created using the `AllscriptsUnityClient.create` facto
25
25
 
26
26
  ```ruby
27
27
  unity_client = AllscriptsUnityClient.create({
28
- :base_unity_url => "http://unity.base.url",
29
- :appname => "appname",
30
- :username => "username",
31
- :password => "password"
28
+ base_unity_url: "http://unity.base.url",
29
+ appname: "appname",
30
+ username: "username",
31
+ password: "password"
32
32
  })
33
33
  ```
34
34
 
@@ -37,11 +37,11 @@ A JSON client can also be created using the `:mode` option:
37
37
  ```ruby
38
38
  # Mode defaults to :soap
39
39
  unity_client = AllscriptsUnityClient.create({
40
- :mode => :json,
41
- :base_unity_url => "http://unity.base.url",
42
- :appname => "appname",
43
- :username => "username",
44
- :password => "password"
40
+ mode: :json,
41
+ base_unity_url: "http://unity.base.url",
42
+ appname: "appname",
43
+ username: "username",
44
+ password: "password"
45
45
  })
46
46
  ```
47
47
 
@@ -80,18 +80,18 @@ The endpoint used to make API calls in Unity is called Magic. Magic can be acces
80
80
 
81
81
  ```ruby
82
82
  unity_client.magic({
83
- :action => "action",
84
- :userid => "userid",
85
- :appname => "appname", # Only use to override default. Default: unity_client.appname
86
- :patientid => "patientid",
87
- :token => "token", # Only use to override default. Default: unity_client.security_token
88
- :parameter1 => "parameter1",
89
- :parameter2 => "parameter2",
90
- :parameter3 => "parameter3",
91
- :parameter4 => "parameter4",
92
- :parameter5 => "parameter5",
93
- :parameter6 => "parameter6",
94
- :data => "data"
83
+ action: "action",
84
+ userid: "userid",
85
+ appname: "appname", # Only use to override default. Default: unity_client.appname
86
+ patientid: "patientid",
87
+ token: "token", # Only use to override default. Default: unity_client.security_token
88
+ parameter1: "parameter1",
89
+ parameter2: "parameter2",
90
+ parameter3: "parameter3",
91
+ parameter4: "parameter4",
92
+ parameter5: "parameter5",
93
+ parameter6: "parameter6",
94
+ data: "data"
95
95
  })
96
96
  ```
97
97
 
@@ -136,11 +136,11 @@ format. See [TZInfo](http://tzinfo.github.io/) for more information:
136
136
 
137
137
  ```ruby
138
138
  unity_client = AllscriptsUnityClient.create({
139
- :timezone => "America/New_York",
140
- :base_unity_url => "http://unity.base.url",
141
- :appname => "appname",
142
- :username => "username",
143
- :password => "password"
139
+ timezone: "America/New_York",
140
+ base_unity_url: "http://unity.base.url",
141
+ appname: "appname",
142
+ username: "username",
143
+ password: "password"
144
144
  })
145
145
  ```
146
146
 
@@ -153,23 +153,23 @@ By default Ruby's `Logger` is used and logs to `STDOUT` with a level of `Logger:
153
153
 
154
154
  ```ruby
155
155
  unity_client = AllscriptsUnityClient.create({
156
- :base_unity_url => "http://unity.base.url",
157
- :appname => "appname",
158
- :username => "username",
159
- :password => "password",
160
- :logger => Rails.logger
156
+ base_unity_url: "http://unity.base.url",
157
+ appname: "appname",
158
+ username: "username",
159
+ password: "password",
160
+ logger: Rails.logger
161
161
  })
162
162
  ```
163
163
 
164
- Logging can also be disabled with the `:log` option:
164
+ Logging can be disabled by setting the `:logger` option to nil (this is the default):
165
165
 
166
166
  ```ruby
167
167
  unity_client = AllscriptsUnityClient.create({
168
- :base_unity_url => "http://unity.base.url",
169
- :appname => "appname",
170
- :username => "username",
171
- :password => "password",
172
- :log => false
168
+ base_unity_url: "http://unity.base.url",
169
+ appname: "appname",
170
+ username: "username",
171
+ password: "password",
172
+ logger: nil
173
173
  })
174
174
  ```
175
175
 
@@ -181,11 +181,11 @@ An HTTP proxy can be configured using the `:proxy` option:
181
181
 
182
182
  ```ruby
183
183
  unity_client = AllscriptsUnityClient.create({
184
- :base_unity_url => "http://unity.base.url",
185
- :appname => "appname",
186
- :username => "username",
187
- :password => "password",
188
- :proxy => "http://localhost:8888"
184
+ base_unity_url: "http://unity.base.url",
185
+ appname: "appname",
186
+ username: "username",
187
+ password: "password",
188
+ proxy: "http://localhost:8888"
189
189
  })
190
190
  ```
191
191
 
@@ -200,11 +200,11 @@ accept USA locale dates by default. There are currently no plans to support othe
200
200
 
201
201
  ```ruby
202
202
  unity_client = AllscriptsUnityClient.create({
203
- :base_unity_url => "http://unity.base.url",
204
- :appname => "appname",
205
- :username => "username",
206
- :password => "password",
207
- :timezone => "America/New_York"
203
+ base_unity_url: "http://unity.base.url",
204
+ appname: "appname",
205
+ username: "username",
206
+ password: "password",
207
+ timezone: "America/New_York"
208
208
  })
209
209
 
210
210
  unity_client.get_security_token!
@@ -217,12 +217,12 @@ The above example would output the following `Hash`:
217
217
 
218
218
  ```
219
219
  {
220
- :server_time_zone => "Eastern Standard Time",
221
- :server_time => #<DateTime: 2013-11-01T15:49:23+00:00 ((2456598j,56963s,0n),+0s,2299161j)>,
222
- :server_date_time_offset => #<DateTime: 2013-11-01T19:49:23+00:00 ((2456598j,71363s,0n),+0s,2299161j)>,
223
- :system => "Enterprise EHR",
224
- :product_version => "11.2.3.32.000",
225
- :uaibornondate => #<Date: 2013-07-10 ((2456484j,0s,0n),+0s,2299161j)>
220
+ server_time_zone: "Eastern Standard Time",
221
+ server_time: #<DateTime: 2013-11-01T15:49:23+00:00 ((2456598j,56963s,0n),+0s,2299161j)>,
222
+ server_date_time_offset: #<DateTime: 2013-11-01T19:49:23+00:00 ((2456598j,71363s,0n),+0s,2299161j)>,
223
+ system: "Enterprise EHR",
224
+ product_version: "11.2.3.32.000",
225
+ uaibornondate: #<Date: 2013-07-10 ((2456484j,0s,0n),+0s,2299161j)>
226
226
  }
227
227
  ```
228
228
 
@@ -230,12 +230,12 @@ The above example would output the following `Hash`:
230
230
 
231
231
  ```ruby
232
232
  unity_client = AllscriptsUnityClient.create({
233
- :mode => :json
234
- :base_unity_url => "http://unity.base.url",
235
- :appname => "appname",
236
- :username => "username",
237
- :password => "password",
238
- :timezone => "America/New_York"
233
+ mode: :json
234
+ base_unity_url: "http://unity.base.url",
235
+ appname: "appname",
236
+ username: "username",
237
+ password: "password",
238
+ timezone: "America/New_York"
239
239
  })
240
240
 
241
241
  unity_client.get_security_token!
@@ -248,12 +248,12 @@ The above example would output the following `Hash`:
248
248
 
249
249
  ```
250
250
  {
251
- :server_time_zone => "Eastern Standard Time",
252
- :server_time => #<DateTime: 2013-11-01T15:49:23+00:00 ((2456598j,56963s,0n),+0s,2299161j)>,
253
- :server_date_time_offset => #<DateTime: 2013-11-01T19:49:23+00:00 ((2456598j,71363s,0n),+0s,2299161j)>,
254
- :system => "Enterprise EHR",
255
- :product_version => "11.2.3.32.000",
256
- :uaibornondate => #<Date: 2013-07-10 ((2456484j,0s,0n),+0s,2299161j)>
251
+ server_time_zone: "Eastern Standard Time",
252
+ server_time: #<DateTime: 2013-11-01T15:49:23+00:00 ((2456598j,56963s,0n),+0s,2299161j)>,
253
+ server_date_time_offset: #<DateTime: 2013-11-01T19:49:23+00:00 ((2456598j,71363s,0n),+0s,2299161j)>,
254
+ system: "Enterprise EHR",
255
+ product_version: "11.2.3.32.000",
256
+ uaibornondate: #<Date: 2013-07-10 ((2456484j,0s,0n),+0s,2299161j)>
257
257
  }
258
258
  ```
259
259
 
@@ -1,40 +1,40 @@
1
1
  lib = File.expand_path('../lib/', __FILE__)
2
2
  $:.unshift lib unless $:.include?(lib)
3
3
 
4
- require "allscripts_unity_client/version"
5
- require "date"
4
+ require 'allscripts_unity_client/version'
5
+ require 'date'
6
6
 
7
7
  Gem::Specification.new do |gem|
8
- gem.name = "allscripts_unity_client"
8
+ gem.name = 'allscripts_unity_client'
9
9
  gem.version = AllscriptsUnityClient::VERSION
10
10
  gem.date = Date.today
11
- gem.required_ruby_version = "> 1.9.3"
12
- gem.license = "MIT"
13
- gem.homepage = "https://github.com/healthfinch/allscripts-unity-client"
14
-
15
- gem.summary = "Allscripts Unity API client"
16
- gem.description = "Provides a simple interface to the Allscripts Unity API using JSON or SOAP. Developed at healthfinch, Inc. http://healthfinch.com"
17
-
18
- gem.authors = ["Ash Gupta", "Neil Goodman"]
19
- gem.email = ["ash.gupta@healthfinch.com", "neil@healthfinch.com"]
20
-
21
- gem.require_paths = ["lib"]
22
-
23
- gem.files = `git ls-files`.split("\n")
24
-
25
- gem.add_runtime_dependency "savon", "~> 2.3.0"
26
- gem.add_runtime_dependency "httpi", "~> 2.1.0"
27
- gem.add_runtime_dependency "net-http-persistent", "~> 2.9.0"
28
- gem.add_runtime_dependency "tzinfo", "~> 0.3.29"
29
- gem.add_runtime_dependency "nokogiri", "< 1.6", ">= 1.4.0"
30
- gem.add_runtime_dependency "nori", "~> 2.3.0"
31
- gem.add_runtime_dependency "american_date", "~> 1.1.0"
32
-
33
- gem.add_development_dependency "factory_girl", "~> 4.2.0"
34
- gem.add_development_dependency "rake", "~> 10.1.0"
35
- gem.add_development_dependency "faker", "~> 1.2.0"
36
- gem.add_development_dependency "rspec", "~> 2.14.1"
37
- gem.add_development_dependency "simplecov", "~> 0.7.1"
38
- gem.add_development_dependency "webmock", "~> 1.15.0"
39
- gem.add_development_dependency "coveralls", "~> 0.7.0"
11
+ gem.required_ruby_version = '> 1.9.3'
12
+ gem.license = 'MIT'
13
+ gem.homepage = 'https://github.com/healthfinch/allscripts-unity-client'
14
+
15
+ gem.summary = 'Allscripts Unity API client'
16
+ gem.description = 'Provides a simple interface to the Allscripts Unity API using JSON or SOAP. Developed at healthfinch, Inc. http://healthfinch.com'
17
+
18
+ gem.authors = ['Ash Gupta', 'Neil Goodman']
19
+ gem.email = %w(ash.gupta@healthfinch.com neil@healthfinch.com)
20
+
21
+ gem.require_paths = ['lib']
22
+
23
+ gem.files = `git ls-files`.split("\n").delete_if { |file| /^\.ruby-version$/.match(file) }
24
+
25
+ gem.add_runtime_dependency 'savon', '~> 2.3.0'
26
+ gem.add_runtime_dependency 'faraday', '~> 0.9.0'
27
+ gem.add_runtime_dependency 'em-http-request', '~> 1.1.2'
28
+ gem.add_runtime_dependency 'tzinfo', '~> 0.3.29'
29
+ gem.add_runtime_dependency 'nokogiri', '< 1.6', '>= 1.4.0'
30
+ gem.add_runtime_dependency 'nori', '~> 2.3.0'
31
+ gem.add_runtime_dependency 'american_date', '~> 1.1.0'
32
+
33
+ gem.add_development_dependency 'factory_girl', '~> 4.4.0'
34
+ gem.add_development_dependency 'rake', '~> 10.3.1'
35
+ gem.add_development_dependency 'faker', '~> 1.3.0'
36
+ gem.add_development_dependency 'rspec', '~> 3.0.0.beta2'
37
+ gem.add_development_dependency 'simplecov', '~> 0.8.2'
38
+ gem.add_development_dependency 'webmock', '~> 1.17.4'
39
+ gem.add_development_dependency 'coveralls', '~> 0.7.0'
40
40
  end