The following sample filtering rules are intended to be a base for you to adapt to your own requirements.
The filter.filterMessage()
function does the following:
It filters out messages that match specified conditions
It logs a meaningful error in each case. Detailed logging is invaluable!
It returns true
if a message should be filtered (false
if it is ok to continue processing)
-- This module contains sample filtering rules.
-- Use your own filter conditions and error messages.
local filter ={}
function filter.filterMessage(msgIn, name)
if name ~= 'ADTA01' then
iguana.logError('Unexpected message type.')
return true
elseif msgIn.MSH[3][1]:nodeValue():lower() == 'interfaceware' then
iguana.logError('Rejecting test message from iNTERFACEWARE.')
return true
elseif msgIn.PID[5][1][1]:nodeValue():lower() == 'addams' then
iguana.logError('No thing shall lurch or fester here!')
return true
end
return false
end
return filter