Skip to content

Fix death notification timing, event time-of-day, and the Assign To dropdown - #33

Merged
labkey-martyp merged 8 commits into
release26.7-SNAPSHOTfrom
26.7_fb_death_notification
Sep 4, 2026
Merged

Fix death notification timing, event time-of-day, and the Assign To dropdown#33
labkey-martyp merged 8 commits into
release26.7-SNAPSHOTfrom
26.7_fb_death_notification

Conversation

@labkey-martyp

@labkey-martyp labkey-martyp commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

  • Notify and complete procedure orders on the first save that leaves draft, rather than only when the record lands on 'Request: Pending'.
  • Ignore deletes in the death trigger, which previously read a deleted row as a draft leaving draft.
  • Keep the time of day on birth and arrival events and on the assignment, protocol assignment, housing, and group membership records derived from them.
  • Show that time of day on the birth, arrival, death, necropsy and derived-record dates, which the study framework otherwise renders as date-only, so the entry forms offer a time editor.
  • Give the Assign To combo a window-scoped identity and discard the Submit For Review window on cancel.

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-martyp
labkey-martyp merged commit c90f52b into release26.7-SNAPSHOT Sep 4, 2026
1 of 2 checks passed
@labkey-martyp
labkey-martyp deleted the 26.7_fb_death_notification branch September 4, 2026 19:17
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