Add project, protocol and location to the Rearrival form - #758
Merged
labkey-martyp merged 4 commits intoSep 11, 2026
Conversation
Acquisition type and CITES are hidden in their place, since a rearrival is not a new acquisition. The trigger now creates the assignment, protocol assignment and housing records that the animal's departure closed, and sets calculated_status back to Alive when the rearrival is completed.
Covers the fields the form collects, the project, protocol and housing records a rearrival opens, and the animal's return to Alive.
labkey-martyp
requested review from
labkey-bpatel
and removed request for
labkey-bpatel
September 9, 2026 16:49
A rearrival saved as In Progress or Review Required now writes Alive - In Progress like an arrival draft does, instead of leaving the animal Shipped while its housing and assignments are opened. The script-local demographics cache call is removed because validation never reads it; the demographics update itself refreshes the server-side animal cache.
ankurjuneja
approved these changes
Sep 10, 2026
| hidden: true, | ||
| showInGrid: false | ||
| }, | ||
| CITES: { |
Contributor
There was a problem hiding this comment.
any reason for uppercase?
Contributor
Author
There was a problem hiding this comment.
I don't know if it's required necessarily but the column itself is uppercase.
labkey-martyp
added a commit
to LabKey/ehrModules
that referenced
this pull request
Sep 11, 2026
## Rationale Any status recalculation for an animal that has arrived more than once fails with a database error instead of saving. The recalculation reads the animal's acquisition type from the arrival dataset filtered only on the animal, which throws as soon as a second arrival row exists. Death entry is the common way to hit this, and it is worst at centers that leave the status to the recalculation rather than writing it directly, where the save and the status are both lost. This surfaced while adding rearrivals to an institution module, but it affects every center whose arrival dataset carries an acquisition type. ## Related Pull Requests - LabKey/nircEHRModules#758 - LabKey/nbriEHRModules#39 ## Changes - Read the acquisition type from the animal's most recent arrival rather than from all of its arrival records at once.
labkey-martyp
commented
Sep 11, 2026
labkey-martyp
left a comment
Contributor
Author
There was a problem hiding this comment.
No related test failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
The Rearrival form collects fields that do not apply to a returning animal and omits the ones that do, and a completed rearrival leaves the animal in a departed state. It asks for an acquisition type and a CITES number, though an animal that is coming back was already acquired, and it does not ask which project, which protocol or which location the animal returns to. A departure closes the animal's project assignment, protocol assignment and housing records, so a rearrival has to open them again, and it has to put the animal back to Alive.
Related Pull Requests
Changes