Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add test requests for samples/worksheets already verified or published #1205

Closed
garciagab opened this issue Jan 16, 2019 · 14 comments
Closed

Comments

@garciagab
Copy link

Steps to reproduce

Current behavior

Expected behavior

Screenshot (optional)

@xispa xispa transferred this issue from senaite/senaite.impress Jan 17, 2019
@xispa
Copy link
Member

xispa commented Jan 17, 2019

Hi @garciagb , thanks for your contribution!. Please note this issue is not related with senaite.impress, rather with senaite.core, so I've moved it the issue here, in senaite.core's issue tracker: https://github.com/senaite/senaite.core/issues

By default, system does not allow to add or modify tests from Analysis Requests that are in "verified" or "published" status. These states are basically end points in the Analysis Request workflow. You have different options here:

  • Invalidate the Analysis Request: when an Analysis Request is invalidated, the system automatically generates a "copy" and transitions this copy to "received" status. This "copy"n (retest) has same analyses and results previously set in the invalidated Analysis Request. Since the retest is in "received" status, the system allows you to manage its analyses (add/remove tests). If the Analysis Request is invalidated after it was "published", the system will automatically send an email notification to the client contact, stating that the Analysis Request has been invalidated and therefore, the results report is no longer valid.

  • Secondary Analysis Request: You have the option to keep the previous Analysis Request valid, but generate a Secondary Analysis Request with additional tests. Go to Analysis Request Add form, choose the same Sample as the previous Analysis Request in field "Sample".

  • Copy to new: There is the option to create a new Analysis Request without invalidating the previous one, but keeping exactly the same tests and sample information as the primary. Go in the Analysis Requests listing, choose the Analysis Request you want to copy and press the "Copy to new" button. The AR Add form will be displayed with same values as the primary one.

  • Customize Analysis Request workflow. This requires coding skills.

NB: Please try to stick to the sections the issue template provides when creating issues, it will make reviewer's live easier!

@xispa xispa changed the title How to add test requests for samples/worksheets already verified or published Cannot add test requests for samples/worksheets already verified or published Jan 17, 2019
@garciagab
Copy link
Author

Invalidate the Analysis Request: Error

image

image

Secondary Analysis Request: Error

image

image

Copy to new:
Created a new AR number with no link to the old AR number

@xispa
Copy link
Member

xispa commented Jan 18, 2019

The Traceback you get when creating a retest and the error when you try to create a secondary AR are because of the same reason. The ID generated for the new AR (secondary or retest) crashes with an already existing ID. I think the reason is because there is no separator between the sample ID and the "request" part: 000639R0 instead of 000639-R0.

Basically, the system tries to keep the same ID as the invalidated or primary Analysis Request, but increase the digit of the last part (the suffix) in one unit. Since there is no "separation" character explicitly set, the system is unable to recognize the last part and tries with the same ID. But the ID already exists, so the system cannot create this new entity and the error is rised.

Although we could add an hyphen in the ID between the sample id and the request number, not sure if this is a good solution given the fact you have Analysis Requests already created. Please confirm. Another solution that wouldn't require any change in your current IDs configuration, would be to make ID Server to support fixed-length parts in IDs too, at least for these two specific cases (secondary + retest): the system would look for fixed-length parts instead of specific char when splitting the ID.

I've assigned the issue to myself.

@garciagab
Copy link
Author

Can we change the R0 to R1 so we have
000639R0
as the original
and 000639R1
for these two specific cases (secondary + retest)

@garciagab
Copy link
Author

image
image

@xispa
Copy link
Member

xispa commented Jan 28, 2019

Thanks @garciagab , opened an issue for this specific "Advanced..." issue here:
#1219

Regarding the AR numbering: your "primary" AR already ends with "R0". Indeed, the rest of ARs generated from the primary as the source (e.g. retests or secondary) should follow the criteria "R1", "R2", etc.

@xispa xispa reopened this Jan 28, 2019
@garciagab
Copy link
Author

R1 , R2 is ok for me.

@xispa
Copy link
Member

xispa commented Feb 6, 2019

Related: #1229

@grulisco
Copy link
Contributor

@xispa two questions to your initial comment:

  • Secondary Analysis Request: You have the option to keep the previous Analysis Request valid, but generate a Secondary Analysis Request with additional tests. Go to Analysis Request Add form, choose the same Sample as the previous Analysis Request in field "Sample".

In current master (pre1.3) the field "Sample" is lost, so this option is not available. Is it planned to reintroduce this field?

  • Copy to new: There is the option to create a new Analysis Request without invalidating the previous one, but keeping exactly the same tests and sample information as the primary. Go in the Analysis Requests listing, choose the Analysis Request you want to copy and press the "Copy to new" button. The AR Add form will be displayed with same values as the primary one.

This kind of copy will not keep old sample received date, or does it?

@xispa
Copy link
Member

xispa commented Mar 14, 2019

Hi @grulisco

In current master (pre1.3) the field "Sample" is lost, so this option is not available. Is it planned to reintroduce this field?

Yes, and atm we believe we have the new code base stable enough to add this feature without undesired effects. In fact, secondary sample (along with some sporadic bugs that are reported here for 1.3) is the last remaining thing before making 1.3 public. Our idea is to have it ready for testing within the following days.

This kind of copy will not keep old sample received date, or does it?

No, this kind of copy does not copy values of fields somehow related with transitions. So, no it does not keep old sample received date.

@grulisco
Copy link
Contributor

Hi @xispa:
I wouldl gladly test secondary sample machinery as soon as it is available.
Normal copy sample: At least received date is editable after copying...

@xispa
Copy link
Member

xispa commented Mar 14, 2019

@grulisco #1284 🥇

@xispa
Copy link
Member

xispa commented Mar 18, 2019

Fixed in 1.3 See #1284 and #1219

@xispa xispa closed this as completed Mar 18, 2019
@grulisco
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants