This is Bapi32 (v71). It is backwards compatible with earlier versions of Bapi32.dll, except for removal of the Shared Broker component in patch XWB*1.1*60. The TXWBSSOiToken class is new in v65: TXWBSSOiToken property MySsoToken: String (this is the STS SAML token used for authentication) The TRPCBroker class added some additional properties in v17: TRPCBroker property AccessVerifyCodes: TAccessVerifyCodes property Param: TParams property Socket: integer property RPCTimeLimit : integer property CurrentContext: String property User: TVistaUser property OnRPCBFailure: TOnRPCBFailure (still working on for DLL) property RPCBError: String property OnPulseError: TOnPulseError (still working on for DLL) property ClearParameters: boolean property ClearResults: boolean property Connected: boolean property DebugMode: boolean default False; property ListenerPort: integer property Results: TStrings property RemoteProcedure: TRemoteProc property RpcVersion: TRpcVersion property Server: TServer property KernelLogIn: Boolean property ShowErrorMsgs: TShowErrorMsgs default semRaise; property LogIn: TVistaLogIn Two of these properties reference new classes. The Login property references the TVistALogin class which contains information used primarily for silent logins. TVistaLogin property LogInHandle: String //for use by a 2ndary DHCP login OR ESSO login property DivList: TStrings read-only property MultiDivision: Boolean property DUZ: string property ErrorText: string property AccessCode: String property VerifyCode: String property Mode: TLoginMode (0 = lmAVCodes, 1 = lmAppHandle, 2 = lmNTToken) property Division: String property PromptDivision: boolean The User property references the TVistAUser class that provides information about the current user provided by the VistA Server. While writing to these properties is not prohibited, it would be of little value, since no changes are reported back to the VistA server. TVistaUser property DUZ: String property Name: String property StandardName: String property Division: String property VerifyCodeChngd: Boolean property Title: string property ServiceSection: string property Language: string property DTime: string Declare Function RpcbCreate Lib "bapi32.dll" _ () As Long This function returns a Long identifier for the instance of RPCBroker created. This is the value indicated as intRpcbHandle in the other methods supported by the DLL. Declare Sub RpcbFree Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long) This procedure is used to release the instance of the RPCBroker created by the RpcbCreate function. It should be Freed prior to exiting the application. Declare Sub RpcbCall Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strCallResult As String) This procedure or function performs the actual Call after it has been set up by setting context (createcontext), remote procedure, and data (if any). Data returned by the call will be in the Results property obtained via RpcbPropGet. Declare Function RpcbCreateContext Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strContext As String) As Integer This function is used to create the context under which the Remote Procedures will be called. The return value is a 1 (one) if the Context was created correctly, otherwise a vaue of 0 (zero). Declare Sub RpcbMultItemGet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParIdx As Integer, _ ByVal strSubscript As String, _ ByVal strValue As String) Declare Sub RpcbMultPropGet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParIdx As Integer, _ ByVal strProp As String, _ ByRef strValue As String) Declare Sub RpcbMultSet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParIdx As Integer, _ ByVal strSubscript As String, _ ByVal strValue As String) Declare Sub RpcbMultSortedSet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParIdx As Integer, _ ByVal intValue As Integer) Declare Sub RpcbParamGet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParIdx As Integer, _ ByVal intParTyp As Integer, _ ByVal intParVal As String) Declare Sub RpcbParamSet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParIdx As Integer, _ ByVal intParTyp As Integer, _ ByVal intParVal As String) Declare Sub RpcbPropGet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strProp As String, _ ByVal strValue As String) This procedure is used to access property values of the RPCBroker instance itself. Properties which can be accessed (and their names supplied as the value of strProp) are (for this and other property references, the case of the names as entered in the procedure call as strProp are not important, they will be converted to an appropriate case before they are used to identify the desired property): CLEARPARAMETERS CLEARRESULTS CONNECTED CURRENTCONTEXT DEBUGMODE KERNELLOGIN LISTENERPORT REMOTEPROCEDURE RPCBERROR RPCTIMELIMIT RPCVERSION RESULTS SERVER SHOWERRORMSGS; semRaise: intval := 0; semQuiet: intval := 1; SOCKET Declare Sub RpcbPropSet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strProp As String, _ ByVal strValue As String) This method is used to set property values for the RPCBroker instance. Values that can be set (by specifying their name as strProp and the value as strValue) are: ACCESSVERIFYCODES CLEARPARAMETERS CLEARRESULTS CONNECTED DEBUGMODE KERNELLOGIN LISTENERPORT REMOTEPROCEDURE RPCTIMELIMIT RPCVERSION SERVER SHOWERRORMSGS 0: semRaise; 1: semQuiet; Declare Sub RpcbLoginPropGet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strProp As String, _ ByVal strValue As String) This method is used to obtain values from the TVistaLogin class of the Login property for the TRPCBRoker. These properties are related to silent logins. LOGINHANDLE NTTOKEN ACCESSCODE VERIFYCODE MODE DIVISION DIVLIST MULTIDIVISION DUZ ERRORTEXT PROMPTDIVISION Declare Sub RpcbLoginPropSet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strProp As String, _ ByVal strValue As String) This method is used to set data into the Login instance of the TRPCBroker instance, the properties which can be set are: LOGINHANDLE NTTOKEN ACCESSCODE VERIFYCODE MODE DIVISION MULTIDIVISION DUZ ERRORTEXT PROMPTDIVISION Declare Sub RpcbUserPropGet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strProp As String, _ ByVal strValue As String) This method is used to access property values for the User instance of the RPCBroker instance. DUZd NAME STANDARDNAME DIVISION VERIFYCODECHNGD TITLE SERVICESECTION LANGUAGE DTIME Declare Sub RpcbUserPropSet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal strProp As String, _ ByVal strValue As String) While this method can be used to set values into the properties of the User instance of the RPCBroker instance, since they are not communicated to the VistA server, it would not really matter. ---------------------------------------------------------------------------- The following methods provide additional functionality for handling and accessing data in the Param property of the RPCBroker instance. Declare Sub RpcbMultOrder Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParamIndex As Long, _ ByVal strStartSubscript As String, _ ByVal intDirection As Long, _ ByVal strResult As String) Returns the subscript string of the next or previous element from the StartSubscript. This is very similar to the $O function available in M. Null string ('') is returned when reaching beyong the first or last element, or when list is empty. A value of intDirection greater than zero will move in a positive direction while a value of intDirection less than zero will move backwards in the list. A value of zero won't cause anything at all (unless strStartSubscript is an empty string). Note: A major difference between the M $O and this function is that in this function StartSubscript must identify a valid subscript in the list. Declare Sub RpcbMultSubscript Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParamIndex As Long, _ ByVal intPosition As Long, _ ByVal strResult As String) Returns the string subscript of the element whose position in the list is passed in. Opposite of RpcbMultPosition. Remember that the list is 0 based! Declare Sub RpcbMultPosition Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal intParamIndex As Long, _ ByVal strSubscript As String, _ ByVal intResult As Long) Returns the long integer value which is the index position of the element in the list. Opposite of TMult.Subscript(). Remember that the list is 0 based! -------------------------------------------------------------------------- The following methods provide access to libary methods available in TRPCBroker code. Declare Function RpcbSilentLogin Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long) As Boolean Setting the Connected property to True (1) with KernelLogin property set to false will result in a silent login. However, a silent login can be initiated with this method as well. However, the user must still set up the other properties of the Login instance that will be required for the login, e.g., AccessCode, VerifyCode, and Division if necessary. For a login using an AppHandle obtained from the server, you would have to set the AppHandle property, and the mode property to lmAppHandle (1) before making the call (an easier way in this case would probably be to use the RpcbCheckCmdLine method described below). Declare Sub RpcbGetUserInfo Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long) This method will update the data in the User instance of the RPCBroker instance. Declare Sub RpcbGetSessionInfo Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long) [Ignore - not fully supported within the RPCBroker] Declare Sub RpcbStartProgSLogin Lib "bapi32.dll" _ (ByVal strProgLine As String, _ ByVal intRpcbHandle As Long) This procedure can be used to start a second application and pass on the command line the data which would be needed to initiate a silent login using a LoginHandle value. It is assumed that the command line would be read using the CheckCmdLine procedure or one similar to it as the form for the new application was loaded. This procedure can also be used to start a non-RPCBroker application. If the value for ConnectedBroker is an Empty String, the application specified in ProgLine will be started and any command line included in ProgLine will be passed to the application. Declare Function RpcbCheckCmdLine Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long) As Boolean This procedure can be used to check whether the command line contains information on the broker settings and can setup for a Silent Login using the LoginHandle value passed from another application. This procedure would normally be called within the code associated with FormCreate event. It assumes the Server, ListenerPort, Division, and LoginHandle values (if present) are indicated by s=, p=, d=, and h=, respectively. The argument is a reference to the TRPCBroker instance to be used. Declare Sub RpcbOnRpcbFailureSet Lib "bapi32.dll" _ (ByVal intRpcbHandle As Long, _ ByVal lpErrorHandler As Long) [ Not currently supported in the DLL] Declare Sub RpcbGetServerInfo Lib "bapi32.dll" _ (ByVal strServer As String, _ ByVal strPort As String, _ ByVal intValue As Long) This procedure permits the user to choose from those server/listener port combinations listed in the registry of the current workstation (which can be entered using the ServerList utility). If there are none, it will show BrokerServer,9200 as the default value but the user may add a new pair (if a new pair is added, it is entered in the workstation registry only for the current user). Declare Sub RpcbPiece Lib "bapi32.dll" _ (ByVal strInputLine As String, _ ByVal strDelimiter As String, _ ByVal intPieceNum As Long, _ ByVal strResult As String) This procedure provides the M Piece functionality for a single piece. For an M statement such as RESULT=$PIECE("1^2^4^65^THIS TEXT","^",3) would be entered as Call RpcbPiece("1^2^4^65^THIS TEXT","^",3,strResult) and strResult would contain "4" Declare Sub RpcbTranslate Lib "bapi32.dll" _ (ByVal strPassedString As String, _ ByVal strIdentifier As String, _ ByVal strAssociator As String, _ ByVal strResult As String) This procedure provides the M $TRANSLATE functionality for converting characters. Declare Sub RpcbEncode Lib "bapi32.dll" _ (ByVal strNormalText As String, _ ByVal strResult As String) This procedure provides the functionality associated with the Encrypt function in the Hash.pas file of the TRPCBroker. The name used here is hoped to indicate that the data are encoded by this method, not encrypted. The second argument is the return value. Declare Sub RpcbDecode Lib "bapi32.dll" _ (ByVal strEncodedText As String, ByVal strResult As String) This procedure provides the functionality associated with the Decrypt function in the Hash.pas file of the TRpcBroker. The name was changed to indicate that the data that it operates on are encoded, not encrypted. The second argument is the return value.