Creating a VMD
VMD files give an easy way to read HL7 and X12 files in a manner that can be understood by humans.
Follow these steps below to learn how this is done:
STEP 1: Create an editable Custom component and enter the translator.
You probably have done this a million times now. Create a Component - I believe in you ......
STEP 2: Create a new test.vmd file.
-
Choose Create File from the 3 dots beside the folder.
![]()
-
Name the file test and choose .vmd from the drop down arrow. Click CREATE to add the file.
![]()
STEP 3: Edit the test.vmd file to import an ADTA01 message from HL7 2.4.
-
Click the ellipsis as shown below, and click IMPORT:
![]()
-
Choose HL7 v2.4 and select ADTA01 and click Import.
![]()
Iguana will automatically create a Matching Rule based on the imported definition. You can edit the matching rules as needed. The order of the matching rules matters! Iguana will check incoming messages against the matching rule list in order, the first match is applied. For example, see Creating a Catchall Matching Rule.
STEP 4: Add a sample ADT^A01 message to sample data.
-
Copy this ADT A01 message below to match what we imported into our test.vmd file:
MSH|^~\&|MESA_ADT|XYZ_ADMITTING|iFW|ZYX_HOSPITAL|||ADT^A01|103102|P|2.4||||||||
EVN||200007010800||||200007010800
PID|||583295^^^ADT1||DOE^JANE||19610615|M-||2106-3|123 MAIN STREET^^GREENSBORO^NC^27401-1020|GL|(919)379-1212|(919)271-3434~(919)277-3114||S||PATID12345001^2^M10|123456789|9-87654^NC
NK1|1|BATES^RONALD^L|SPO|||||20011105
PV1||E||||||5101^NELL^FREDERICK^P^^DR|||||||||||V1295^^^ADT1|||||||||||||||||||||||||200007010800||||||||
PV2|||^ABDOMINAL PAIN
OBX|1|HD|SR Instance UID||1.123456.2.2000.31.2.1||||||F||||||
AL1|1||^PENICILLIN||PRODUCES HIVES~RASH
AL1|2||^CAT DANDER
DG1|001|I9|1550|MAL NEO LIVER, PRIMARY|19880501103005|F||
PR1|2234|M11|111^CODE151|COMMON PROCEDURES|198809081123
ROL|45^RECORDER^ROLE MASTER LIST|AD|CP|KATE^SMITH^ELLEN|199505011201
GT1|1122|1519|BILL^GATES^A
IN1|001|A357|1234|BCMD|||||132987
IN2|ID1551001|SSN12345678
-
Click Add Sample Data button in the translator:
![]()
-
Paste the message, then give the sample data a name and click ADD:
![]()
-
It will create a new Samples folder with your sample message inside:
![]()
STEP 6: Add the line: local message = hl7.parse{vmd='test.vmd', data=Data}
In your main.lua file the main function will look like this:
function main(Data)
local message = hl7.parse{vmd='test.vmd', data=Data}
trace(message)
end
-
Now that the sample data is imported correctly, we can map it to the .vmd file we have created.
-
Using hl7.parse we will trace the message to view it:
![]()