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]
- 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. - Close the Chameleon welcome screen.
- Create an empty VMD by clicking the New button on the toolbar:
- Create the ADT message.
- Click Message on the toolbar to create a message:
- Change the message name to ADT.
Click twice (slowly) on the name to edit it and type “ADT”:
- Double click the Identity and enter “ADT Event” in the Description:
- Click Message on the toolbar to create a message:
- Add the patient table to match the example/demo.vmd.
Note: To add custom tables simply create tables that match your requirements.
- Click Table on the toolbar to create a table:
- Change the table name to patient.
Click twice (slowly) on the name to edit it and type “patient”:
- Double click the renamed patient table to edit it.
- Enter “Patient Table” in the Description field:
- 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:
- 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
- When you have finished the table will look like this:
- Click Table on the toolbar to create a table:
- Add the remaining two tables to match the example/demo.vmd.
Note: To add custom tables simply create tables that match your requirements.- Create the kin table, no key column, all columns are String.
- Description: “Next of kin”
- PatientId
- LastName
- FirstName
- Relationship
- Create the visitinformation table, no key column, all columns are String.
- Description: “Visit Table”
- PatientClass
- AdmitType
- AdmitSource
- HospitalService
- PatientType
- When you have finished the tables will look like this:
- Create the kin table, no key column, all columns are String.
- Add the Tables to the new message definition.
- Edit the ADT Message Grammar by double clicking on it:
This will open the message grammar dialog:
- 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.
- Ignore the “grammar root not set” warning as this is a legacy setting that is not required when using VMD files with Iguana:
- Edit the ADT Message Grammar by double clicking on it:
- Compare the new table grammar to example/demo.vmd.
Note: When using your own tables check that they match your requirements.- 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:
- Comparing the two table grammars shows they are the same:
- Compare the table definitions.
- Double click the patient tables and compare definitions:
- Compare the other tables the same way.
- Double click the patient tables and compare definitions:
- Open the supplied demo.vmd (<install dir>\edit\admin\other\example§demo.vmd) in Chameleon.
- 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. - Save your new VMD file as demo_tables.vmd.
- Test the demo_tables.vmd file in a project.
- 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:
- Add demo_message.vmd to the project, using the [Add…] link:
- Duplicate the
db.tables{}
statement using demo_tables.vmd:
- Compare both
Out
table node trees as you can see they are identical:
- Open a basic channel that uses the example/demo.vmd.
More Information [top]
- See the other Chameleon tutorials in the general tutorials section
- Best practices for using VMD files
- Using multiple VMD files to map to different databases
- See our interface tutorials section
- See our general tutorials section
- See our code samples section