senaite / senaite.core

Enterprise Open Source Laboratory System (LIMS)
https://senaite.com
GNU General Public License v2.0
254 stars 145 forks source link

Analytical holding time functionality #2624

Open xispa opened 3 weeks ago

xispa commented 3 weeks ago

Description of the issue/feature this PR addresses

This Pull Request allows the user to set the maximum holding time (sample) before it does no longer make sense to perform a given test. Note that "holding time" is understood as the elapsed amount of time from the point of collection to the start of the analysis.

For instance, testing for arboviral illnesses like Dengue, Zika, and Chikungunya might not make sense 5 days after the collection date. Likewise, identification of pathogenic microorganisms in a food sample won't make sense e.g. 2d after collection.

A new field "Maximum holding time" has been added to services and analyses:

Captura de 2024-10-08 14-09-20

On sample creation form, when the user selects a collection date that makes not possible to conduct a given analysis within the holding time, the service becomes not available for selection and an icon is displayed instead, along with an informative text:

Captura de 2024-10-08 14-12-17

Service is still available for selection from "Manage analyses" view though.

An alert icon is also displayed in analyses listing either when the result was captured beyond the analytical holding time or when the holding time is due:

Captura de 2024-10-10 10-58-46

-- I confirm I have tested this PR thoroughly and coded it according to PEP8 and Plone's Python styleguide standards.