The HL7 Mapper handler maps one or many data elements’ value to a new value as defined in the mapping rules for HL7 records from an input container, and packages the records with new mapped values into an output container, and pass it to each of the child-nodes. A mapping rule has the following format:
<Foldda expression><mapping operator><mapping definition>
- Foldda expression – used for identifying data-elements for filtering qualification.
- mapping operator – as ‘?=’
- mapping definition – defines the mapping either in in-line format, or in a mapping file.
Note the Foldda expression may identify multiple data elements in an HL7 message that need to be examed for qualification. In this case, all qualified data elements’ value will be mapped by the rule.
Also, note multiple mapping rules can be defined for mapping multiple data elements in a message at the same time.
The function takes 1 parameter which specifies the type of identifier (see above) is to be produced by this function.
|filtering-rule||e.g. PID-15?=([email protected])||Use the mapping as defined in file ‘pid-15-lang.txt’ to apply to the PID-15 data element of an HL7 message.|
In the HL7Mapper handler’s config in this example, the first mapping rule maps the input value in PID-15 according to mapping file named ‘pid-15-lang.txt’; the second rule maps the sex value in PID-8 from ‘M’ to ‘Male’, ‘F’ to ‘Female’ and anything else to ‘Unknown’, for all messages that has EVN-1 equals ‘A01’.
<Handler>HL7Mapper</Handler> <Parameters> <Parameter> <Name>mapping-rule</Name> <Value>PID-15?=([email protected])</Value> <!-- mapping file example --> </Parameter> <Parameter> <Name>mapping-rule</Name> <Value>EVN-1==A08~PID-8?=(F;Female)(M;Male)(*;Unknown)</Value> <!-- "inline" example --> </Parameter> </Parameters>
The HL7DataTransformer and the TabularDataTransformer are specifically designed for multi-steps, more sophisticated data transformation, using Foldda Expression and Foldda Functions.