iNTERFACEWARE Products Manual > Installing and Using Chameleon > Sample Applications > VB.NET Client Application > Step 5 - Writing VB.NET Code to Generate Messages |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
To write code for your application that generates HL7 messages, you first need to know what classes are created when you use your Chameleon VMD file to generate VB.NET stubcode for your application.
In this example, the following classes have been created:
Now that you have this information, you are ready to write the VB.NET code for the sample application. Recall that the sample application contains:
The following VB.NET code example implements HL7 message generation in this sample application:
Here, the SampleVbnetClientEngine class inherits the methods of the HL7Engine class that was created by Chameleon. This application uses the Load method, which initializes the generation engine to use the VMD file you created. This method is called when the SampleVbnetClientEngine object is created. To generate the message, the application uses GenerateMessage, which is a method defined for the PatientRegisterMessage class that generates an HL7 message based on the information in the VMD file. Here is how the application works:
Here is how GenerateButton_Click loads the data tables with the information that is used to generate the message:
Now that you have written your application code, the final step is to test the application. |