Skip to main content

How to Share Common Non-Lua Files

We'll use a Visual Message Definition file (VMD) for this example, the type of file does not matter. There are two good ways to do this but first simply place it in a shared folder like your IguanaX working directory e.g., <Some Path>/.Iguana/MyFavouriteVMD.vmd

Component Configurations

For the first method go to your component, add a VMD path configuration like so:

Then go to your component card and add the path as needed:

Then to access your desired configurations (like the VMD Path) you can use this snippet of code:

   local Configs = component.fields() -- Create a key-value table for configurations   
trace(Configs)

hl7.parse{vmd=Configs["VMD Path"], data=Message}

Environmental Variables

The second method would be to use environmental variables to set the path for the VMD. This way you wouldn't have to set the VMD every time, rather the code points towards a pre-set variable.

Then use this snippet of code to access it and parse the message with it:

   local VMDpath = os.getenv("VMDpath")   
trace(VMDpath)

hl7.parse{vmd=VMDpath, data=Message}