Option to show Interim fields on COA

Hello everyone, since interim fields are not shown on the COA(Certificate of Analysis). I would to ask if it is ok to add an option for them to be shown on the COA. @lemoene suggested we add a boolean Report field on the interim fields as shown on the images below

or should this functionality be in an add-on?

Hi Lunga,

I would like to have interim fields as well in the report to overcome the shortcoming of having only one result.
So I think having that checkbox is a good idea and gives the user the possibility to select the fields he/she wants to display in the report.
You can also add the functionality into the default reports, but keep in mind that we will soon remove the whole publishing engine from senaite.core to senaite.impress.

Maybe some things to consider:

  • order and sorting of the records field might be challenging
  • no specification/out of range possible if these values are used to add multiple results w/o a calculation
  • format/layout of the report might be challenging (especially when you show results of multiple ARs next to each other in columns)
1 Like

Hi Ramon,
Thank you. I’ve started working on the default reports and once the layout is accepted will move to senaite.impress.

What should be the order of the interim fields(alphabetically or display as they were captured)?
Do we use an indicator like we do on the worksheet when the results are out of range?

Thanks Lunga

There is an issue for the order of the Interim fields on WSs and ARs, COA gets the same order but omitting the Interims not selected for Reporting

Interims should be sorted and displayed

*firstly per AS, so they are next to one another

  • secondly in the order they are on the AS method tab (inherited from the Calc)

https://github.com/senaite/senaite.core/issues/888. Fixed by @xispa earlier, maybe ‘small’-)

messy screenshot of what we are aiming for

Edit, actual formula for combining DM and Unit conversion to be built…

image

I’ve create PR but have marked as not ready because I’ve made a draft on how the interim fields would be displayed on the COA.
Will wait from the community about the way forward of the layout/design.

Draft looks like this

and I also thought maybe this

I’d prefer the last example for standard reports, because it is more flexible regarding the number of interims and space.

I am testing this now. In 3rd party commercial labs, they don’t readily publish Interim values, probably different for production labs

Our first prize is Feeds chemistry, probably 30 interims dispersed throughout their ASs, and we only want to show results before and after drying (DM), also handy in Cannabis. And then use the same machinery for Unit Conversion

Here’s a simplified COA, lacking Analysis Specs in the config …

image

I think @lunga has the display order for them sorted too, https://github.com/senaite/senaite.core/issues/888

image

Am continuing testing with more than one Calc per view, but in the Feeds case, it becomes spaghetti very quickly. We are considering a setup option to disable Interim displays for ARs

Data capturing goes well on WSs with only one or two calcs used per WS for yay Samples. There the tab order on the WS, say with interfaced balances, is important, testing that too, https://github.com/senaite/senaite.core/issues/952

decimal issues remain…

That said, fixing up your own COA is easier now

Hi, I’m trying to set up a Senaite in my lab and I’d like to display the interim fields on my reports. I’m selecting the report option on the calculation page but nothing is coming up on the reports in senaite.impress. Am I missing something simple? Thank you for any help you can provide.

Results

Hi @SpireLab, would you mind to open an issue at https://github.com/senaite/senaite.impress ?
Meanwhile, you can make the interims to be displayed in the results report by adding something like below (not tested) here https://github.com/senaite/senaite.impress/blob/master/src/senaite/impress/templates/reports/Default.pt#L424 (or in the MultiDefault.pt):

<td class="text-right">
  <tal:interims repeat="interim model.InterimFields">
    <div tal:condition="not:interim/hidden">
      <span tal:content="interim/title"/>:
      <span tal:content="interim/value"/>&nbsp;
      <span tal:content="interim/unit"/>
    </div>
  </tal:interims>
 </td>

Thank you for your quick response. I’ve opened the issue as you’ve suggested.

I’m currently trying your solution but I’ve not had any success yet. I’ll play around with it and see if i can it to work.

Please also check the documentation on how to customize templates in senaite.impress here:

I. have tried that:

<td colspan="3">
  <ul class="list-unstyled results_interims">
    <li tal:repeat="interims results_interims" class="mt-2">
      <sup tal:content="python: repeat.interims.number()"/>
      <sup tal:content="python: len(results_interims)"/>
      <tal:interims repeat="interim interims">
        <tal:interim>
          <br tal:condition="repeat/interim/index"/>
          <span tal:content="python: interim.get('title', '')"/>
          <span>: </span>
          <span tal:content="python: interim.get('formatted_value', '')"/>
        </tal:interim>
      </tal:interims>
    </li>
  </ul>
</td>

Then result is that:

How can I use last item of list?

Thanks.

I have solved like that:

                     <!-- Prob -->
                    <td class="analysis">
                      <tal:interim_fields
                          define="interims python:view.get_result_variables(analysis)"
                          condition="interims">
                        <span tal:content="python: interims and (interims[0].get('formatted_value', '') if len(interims) > 0 else '')"></span>
                      </tal:interim_fields>
                    </td>
                    <!-- Result -->
                    <td class="analysis">
                      <tal:interim_fields
                          define="interims python:view.get_result_variables(analysis)"
                          condition="interims">
                        <span tal:content="python: interims and (interims[1].get('formatted_value', '') if len(interims) > 1 else '')"></span>
                      </tal:interim_fields>
                    </td>

I have Two result variables. but the code above is changeble acording to variables counts.

That looks like: