iNTERFACEWARE Products Manual > Installing and Using Chameleon > Sample Applications > C# Client-Server Application > Step 5 - Writing C# Code to Process Messages |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
To write code for your application that parses and then generates HL7 messages, you first need to know what classes are created when you use your Chameleon VMD file to generate C# 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 C# code for the sample application. Recall that the sample application contains:
The following C# code example implements HL7 message processing in this sample application:
Here, the SampleCsharpClientServerEngine class inherits the methods of the HL7Engine class that was created by Chameleon. This application uses the following methods defined for this class:
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. This method is called from within OnPatientRegisterMessage, which means that an output message is generated every time an input message is parsed. Here is how the application works:
Here is how the next of kin data tables are loaded 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. |