This section describes the necessary programming tasks a business system supplier must complete in order to be able to create a business system which successfully embeds the Noah 4 Business API.
These tasks include:
o Setting the user
o Setting the patient
o Setting the language id
o Cross threading issue
Launching/Connecting to and disconnecting from a NOAH 2/3 module.
o Noah 4 exceptions
IMPORTANT: The code in these examples consists of extracts from the sample business system made by HIMSA. This means that the code is for illustration purposes only, and cannot be used directly as written in the developers business system implementation. The full sample code for this business system is available on Noah 4 Business System Development page on himsa.com.
Initializing the Business API
In order to get started, the Business API assembly dll must be installed on the development PC. This dll comes with the Noah 4 installation.
The first step is to reference the dll in your development environment. If you are using Visual Studio 2010 this is done by opening your References folder, selecting the popup menu Add, and browsing to BusinessAPI.dll. This Dll will give a number of classes/objects which re-sample the object model and which the developer can use in the development of the business system. The figure below shows the Object browser in VS2010, which gives an overview for the Business API referenced.
Figure: Object browser in VS2010
The first step in order to use the BusinessAPI is to Register BusinessAPI instance with Noah before it tries to connect. Noah Apps will only be allowed to connect to Noah if they are set as the preferred apps of any of Noah AppType as part of registration. Therefore, we register BusinessAPI instance as preferred app.
Below is a sample Register class that contains Install() and Uninstall methods that register and unregister app towards Noah.
Note: The business system developers should call these methods appropriately.
The second step in order to use the Business API is to declare a variable of the type BusinessAPI and then initiate the object declared. The properties available are then initiated when the method Initialize(); on the Business API object is called. During this initialize a connection is made to the Noah Client service, by the use of .NET remoting.
The sample below shows the initialize sequence made for the sample business system.
The patient is set by calling the method SetCurrentPatientID. This method is located on the Business API object.
The patientId is an integer greater than 0. If the id is set to 0 or less, Noah Client will deactivate the current patient and no patient will be active in Noah. When the patient ID is set it will be possible to get the session data related to the given patient from the CurrentPatient property on the BusinessAPI object.