RPC HELP Silent Login Handling Divisions

From VistApedia
Jump to: navigation, search

RPC Broker Help Home

Handling Divisions During Silent Login

A login may be successful, but if the user has multiple divisions from which to choose and fails to select one, the connection is terminated and a failed login message is generated. This becomes a potential problem in that a Silent Login may have problems, if the user has multiple divisions from which to choose and the PromptDivision property is not set to True.

If the application wishes to handle the user specification of the division, it may attempt to set the TRPCBroker component Connected property to True. If upon return, the Connected property is still False, it can check the Login.MultiDivision property. If the MultiDivision property is True, the user has multiple divisions from which to choose. The application will find the possible values for selection in the Login.DivList property (i.e., Tstrings). The values that are present in the DivList property will be similar to the following example:

   3
   1^SAN FRANCISCO^66235
   2^NEW YORK^630
   3^SAN DIEGO^664^1

The first (index = 0) entry is the total number of divisions that can be selected (e.g., 3 in this example). This is followed by the different divisions comprised of the following pieces:

  • The second ^-piece of each entry is the name.
  • The third ^-piece of each entry is the number associated with the division.
  • The fourth ^-piece with the value of 1, if present in one of the entries, is the default division for the user.

The safest value to set as the Login.Division property might be the third ^-piece of the selected division.

If the desired division is known ahead of time, it can be set into the Login.Division property for the TRPCBrokercomponent prior to attempting the connection.