iNTERFACEWARE Products Manual > Installing and Using Chameleon > Language API Documentation > Borland Delphi Support > The Engine Component |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
If you are using the static interface with Chameleon, a custom engine object is automatically generated and placed into your application by Chameleon. This custom component will inherit from the TCHMcustomEngine component defined in the CHM unit. The component has a user defined event for each message defined in the message definition file. As a developer, you will need to write the event code to handle the business logic for each component. This screen shot shows a typical generated engine component's events: To use an engine component, you must ensure that your application loads the message definition file used by the engine component during initialization. The following code fragment shows how you can load the message definition file during initialization:
You can parse any arbitrary message using the Engine object independently of our communication framework by invoking the ParseMessage procedure:
The second argument to the ParseMessage method is the legacy 'TransportIndex'. This was an index that was intended to be unique to each HL7 client to provide a means of determining the origin of each message. The new TCP/IP socket class used by Chameleon does not require the use of 'TransportIndex'. Hence, a dummy value of '0' is typically used. As a programmer, you must provide the event code for each message defined in the message definition file. This is a typical example of how you might choose to implement a message event:
Each of these message events has three parameters:
The message object is a generated class which has methods for retrieving the tables that make up each message. Each table object has methods to get and set the column values in the table. These classes are described in the next section. |