Update the birth, arrival, death, and pregnancy data entry forms - #35
Open
labkey-martyp wants to merge 6 commits into
Open
Update the birth, arrival, death, and pregnancy data entry forms#35labkey-martyp wants to merge 6 commits into
labkey-martyp wants to merge 6 commits into
Conversation
Generation lives on demographics beside the social code: arrivals start at 0, and births take the dam's generation plus one, falling back to 1 when she has none. The new column has to be imported into an existing study before the forms will accept it, and the birth test now sets a location, which became required in the previous commit.
Death types that are no longer valid for new entry stay in the lookup as disabled so the historical rows that use them still resolve. Removing disposition from the deaths form and dataset leaves death_reason unused, so it is deregistered too.
Delivery mode reuses the pregnancy dataset's unused type column and the delivery_mode lookup that study.birth already points at.
labkey-bpatel
approved these changes
Sep 4, 2026
The arrival trigger required a generation on every upsert and never propagated a corrected one to demographics; both now follow the scoping and the update clause the neighboring fields already use. Also coerces the value before comparing it, names the real cause when a birth has no dam at all, reports a missing generation column directly, and gives each birth test row its own cage.
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
Bring the birth, arrival, death, and pregnancy entry forms in line with the data that is actually captured for new animals and pregnancy outcomes. Four gaps drove the work: animals were being created with neither a location nor a generation, the death type list still offered values that are no longer valid for new entry alongside a disposition field that is not used, and pregnancy outcomes recorded no delivery mode and could be saved without a link back to a conception.
Related Pull Requests
None.
Changes
Require the initial location on the birth and arrival forms.
Record a generation on demographics for animals entered through those forms: arrivals start at zero and births derive theirs from the dam.
Disable the death types that are no longer valid for new entry, leaving them in the lookup so historical rows still resolve.
Drop the disposition field from the deaths form and dataset, and deregister the death reason lookup that it left unused.
Add a delivery mode to pregnancy outcomes and require a conception Id.
Extend the module's Selenium coverage for the new required fields and the generation behavior.
Note for deployment: the new generation column ships with the reference study, so an existing study needs it imported before the forms will accept it.