TableLookup(parm1,[parm2],[parm3])

PreviousNext

How to use the TableLookup() Macro

(c) 2007-2008 Hermetech International Ltd.

TableLookup() Example PID 16.1 (Marital Status)

 

Use the TableLookup() macro to dynamically replace a component value based on it's content. When processed it will take the value in an HL7 field component (in the screenshot above PID 16.1 'Marital Status') look up that code value in an HL7 Table. If found it will replace a component value with table value.

 

Parameters - The TableLookup() macro requires 1 parameter but can take up to 3 parameters separated by a comma. They are:

 

1. HL7 Table ID (Numeric, Required). Identifies which HL7 table to use (example: 2 is the HL7 table for Marital Status) see below for more information.
2. "Not Found" Value (String, Optional). If passed it tells the FSPM which value to use if the component value passed is "Not Found" in the HL7 Table. This parameter can also be Blank() for example - 2,Blank() which would cause the FSPM to erase the component value if not found in the table. If the parameter is NOT passed or is empty (example 2 or 2,,3) the FSPM will leave the component value unchanged if it is not found in the HL7 Table.
3. Field Component To Replace (Numeric, Optional). If passed it tells the FSPM which field component to replace with the table Value or "Not Found" value. If omitted the macro will act on the HL7 field component selected (PID 16.1 in the example above).

 

In the example above (2,Unknown,2) the FSPM is instructed to look up the value it finds in PID field 16.1 in HL7 Table #2 (Marital Status) and if found replace PID field 16.2 with the table value, if NOT found replace PID field 16.2 with "Unknown".

 

What are HL7 Tables? HL7 Tables are embedded in the EasyHL7 Vendor definition (Default 2.3). Each table is identified by a number (parameter 1) and has 2 fields (Code and Value). You can edit the HL7 Tables OR create new ones by clicking 'View / Edit HL7 Tables' in the 'Tools' menu.

 

EasyHL7 Table Editor