Fix death notification timing, event time-of-day, and the Assign To dropdown - #33
Merged
Merged
Conversation
The notification and procedure-order update only fired when the record landed on 'Request: Pending', so a death entered alongside its necropsy — which goes straight to 'Review Required' or 'Completed' — never triggered either. A delete reaches the COMPLETE handler as the deleted row with a null oldRow, so it is now skipped rather than read as a draft leaving draft.
The EHR data-entry framework only offers a time-of-day editor when the column's display format contains hour information, so both forms were storing every event at midnight.
The birth trigger set the EHR removeTimeFromDate script option, so every birth date and the assignment, protocol assignment, group membership, and housing records derived from it were saved at midnight.
The combo claimed a page-wide element name and Cancel only hid the window rather than discarding it, so reopening the dialog rendered the previous window's field alongside the new one. The input name is now set explicitly, since Ext otherwise derives it from the component id.
The shared animal_group_members script sets removeTimeFromDate, so these rows were saved at midnight while the birth or arrival row they came from kept its time.
The study framework formats dataset date columns as date-only, so the time these triggers already preserve was neither visible nor editable.
Only 'Request: Pending', 'Review Required' and 'Completed' count as a declaration of death, so a draft moved to a state like 'Delete Requested' no longer notifies or closes procedure orders. End dates on the derived datasets now display as date-time, matching their start dates.
labkey-bpatel
approved these changes
Sep 4, 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
This branch corrects three defects in the death and birth/arrival entry forms: the death notification never fired for a death entered alongside its necropsy, birth and arrival events were stored at midnight regardless of the time entered, and reopening the Submit For Review window rendered a second Assign To dropdown.
The notification and the procedure-order update were gated on the record landing on 'Request: Pending', which only happens by way of 'Submit Death'. A death entered together with its necropsy goes straight to 'Review Required' or 'Completed' and so notified nobody. This widens the trigger to any first save that leaves draft, which means an API or bulk load inserting deaths already at 'Completed' will now send one notification per animal.
Related Pull Requests
None.
Changes