Uploaded image for project: 'LIMS'
  1. LIMS
  2. LIMS-3222

Generic 2D CSV Results importer does not handle Results Options

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Background

      Same as encountered in Senaite tracker at Imported Results Appears as Numbers Only from Instrument

      Apart from numeric results, Bika makes provision for distinct ‘Result options’ where an Analysis can have limited number of outcomes, often in text. See Result Options in the manual

      For example, for and Analysis Covid Detection, the result can be Not Detected, Indeterminable or Detected. At the same time, each text option is associated with a numeric value for results to be compared with valid range specifications and users to be alerted of out-of-range results, e.g. when Covid was Detected

      The above Covid results option configuration could look like this

      |Result Value||Display Value|
      |-1|Not Detected|
      |0|Indeterminable|
      |1|Detected|
      

      The Issue

      Bika’s simple generic ‘2D’ results importer does not handle Analyses configured with results options correctly

      The Importer reads a simple 2d Table of Sample IDs and result per Analysis, e.g. for Covid it is real simple

      || ||Covid||
      |Swab20-001|-1|
      |Swab20-001|-1|
      |Swab20-002|0|
      |Swab20-003|-1|
      |Swab20-004|-1|
      |Swab20-005|1|
      |Swab20-006|-1|
      |Swab20-007|-1|
      

      1. Imported numeric Result values don’t display their texts

      In the above example, when these Analyses’ numeric Result values are imported, one expects it to be written to the Analysis’s numeric Results value on the DB. And when the Analysis is viewed, the text Display value corresponding to the numeric is shown, eventually on the sample’s PDF Certificate of Analysis (COA)

      I don’t know how it works in the code, but at the moment the numeric Results values are displayed and not the text Display value equivalent. It could be that the importer writes the value directly to the Analysis’ Display value. The numeric Results value should always remain hidden

      What should happen

      When the numeric Results values are imported for Analyses with results options configured, the value should be written to the numeric Results value placeholder for it, and its text Display value looked up and used in displays and on the COA

      E.g. if the value 1 is imported for the Covid analysis above, Detected should be the only visible value for it

      2. Display Value text does not import

      One could follow the other route and import the actual text Display Value, e.g Detected, Not Detected, but they are in most cases not available from the data source. An instrument say will often just produce -1, 0, or 1

      I tried to import texts regardless, and the Importer does not handle that at all. It reports that the file was read successfully, but also that it found the result empty. Per sample:

      <Sample ID> result for 'Covid': ''
      

      and further down, per sample, that Detected is not a valid number, which to me indicates that it expects a numeric and not text:

      [2] No valid number Detected in column (resultValue): <Sample ID>,Detected,
      

      Nothing is imported

        Activity

        Hide
        lemoene lemoene added a comment - - edited

        Another Example

        Using E.Coli and Enterro bacteria Detection Analysis Services

        configured with results options like this:

        https://demo.bikalabs.com/lims1/bika_setup/bika_analysisservices/analysisservice-60
        https://demo.bikalabs.com/lims1/bika_setup/bika_analysisservices/analysisservice-62

        Importing the numeric Result values

        to 4 samples for them with a 2D CSV file like this:

        The import traceback looks OK

        But the numeric Result Values are written to the Display Values

        reserved for the Detected, Not Detected texts. (Not important, but the -1 values are also converted to 0s)

        One would 've expected the 1 values to be converted to Detected, -1 to Not Detected etc

        When one tries to import the Display value texts directly

        with a CSV like this

        Nothing is imported

        and the traceback suggests the import expected numbers:

        No results imported

        Show
        lemoene lemoene added a comment - - edited Another Example Using E.Coli and Enterro bacteria Detection Analysis Services configured with results options like this: https://demo.bikalabs.com/lims1/bika_setup/bika_analysisservices/analysisservice-60 https://demo.bikalabs.com/lims1/bika_setup/bika_analysisservices/analysisservice-62 Importing the numeric Result values to 4 samples for them with a 2D CSV file like this: The import traceback looks OK But the numeric Result Values are written to the Display Values reserved for the Detected, Not Detected texts. (Not important, but the -1 values are also converted to 0s) One would 've expected the 1 values to be converted to Detected , -1 to Not Detected etc When one tries to import the Display value texts directly with a CSV like this Nothing is imported and the traceback suggests the import expected numbers: No results imported

          People

          • Assignee:
            Unassigned
            Reporter:
            lemoene lemoene
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: