Versions Compared

Key

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

...

Expand
titleImport a custom version of the file reader from git@bitbucket.org:interfaceware/file_tutorial.git

Create component from Git URL - leave the component as Editable

Copy paste the URL from here:

Code Block
git@bitbucket.org:interfaceware/file_tutorial.git

This component generates some test files to make it easier to learn how to do a file reader.

Expand
titleCustomize itOpen the component in the translator with the customize link

See Customizing components to see how done if you have not done this before.

Expand
titleBuild a custom configuration

See Custom Fields - We can add Client ID List which will be a comma delimited list of the prefixes we want to filter on:

Expand
titleGenerate some test files

We need to first generate test files to work with.

In the File Reader main.lua, use the function MakeTestData()

Image Removed

It’s a good idea to re comment the code afterwards so it doesn’t keep generating test files in production!

Concepts used:

  • Commenting out code

  • iguana.isTest()
    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

    ...