Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleBuild a custom configuration

See Custom Fields. We take the base File Reader and add Client ID List which will be a comma delimited list of the prefixes we want to filter on:

Expand
titleWe need to modify the matching algorithm - what do we start with?

The original file reader component is deliberately simple and uses /wiki/spaces/IXB/pages/3181903910 to make it more obvious how to modify the code to meet new needs. So this is what we are starting off with. We need this function to return true when the matching criteria are met.

https://bitbucket.org/interfaceware/fromfile/src/main/MatchRules.lua

Code Block
--What file extensions do we match?
local FileExtensionMatchSet={
   txt=true,
   log=true,
   hl7=true
}

function MatchFile(FileName)
   --local JustFileName = FILfilename(FileName)
   local Extn = FILextension(FileName)
   Extn = Extn:lower()
   return FileExtensionMatchSet[Extn]
end

...

Expand
titleMake a function which takes the ID and sees if the filename starts with it

So now we make a function to determine if the file name matches

Code Block
function APPmatchPrefix(Prefix, FileName)
   local Part = FileName:sub(1, #Prefix)
   trace(Part, Prefix)
   return (Part == IdPrefix)
end

Concepts used:

...