vistarpc4r 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +15 -14
- data/VERSION +1 -1
- data/examples/test.rb +4 -1
- data/lib/vistarpc4r/rpc_broker_connection.rb +10 -9
- data/vistarpc4r.gemspec +2 -2
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -7,20 +7,21 @@ The VistA server requires each connection to have a username/password authentica
|
|
7
7
|
|
8
8
|
This gem has been tested with Medsphere's OpenVista server distribution.
|
9
9
|
|
10
|
-
Future
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
10
|
+
== Future features
|
11
|
+
* Ruby classes for primary VistA data object
|
12
|
+
* Some sort of connection pooling
|
13
|
+
* ActiveRecord interface to VistA (nasty one, but cool)
|
14
|
+
*
|
15
|
+
|
16
|
+
== Usage
|
17
|
+
|
18
|
+
=== Installation
|
19
|
+
You may get the latest stable version from Rubyforge.
|
20
|
+
|
21
|
+
$ gem install vistarpc4r
|
22
|
+
|
23
|
+
=== An Example
|
24
|
+
Check out the examples in the examples directory, until I get the time to write more extensive documentation
|
24
25
|
|
25
26
|
== Copyright
|
26
27
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/examples/test.rb
CHANGED
@@ -2,7 +2,10 @@ require './../lib/vistarpc4r/rpc_response'
|
|
2
2
|
require './../lib/vistarpc4r/vista_rpc'
|
3
3
|
require './../lib/vistarpc4r/rpc_broker_connection'
|
4
4
|
|
5
|
-
#
|
5
|
+
# Medsphere maintains a public demo OpenVistA server. It resets all of its content every night.
|
6
|
+
# Info here ---> https://medsphere.org/docs/DOC-1003
|
7
|
+
|
8
|
+
|
6
9
|
broker = VistaRPC4r::RPCBrokerConnection.new('openvista.medsphere.org', 9201, 'PU1234', 'PU1234!!')
|
7
10
|
|
8
11
|
broker.connect
|
@@ -48,7 +48,7 @@ module VistaRPC4r
|
|
48
48
|
def connect
|
49
49
|
retVal = true
|
50
50
|
if isConnected()
|
51
|
-
|
51
|
+
warn " already connected, closing first"
|
52
52
|
close
|
53
53
|
end
|
54
54
|
@socket = TCPSocket.open(@host, @port) # Connect
|
@@ -59,10 +59,10 @@ module VistaRPC4r
|
|
59
59
|
tcpConnect.params[2]= "OVID"
|
60
60
|
connectResponse = execute(tcpConnect)
|
61
61
|
if (connectResponse == nil || connectResponse.value == nil || connectResponse.value == "reject")
|
62
|
-
|
62
|
+
raise "Handshake error"
|
63
63
|
end
|
64
64
|
if (connectResponse.error_message != nil)
|
65
|
-
|
65
|
+
raise "RPC Error: " + connectResponse.error_message
|
66
66
|
end
|
67
67
|
@sentConnect = true
|
68
68
|
|
@@ -106,7 +106,7 @@ module VistaRPC4r
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
if (retVal == nil)
|
109
|
-
|
109
|
+
raise "Lost connection to server"
|
110
110
|
end
|
111
111
|
return retVal
|
112
112
|
end
|
@@ -154,11 +154,11 @@ module VistaRPC4r
|
|
154
154
|
|
155
155
|
def setContext(context)
|
156
156
|
if (context == @currentContext)
|
157
|
-
|
157
|
+
warn "context is already set to " + context + "..."
|
158
158
|
return
|
159
159
|
end
|
160
160
|
if (@currentContext != nil)
|
161
|
-
|
161
|
+
warn "changing context from " + currentContext + " to " + context
|
162
162
|
end
|
163
163
|
|
164
164
|
puts "Setting context to: " + context
|
@@ -167,7 +167,7 @@ module VistaRPC4r
|
|
167
167
|
xwbCreateContext.params[0] = encryptedContext
|
168
168
|
response = execute(xwbCreateContext)
|
169
169
|
if (response == nil || response.error_message != nil)
|
170
|
-
|
170
|
+
raise "XWB CREATE CONTEXT failed: " + response.error_message
|
171
171
|
end
|
172
172
|
@currentContext = context
|
173
173
|
end
|
@@ -184,7 +184,7 @@ module VistaRPC4r
|
|
184
184
|
def signOn()
|
185
185
|
signonResponse = execute(VistaRPC.new("XUS SIGNON SETUP", RPCResponse::ARRAY))
|
186
186
|
if (signonResponse == nil || signonResponse.error_message != nil)
|
187
|
-
|
187
|
+
raise "XUS SIGNON SETUP failed"
|
188
188
|
end
|
189
189
|
@signedOn = true
|
190
190
|
end
|
@@ -217,7 +217,8 @@ module VistaRPC4r
|
|
217
217
|
end
|
218
218
|
if (hasErrors)
|
219
219
|
brokerInfo = extractBrokerErrorInfo(response)
|
220
|
-
|
220
|
+
warn("Access denied: " + brokerInfo)
|
221
|
+
return false
|
221
222
|
else
|
222
223
|
@duz = answer[0]
|
223
224
|
end
|
data/vistarpc4r.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{vistarpc4r}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mike Cham"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-22}
|
13
13
|
s.description = %q{more}
|
14
14
|
s.email = %q{mike@blenderhouse.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vistarpc4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mike Cham
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-22 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|