senaite / senaite.core

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

AR Create. Default Specifications not selected #601

Closed lemoene closed 6 years ago

lemoene commented 6 years ago

Steps to reproduce

enable Specifications and select a default lab set of specifications per Sample Type to use, say the lab's

image

Proceed to create new ARs with the Specifications field showing. and select a Sample Type for which Specifications exist

When the Sample Type is selected, the user expects the default specs for that Sample type to be applied and the Specifications field on the AR Create form completed

Current behavior

The Specs field stays empty and it has to be completed manually. Note that the default container completed correctly

image

The lookup works correctly, listing only the spec(s) available for the Sample Type

image

Expected behavior

for the Default spec to be applied on the AR form automatically

image

lemoene commented 6 years ago

Probably better documented in duplcate https://github.com/senaite/senaite.core/issues/643

ramonski commented 6 years ago

These values can be selected in the global setup and per client:

Depending on the combinations, the Specs for each column of the AR Add form needs to be queried by the catalog and filtered. If multiple Specs were found, e.g. for the Sample Type "Wheat", one of these need to be picked and inserted, if no previous value was set in the Specs field (Probably the one with the most current date).

Special handling needs to be done if AR Add was opened on Batches or on AR listing, since there is no client or the client can be changed by the user.

All of this computation, which significantly slows down the whole AR Add process depending on the rendered columns, is done to fill a field with a value that is probably not the one that the user wants to save a single click?

IMO this functionality should go away completely, because I doubt someone is using it or knows which Spec will be finally diced in the end.

lemoene commented 6 years ago

The System needs a specification to compare captured routine results with - essential in any LIMS. In production labs several sets of specs will be available. Which in the very end is used to highlight out of range results on the COA to the client.

Analysis specification is a well matured feature in place since Bika 1, users could even switch between lab and client specs on AR and WS views and the alerts would adjust accordingly.

Having the default spec working, saves the (often specification-illiterate) clerk needing to think which one to choose, making mistakes that have to be corrected, and a click, scroll and click per AR created.

Analysis Request Specifications have been done away with already and should not be a factor

Except for multi-client Batches, ARs are always created in Client context. Multi-Client batches are more prevalent in research labs, and because of all the client referenced ancillary data in some disciplines, are not feasible there at all. I don't see multiclient batches in commercial testing labs.

I see there is an Add button on the global AR list now too... not sure what the business reason is for that. None of the Client specific Sample points etc. will probably work. Don't have time to test, quicker to simply hide it in our installations.

It sounds like it is probably not worth it making the default specs work, but don't remove the default specs from the system please, it remains essential and we'll have to sort it out later

On the other hand it could be straighter forward, if clientless AR Create can be avoided - neither is absolutely necessary, except maybe the multi client Batches in research labs.

(note to self, log the smaller Spec bugs uncovered yesterday, e.g. dormant specs being listed for selection)

lemoene commented 6 years ago

from a design perspective, it should on the AR Create form boil down to:

If Client associated with the new AR

         completed Analysis Spec field with Client's default spec

If no Client associated

     display Specification selection widget

probably much easier said than done again

lemoene commented 6 years ago

correction, I see the function of AR Add on the global AR List - many labs won't be bothered with client specific sample points, licenses, earlier created batches or samples etc for the AR Create. Client Contacts really is the only compulsory one from among them?

ramonski commented 6 years ago

I really see no need for these calculation, because AR Add displays per default the local client Specs together with the lab specs:

happy hills senaite 2018-02-15 21-07-18

This functionality is just to select, e.g. one of these "Apple Pulp" specs per default if the option if the client has Sample Type Specifications (Client) set.

However, the whole calculation process slows down the AR Add process significantly for a really low benefit. IMO this option needs to go away in favor of performance and simplicity.

lemoene commented 6 years ago

Edit, language for clarity

In the simplest case, the requirement is Write the Client's default Analysis Spec to new ARs.

Since users at the moment, S 1.2.2 can still edit the Specs on the AR itself, they ended up on the AR itself and not as a reference to the spec version at the time of AR Creation.

Another thread, Completely remove 'Editable Analysis Specifications'. https://github.com/senaite/senaite.core/issues/665. removing the editable specs was started earlier I thought when the new AR Create form was designed. Getting rid of that wil a lot of gunk it feels. DBW sponsored this madness when we were feature hungry... I don't think editing specs per AR is used at all now. They had many specs and dollars.

For as long as the Client's preferred spec at AR Create gets applied in AR and WS views and eventual COAs, Analysis Spec can be removed the AR Create form completely.

The screen shots captures the Spec before the Sample Type, it is normally done the other way round and the spec for that Sample Type applied.

Should we in this round simply remove the Spec from AR Create, and assign/reference in the bg creation process, the logic is

Bigger job now much neater, and we can get round with the users simply manually selecting the spec for now.

(The end goal got half implemented it seems, Named Specs, that like Lab or Client Specs, are collections of specs for many Sample Types)

lemoene commented 6 years ago

Should the User decide to apply a different spec later, after the default was used to create the AR, they can modify it on the AR Edit tab

image

note nother small issue to log, the Specs offered for selection should only be for the applicable Sample Type. That is to ensure say Potable water specs get applied and not Sewage's

lemoene commented 6 years ago

example of 2 Specs for the same Sample Type

image

lemoene commented 6 years ago

Earlier comment edited for clarity, and Completely remove 'Editable Analysis Specifications', #665 broken out as separate issue

ramonski commented 6 years ago

This option will be removed in future versions of SENAITE due to low benefit and high performance impact.

lemoene commented 6 years ago

Please don't remove the code completely. We'll need this back for environmental and cannabis labs (yesterday) probably as soon as March already. Will follow the above suggested auto add design