senaite.core icon indicating copy to clipboard operation
senaite.core copied to clipboard

Interim fields with same field name but different keyword appear misleaded in manage results

Open xispa opened this issue 7 years ago • 5 comments

Steps to reproduce

  1. Create a Calculation "Cloro libre" with these interims:
Keyword Field Title Default value Unit
V0 Vol 100.0 mL
C3 c[Cl2] mmol/L
V3 Vol (NH4)2Fe(SO4)2·6H2O mL
V5 Vol Mn+ 0.0

And with this calculation formula:

([C3]*([V3]-[V5]))/[V0]
  1. Create a Calculation "Cloro total" with these interims:
Keyword Field Title Default value Unit
V0 Vol 100.0 mL
C3 c[Cl2] mmol/L
V4 Vol (NH4)2Fe(SO4)2·6H2O mL
V5 Vol Mn+ 0.0

And with this calculation formula:

([C3]*([V4]-[V5]))/[V0]

Note that both Calculation differs in the the keyword for interim Vol (NH4)2Fe(SO4)2·6H20. V3 is used in the first calculation and V4 is used in the second.

  1. Create an Analysis Service "Cloro libre" with keyword Cl_libre and with Cloro libre calculation assigned.
  2. Create an Analysis Service "Cloro total" with keyword Cl_total and with Cloro total calculation assigned.
  3. Create a Calculation "Cloro combinado" without interims, but with this formula:
([Cl_total]-[Cl_libre])
  1. Create an Analysis Service "Cloro combinado" with keyword Cl_combinado and with Cloro combinado calculation assigned

  2. Create an Analysis Request with Cloro libre, Cloro combinado and Cloro total analyses.

  3. Receive the Analysis Request

  4. Create a Worksheet and assign the analyses

  5. In manage results view, interim fields columns for Vol (NH4)2Fe(SO4)2·6H20 appear misleaded, although their field names are the same (but different keyword). See screenshot below.

Current behavior

Interim fields with same title (but different keyword) and same order appear separated in 2 different columns.

Expected behavior

Interim fields with same title (also if different keyword) and same order appear in the same column.

Screenshot (optional)

interims_misleaded

xispa avatar Dec 20 '17 22:12 xispa

Do I understand that right, that two input fields should be rendered in that case for the Vol (NH4)2Fe(SO4)2·6H2O cell?

ramonski avatar May 20 '18 13:05 ramonski

Ah, sorry, got it. They should appear aligned in two rows...

ramonski avatar May 20 '18 13:05 ramonski

IMO the behavior is correct, because V3 and V4 are different primary keys and thus, are rendered in different cells.

Trying to merge the fields into a single cell is also technically not possible, because the columns match exactly with the interim keyword here: https://github.com/senaite/senaite.core/blob/master/bika/lims/browser/analyses/view.py#L542 Therefore, it is not possible to add a column for both keywords, e.g. V3V4, because then it wouldn't match anymore with the input fields for the interims:

ws-18-0175

ramonski avatar May 20 '18 15:05 ramonski

Leaving this one open until senaite.core 1.3.0

ramonski avatar May 22 '18 13:05 ramonski

The correct behaviour would be for the 'Cloro total' analysis service to fail to save, with a message reading "Validation failed: column title 'Vol (NH4)2Fe(SO4)2·6H2O' must have keyword 'V3'". The validator is failing.

rockfruit avatar Aug 03 '18 22:08 rockfruit