Problem with Requestability Rules

LabKey Support Forum (Inactive)
Problem with Requestability Rules jdutra  2013-10-04 14:08
Status: Closed
 
I have added a custom query to the requestability rules for a a study. The query is item #3 in my active rules, with only the mandatory "Locked in Request Check" after it.

My query returns a list of 781 vials. Then I import specimens, and 775 vials are marked unavailable based on my query. The other 6 vials are all for the same subject/timepoint, and have the same primary and derivative type. They are still available after specimen import.

I can't figure out why they are not being marked as unavailable. The GlobalUniqueIds for these vials are correct in the query. They are not involved in a request, and the request check is the only thing that runs after the query. Could there be a deleted request hanging around somewhere that is screwing this up? Any other suggestions as to what might cause this problem?

We are still using labkey 13.1, in case that matters.

Thanks for your help,
Jen
 
 
Dave Bradlee responded:  2013-10-04 17:05
Hi Jen,

It sounds like you expect all vials to be not requestable. (Note available and requestable are different. Vials could be available but because of a requestability rule, not requestable).
What I would suggest to help figure this out is, first, remove the other requestability rules to make sure they are not playing a role. (In 13.2 you can even remove the Locked In Request check, BTW.) All requests should be visible in the Specimen Requests page, even those that are in a final state, but any existing request would only make a vial not requestable.

If you still think it's something with your custom query, run the query independently (from the schema browser) to see the results (whether those 6 are included or not). Perhaps you can debug your query that way.

Thanks.

Dave
 
jdutra responded:  2013-10-10 13:48
Hi Dave,

Thanks for your response. I'm a little confused about your distinction between available and requestable. The "requestability rules" screen always refers to marking vials available/unavailable. The only exception is the administrator override option using the "requestable" column, which we don't use.

In any case, we now have 13.2 installed on our development server, and I did some messing around. First, I should explain that my query is looking to find "the first x available vials" for a list of subjects and mark them unavailable. Which means that the results will change depending on what other rules are run before the query, and it may return a different number of vials as well.

So, with no other requestability rules being enforced, my query returns 798 vials, the import says that 798 vials were marked unavailable based on that rule, and SpecimenDetail shows 798 vials unavailable with my query as the reason. Perfect.

Then I added the Locked in Request Check to the requestability rules, after my query. The query and the import still say 798 vials, but the number of vials in SpecimenDetail is 718. I suspect that most of that is legitimate - the vials were re-marked as unavailable due to being locked in a request. However, the 6 vials I mentioned originally are now available. It seems that the "Locked in Request Check" is remarking them as available, which it really shouldn't be doing.

Finally, I moved the Locked in Request Check BEFORE my query. I couldn't do this in 13.1, but it's allowed in 13.2. It works perfectly again. We hope to upgrade our production server soon, so I can work around my problem by re-ordering the rules.

I looked at the "affected vials" for the Locked in Request Check rule and the 6 vials I'm having such trouble with are definitely not in there, so I just don't understand why they would be affected by the Locked in Request Check rule at all.

- Jen