Add a Pregnant field to the animal snapshot panels - #34
Merged
Conversation
Pregnant lists an animal's active conceptions, each linking to its conception record, and reads No when there are none. A conception is active until a public birth or pregnancy outcome record claims its conception Id, now exposed as isActive on nbri_ehr.Conception and reused by ConceptionsByDam. Also drops the Prev Id field, which nothing ever populated.
Query XML cannot position a customizer-added column, since the customizer runs after the column reorder, so isActive places itself from the customizer instead. NBRI_EHRTest now asserts isActive and the dam's Pregnant field across all three states, including the birth that closes a conception and clears the dam.
Conception has no Id column and a birth row announces the newborn, so the dam's cached Pregnant value was never recomputed.
labkey-bpatel
approved these changes
Sep 4, 2026
A pregnancy outcome announces only its own Id, which is the dam just when the record was entered against her, so re-pointing, clearing or deleting one left the affected dam holding a stale cached Pregnant value. Also skips dam resolution on validation passes in the conception trigger, and guards isActive against a missing QCState column.
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
Adds a Pregnant field to the animal snapshot so staff can see at a glance whether a female is carrying an open conception, without opening the conception records to check.
A conception is open until a birth or a pregnancy outcome claims it, which no existing column expressed, so the field is backed by a new derived flag on the conception record. That flag is also useful on its own and is surfaced on the conceptions-by-dam report.
Related Pull Requests
None.
Changes