HL7 Filter

Used in a data-processing flow for selectively sending input data down to the children nodes.


The HL7 Filter handler uses one or many defined filtering rules for selecting qualified HL7 records from an input container, and packages selected records into an output container, and pass it to each of the child-nodes. A filter rule has the following format:

<Foldda expression><qualification operator><regular expression>

  • Foldda expression – used for identifying data-elements for filtering qualification.
  • qualification operator – as ‘==’ for including qualified records, or as ‘!=’ for excluding qualified records.
  • regular expression – defines the pattern-matching condition for the filtering qualification.

Note the Foldda expression may identify multiple data elements in an HL7 message that need to be examed for qualification. In this case, anyone data element qualifies the defined filtering rule(s) will result in the whole message being qualified for the filtering.

Also note if multiple filtering rules are defined, they form an ‘OR’ logical relationship, meaning any filter rule qualifies will result in the record being qualified and selected.


The function takes 1 parameter which specifies the type of identifier (see above) is to be produced by this function.

filtering-rulee.g. MSH-9.2 == A01|A02|A03Filter includes the record if MSH-9.2’s value is ‘A01’ or ‘A02’ or ‘A03’.

Config Example

The following config has two filtering rule entries. A HL7Filter handler with such config will filter all input records, and let through 1) records with event type ‘A01’, ‘A02’, or ‘A03’ OR 2) records with patient’s sex is ‘M’ and from the address with zip code ‘60302’.

      <!-- filter these message types -->
    - additional filter rules (as "OR" condition to the other filters)
    - eg. below filters for " ... or gender=M and zip-code=60302"

See Also