Skip to content

Add project, protocol, group and location to the Rearrival form - #39

Merged
labkey-martyp merged 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_rearrival_form_fields
Sep 11, 2026
Merged

Add project, protocol, group and location to the Rearrival form#39
labkey-martyp merged 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_rearrival_form_fields

Conversation

@labkey-martyp

@labkey-martyp labkey-martyp commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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, protocol, group or location the animal returns to. This reverses the decision in #28 to leave rearrivals out of those assignment fields: a departure closes an animal's project, protocol, group and housing records, so a returning animal has none of them left to keep and each has to be opened again, along with putting the animal back to Alive.

Related Pull Requests

Changes

  • Replace acquisition type and CITES on the Rearrival form with project, protocol, group and location, each required, as they are on the Arrival form.
  • Open the project assignment, protocol assignment, group membership and housing records for a rearrival, matching what an arrival already does.
  • Return a rearrived animal to Alive once the rearrival is completed.

Acquisition type and CITES are hidden in their place, since a rearrival is not a new acquisition. The trigger now opens the project, protocol, group and housing records that the animal's departure closed, and sets calculated_status back to Alive when the rearrival is completed, reversing the rearrival carve-out made in #28.
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.
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 labkey-martyp left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No related test failures.

@labkey-martyp
labkey-martyp merged commit fb63008 into release26.7-SNAPSHOT Sep 11, 2026
2 of 3 checks passed
@labkey-martyp
labkey-martyp deleted the 26.7_fb_rearrival_form_fields branch September 11, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants