HAPI Conformance Classes Demo Application

 

Author: James Agnew ( jait214@yahoo.ca ), Algonquin College

Date: 27-May-2003

 

Introduction:

This application is a small example of the use of the Conformance Class Set Generation System combined with the HL7 API (HAPI) to generate HL7 messages. It is not intended to be a complete, fully functional, or well thought out design; it is only to illustrate the ease of programming using this system.

 

Requirements:

In order for the demo to succeed, the following system requirements must be met.

 

Installation instructions:

  1. Download the demo
  2. Unpack the demo archive into a directory. Open a console window (or DOS shell) in the base directory into which the archive was extracted. Add the demo directory.

 

$ mkdir /home/james/demo

$ unzip ccsgs_demo.zip /home/james/demo

cd /home/james/demo

export CLASSPATH="$CLASSPATH:/home/james/demo"

 

  1. Activate the conformance class set generation system to build the Conformance Classes:

 

$ java ca.uhn.hl7v2.conf.classes.generator.builders.ConfGen -v adt_a01_profile.xml build demo

 

This command instructs the C.C.S.G.S. to generate a set of conformance classes corresponding to the adt_a01_profile.xml file.

The "-v" flag instructs the system to display progress information as it works.

The "build" argument instructs the system to create all output in a path named ".\build\".

The "demo" argument instructs the system to create all classes in a package named "demo".

 

  1. Call ANT to generate a JAR containing the resulting conformance classes. Add the resulting jar (which will be placed in build/dist) to the classpath.

 

$ ant

$ export CLASSPATH="$CLASSPATH:/home/james/demo/build/dist/demo.jar"

 

  1. Compile and execute the demo application.

 

$ cd app

$ javac DemoView.java

$ java DemoView

 

Using the demo:

The demo presents several text boxes. These test boxes represent the areas into which data is entered. Note that you must press enter in the text box to store the data. This signals to the application that you wish to store the data in a message.

 

When you have entered any data you wish to store, you may click on the "Generate Message" button to generate an HL7 message in XML format.