specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
62 stars 36 forks source link

Allow for default value for `to-one` relationships in form definition #5087

Open bronwyncombs opened 2 months ago

bronwyncombs commented 2 months ago

Is your feature request related to a problem? Please describe.

This is related to the request for an automated checkbox that indicates Gift status. This institution would like users to clearly see when a preparation has been gifted if searching records in the database. They currently use a manual workaround with a node in their tree, but automating this is preferred.

Information on how OSU deals with interactions with partial preparations can be found in the additional context section below. They tend to only gift entire preparation lots, and create new preparation records for the un-gifted remainder if there is a partial gift or loan.

Describe the solution you'd like

I also ask that when that Gift check box is activated that the Storage location for that Preparation be assigned the storage location = “Gifted”.

Screenshot 2024-07-09 at 12 18 39 PM

Support for defining a default node value ("Gifted") for storage could then be used with a conditional of the status of the requested IsGifted checkbox. The preparation storage field would then contain this value once a gift record is saved with it as a gift preparation.

The cell on the Preparation form definition would be something like: <cell type="field" name="storage" uitype="querycbx" initialize="name=Storage;title=Storage" default="<STORAGE_ID>"/> (replace with the ID of the record)

Then they can have a conditional form based on the IsGifted field that is requested to proceed this ability

Describe alternatives you've considered

Reported By Randy @ Oregon State

Additional context

We don’t gift part of a preparation line item, so yes, since 100% of a preparation item by our definition is gifted, the storage location will change to “Gifted”.

Note: We added a “Gifted” node in the Location Tree (A placeholder under the Building column). Today, we manually enter Gifted in the Storage Location window to make it obvious to anyone searching our collection that the item listed is not available, and will continue to do so manually. Having the storage location automatically entered by a Gift tool modification is a nice-to-have. The Gifted check box is the priority.

In the infrequent situation where we had say a count of 12 whole specimens for a single preparation line item, and only 4 specimens were to be gifted, we manually create a NEW preparation line item with a count = 4, enter “Gifted” into the storage location field for that new item. Then we would reduce the count for the first preparation line from 12 to 8, leaving the Storage Location field unchanged for those remaining in the collection.

The most common situation we handle is a request for tissue samples for DNA analysis which by definition are gifts. When we have a large enough tissue sample in a vial, we will cut away and store a ‘subsample’ for shipment to the requestor, retaining part of the original sample in our collection. The tissue subsample vial becomes a NEW preparation line that we mark as Gifted in the Storage Location field, and IF there was a “Gifted” check box, we would either manually check one, or use the Gift Interaction tool to better document the gift and use an enhanced Gift tool to automatically activate the Gift Checkbox. (Please see my original screen shot of the example of a specimen marked as On Loan, a preparation line item of a Tissue Sample with vial box grid location in a cryogenically stored box, and a new Tissue Subsample preparation that was Gifted to a researcher. For now, I believe we will continue to create an individual preparation line for a gift, a separate one for a loan, and leave the original preparation record with counts adjusted as needed if any specimens remain in our collection.

specifysoftware commented 1 month ago

This issue has been mentioned on Specify Community Forum. There might be relevant details there:

https://discourse.specifysoftware.org/t/add-a-gifted-checkbox-to-the-preparations-screen-request-5082/1864/2