Block death and departure completion while animal data is in Review Required state#721
Merged
labkey-martyp merged 3 commits intoJul 14, 2026
Conversation
…red state Adds a study.studyDataReviewRequired module query over study.StudyData joined to core.QCState, and a NIRC_EHRTriggerHelper.getReviewRequiredDatasets helper that returns the dataset labels still in Review Required for an animal, excluding records on the completing record's own task since those move to Completed in the same save. The deaths and departure triggers call it when a record is being saved as Completed and raise an error naming the offending dataset(s). Covered by NIRC_EHRTest.testDeathAndDepartureBlockedByReviewRequiredData, which verifies both the blocked path and the own-task exclusion for each dataset via validate-only API saves.
…rations CagematesDemographicsProvider was registered twice, and DefaultClinicalRemarksDataSource and DefaultVitalsDataSource were shadowed by the NIRC-specific sources of the same name (NIRCClinicalRemarksDataSource, NIRCVitalsDataSource), which register later and win in ClinicalHistoryManager's dedup by name. The shadowed registrations only produced duplicate-source warnings on every history fetch.
labkey-bpatel
approved these changes
Jul 14, 2026
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
A death or departure record could be finalized while other data for the animal was still in the Review Required QC state, leaving unreviewed records behind for an animal no longer at the center. Completing a death or departure now fails validation until that data is reviewed, except for records on the completing record's own task, which move to Completed in the same save.
Related Pull Requests
None.
Changes
study.studyDataReviewRequiredmodule query (study.StudyDatajoined tocore.QCState) listing records in Review Required state.NIRC_EHRTriggerHelper.getReviewRequiredDatasets, returning the dataset labels still in Review Required for an animal, excluding records on the given taskid.deaths.jsanddeparture.jstriggers now block saving a record as Completed while review-required data exists, naming the offending dataset(s) in the error.NIRC_EHRTest.testDeathAndDepartureBlockedByReviewRequiredDatacovering the blocked path and the own-task exclusion for both datasets via validate-only API saves.