Skip to content

Block death and departure completion while animal data is in Review Required state#721

Merged
labkey-martyp merged 3 commits into
release26.3-SNAPSHOTfrom
26.3_fb_block_completion_review_required
Jul 14, 2026
Merged

Block death and departure completion while animal data is in Review Required state#721
labkey-martyp merged 3 commits into
release26.3-SNAPSHOTfrom
26.3_fb_block_completion_review_required

Conversation

@labkey-martyp

Copy link
Copy Markdown
Contributor

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

  • Added the study.studyDataReviewRequired module query (study.StudyData joined to core.QCState) listing records in Review Required state.
  • Added NIRC_EHRTriggerHelper.getReviewRequiredDatasets, returning the dataset labels still in Review Required for an animal, excluding records on the given taskid.
  • The deaths.js and departure.js triggers now block saving a record as Completed while review-required data exists, naming the offending dataset(s) in the error.
  • Added NIRC_EHRTest.testDeathAndDepartureBlockedByReviewRequiredData covering the blocked path and the own-task exclusion for both datasets via validate-only API saves.

…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-martyp labkey-martyp merged commit 06e8031 into release26.3-SNAPSHOT Jul 14, 2026
5 of 6 checks passed
@labkey-martyp labkey-martyp deleted the 26.3_fb_block_completion_review_required branch July 14, 2026 11:38
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