Chameleon: Creating VMD Tables for an ADT message

In this tutorial you will learn how to create a VMD file containing database tables corresponding to an HL7 ADT message.

We will create a file that uses similar table structures to the demo.vmd files that are included supplied with Iguana. This way you have something to compare to, and you can try it in the basic tutorials.

To create a custom VMD file to match your HL7 message structure, just follow the same steps using your own table structure. Substitute your own message requirements in the steps that copy/compare the supplied message or demo.vmd.

Tutorial Instructions [top]

  1. Run Chameleon
    For example from the Windows 7 start menu:

    Note: Chameleon is a Windows only program that is bundled with the Iguana for Windows install.
  2. Close the Chameleon welcome screen.
  3. Create an empty VMD by clicking the New button on the toolbar:
  4. Create the ADT message.
    1. Click Message on the toolbar to create a message:
    2. Change the message name to ADT.
      Click twice (slowly) on the name to edit it and type “ADT”:
    3. Double click the Identity and enter “ADT Event” in the Description:
  5. Add the patient table to match the example/demo.vmd.
    Note: To add custom tables simply create tables that match your requirements.

    1. Click Table on the toolbar to create a table:
    2. Change the table name to patient.
      Click twice (slowly) on the name to edit it and type “patient”:
    3. Double click the renamed patient table to edit it.
    4. Enter “Patient Table” in the Description field:
    5. Add the Id Key column to the patient table.
      Click in the column field and replace “Column1” with “Id”:

      Then select the Key check box:
    6. Add the remaining columns.
      Note: All columns are String except for Dob which is Date Time.

      • LastName
      • GivenName
      • Race
      • PhoneHome
      • PhoneBusiness
      • Religion
      • MaritalStatus
      • Ssn
      • LicenseNumber
      • Dob (data type: Date Time)
      • Sex
      • Weight
    7. When you have finished the table will look like this:
  6. Add the remaining two tables to match the example/demo.vmd.
    Note: To add custom tables simply create tables that match your requirements.

    1. Create the kin table, no key column, all columns are String.
      • Description: “Next of kin”
      • PatientId
      • LastName
      • FirstName
      • Relationship
    2. Create the visitinformation table, no key column, all columns are String.
      • Description: “Visit Table”
      • PatientClass
      • AdmitType
      • AdmitSource
      • HospitalService
      • PatientType
    3. When you have finished the tables will look like this:
  7. Add the Tables to the new message definition.
    1. Edit the ADT Message Grammar by double clicking on it:

      This will open the message grammar dialog:
    2. Click and drag the Tables into the Table Grammar pane:

      The Table Grammar pane should now contain all three tables:

      Tip: You can re-order the tables using click and drag.

    3. Ignore the “grammar root not set” warning as this is a legacy setting that is not required when using VMD files with Iguana:
  8. Compare the new table grammar to example/demo.vmd.
    Note: When using your own tables check that they match your requirements.

    1. Open the supplied demo.vmd (<install dir>\edit\admin\other\example§demo.vmd) in Chameleon.
      Get the demo.vmd from the Translator project file pane:

      Then click OK to open it in Chameleon:
    2. Comparing the two table grammars shows they are the same:
    3. Compare the table definitions.
      1. Double click the patient tables and compare definitions:
      2. Compare the other tables the same way.
  9. The example/demo.vmd contains  extra segments that are not needed. Because it is best practice to keep our VMD as simple as possible we will not add any of these.
    Here you can see some of the extra (unused) segments:

    Note: Keeping the VMD as simple as possible (minimum number of messages, no unused segments) helps to reduce overheads and improve performance.
  10. Save your new VMD file as demo_tables.vmd.
  11.  Test the demo_tables.vmd file in a project.
    1. Open a basic channel that uses the example/demo.vmd.
      We used our “Mapping HL7 to Database” channel from the Mapping Messages: HL7 to Database tutorial:
    2. Add demo_message.vmd to the project, using the [Add…] link:
    3. Duplicate the db.tables{} statement using demo_tables.vmd:
    4. Compare both Out table node trees as you can see they are identical:

More Information [top]

Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.