Difference between revisions of "VistA RPC"
DavidWhitten (talk | contribs) |
DavidWhitten (talk | contribs) |
||
Line 62: | Line 62: | ||
no idea. | no idea. | ||
+ | |||
+ | |||
+ | == M2M Broker Implementation == |
Revision as of 17:11, 21 June 2007
VistA RPC is a VA developed protocol that allows for remote procedure calls against VistA. Most famously, CPRS uses the RPC mechanism as its primary communication method.
Contents
Protocol Definition
The protocol definition is still to be found in detail, but the RPC Standard Header and Message Parameters are documented at: broker msg specs.doc
Delphi Implemetation
The Delphi Components and Published Property and Methods are documented at:
CPRS is written in delphi and relies on a delphi library to make VistA RPC calls. This library is documented in RPC BROKER: Getting Started with the Broker Development Kit (BDK) which you can download from the VA.
Return types
There five different values that can be returned by a VistA RPC call.
- Single Value : a single value is returned
- Array : a small array of values is returned
- Word Processing : a stream text with carriage returns is returned
- Global Array: This type is useful for returning large amounts of data to the client, where using the ARRAY type can exceed the symbol table limit and crash your RPC.
- Global Instance: Set the return parameter to a closed global reference.
Obviously the last two are special cases that are very specific to MUMPS.
Calling methods
In order to call an RPC, you must give it arguments or parameters which live in a "Params" object. From the manual:
RPCBroker1.Param[0].Value := '10/31/97'; RPCBroker1.Param[0].PType := literal; RPCBroker1.Param[1].Mult['"NAME"'] := 'SMITH, JOHN'; RPCBroker1.Param[1].Mult['"SSN"'] := '123-45-6789'; RPCBroker1.Param[1].PType := list;
This shows how to pass a single variable, or an array.
Then set the RPC to execute
RPCBroker1.RemoteProcedure:='A6A LIST';
Then send it...
try RPCBroker1.Call; except On EBrokerError do ShowMessage('A problem was encountered communicating with the server.'); end;
You should get back the results in the Results property like so??
RPCBroker1.Results[0].Value
not sure how multiple values are stored...
JavaLink Implementation
no idea.