Partial String Match for Table Lookup input

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Partial String Match for Table Lookup input

  • Creator
    Topic
  • #49662
    Bill Pitts
    Participant

      Hello,

      I’m having a problem with a lab results interface where I need to match micro-organism names and translate to a coded value.

      I’ve built a lookup table to account for the micro-organism names and corresponding output codes.

      My problem is that the OBX5 result text doesn’t pass the exact micro-organism name as the OBX5 value; the micro-organism name can  be embedded with the OBX5 text

      *******************************************

      Example:    Input Table:  BACILLUS ANTHRACIS

                       Output Table:  BACANT

      Trnx #1:

      OBX5:  |2+ BACILLUS ANTHRACIS|

      Trnx #2:

      OBX5 |PRESUMPTIVE BACILLUS ANTHRACIS|

      Trnx #3:

      OBX5  |>100,000 C/F BACILLUS ANTHRACIS|

      *****************************************

      In all these examples the output should be BACANT.

      I’m having difficulty in matching the substring against the table.

      NOTE: we also have multiple tables for translations of different organisms to account for a significant exception rules.

      Thanks

      Bill

    Viewing 2 reply threads
    • Author
      Replies
      • #63018
        Robert Milfajt
        Participant

          Wow!   😯

          Short of looping through every potential micro-organism name and regexping against OBX5 for a match, I am at a loss.

          Even if the method I described works, the overhead of checking thousands of micro-organisms against tens (or even hundreds) of thousands of OBXs is mind boggling.

          Robert Milfajt
          Northwestern Medicine
          Chicago, IL

        • #63019
          Dennis Pfeifer
          Participant

            any chance you can get your lab to use a separator ..

            e.g.

            Trnx #1:

            OBX5:  |2+  – BACILLUS ANTHRACIS|

            Trnx #2:

            OBX5 |PRESUMPTIVE – BACILLUS ANTHRACIS|

            Trnx #3:

            OBX5  |>100,000 C/F – BACILLUS ANTHRACIS|

            or perhaps a tilde

            Trnx #1:

            OBX5:  |2+ ~BACILLUS ANTHRACIS|

            Trnx #2:

            OBX5 |PRESUMPTIVE ~BACILLUS ANTHRACIS|

            Trnx #3:

            OBX5  |>100,000 C/F ~BACILLUS ANTHRACIS|

            you could then split and go from there ….

            Dennis

          • #63020
            Bill Pitts
            Participant

              Hi

              We can’t have the lab change the format of the source data as lab results are interfaced to multiple applications in PROD.

              We’re looking into an approach along the lines of what Robert suggested.

              I’m reading in data from a separate source file and comparing it with the text string in the OBX.5 ;  I’m currently having a problem with the regexp but am attempting to work through it.

              We have <100 micro organisms we need to compare so it should be manageable.

              Bill

          Viewing 2 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.