Skip to content

Fix death notification firing, a duplicate Assign To field, and dropped birth/arrival times - #751

Open
labkey-martyp wants to merge 6 commits into
release26.7-SNAPSHOTfrom
26.7_fb_death_notification
Open

Fix death notification firing, a duplicate Assign To field, and dropped birth/arrival times#751
labkey-martyp wants to merge 6 commits into
release26.7-SNAPSHOTfrom
26.7_fb_death_notification

Conversation

@labkey-martyp

@labkey-martyp labkey-martyp commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Rationale

Three NIRC updates: the death notification now fires for a death recorded alongside its necropsy, the Submit For Review dialog no longer shows a duplicate Assign To field when reopened, and birth and arrival entry now keeps the time of day.

The notification and the accompanying procedure-order update were keyed off the 'Request: Pending' state. A death entered on the same form as its necropsy is submitted straight to 'Review Required' or 'Completed' and never passes through that state, so neither ran for it.

The Submit For Review dialog claimed a page-wide element name for its Assign To field and only hid itself when cancelled, so a second open rendered the previous dialog's field next to the new one. Cancelling to correct a value and reopening is routine in the combined death-and-necropsy flow, which is where it showed up.

Times were lost twice over: neither date column carried a format with a time component, so both forms presented a date-only editor, and the birth trigger separately discarded the time server-side, which carried through to the records derived from the birth date.

Related Pull Requests

None.

Changes

  • The deaths trigger keys the notification off the move out of draft instead of off one specific target state, so it fires once per record no matter which submit button created it.
  • The procedure-order update moves with the notification, so it also runs for a death recorded alongside its necropsy.
  • The Submit For Review dialog no longer claims a page-wide element name and now discards itself when cancelled, so reopening it renders a single Assign To field.
  • The birth and arrival date columns declare a date-and-time display format, so entry offers a time-of-day editor and the stored time is visible.
  • The birth trigger no longer discards the time from the birth date, so it survives onto the birth record and everything derived from it.

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.
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.
@labkey-martyp labkey-martyp changed the title Send the death notification on the first non-draft save Fix death notification firing and dropped times on birth/arrival entry Aug 31, 2026
The birth trigger set the EHR removeTimeFromDate script option, so every birth date and the assignment, protocol assignment, 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.
if (helper.isETL() || !row || !row.Id || !row.QCStateLabel)
continue;

// Notify once, on the first non-draft save: 'Submit Death' lands on 'Request: Pending', but a death entered alongside its necropsy goes straight to 'Review Required' or 'Completed'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was by design, since Submit Death was meant to notify the relevant users so they could complete the Necropsy. When Death and Necropsy are submitted together, the Necropsy is already entered, so the notification seems moot in that case. But I could be missing some additional context now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what they've asked for now.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The submit death allows AR to notify VR of a pending necropsy but VR can do a straight necropsy and now AR is not notified. The AR managers are in the death notification list but a two step process is undesired for VR (submit death for email, then submit necropsy for review). The head vet still has to submit final regardless of either path.

@labkey-martyp labkey-martyp changed the title Fix death notification firing and dropped times on birth/arrival entry Fix death notification firing, a duplicate Assign To field, and dropped birth/arrival times Aug 31, 2026
A delete reaches the COMPLETE handler as the deleted row with a null oldRow, which read as a draft leaving draft and re-ran the notification and the procedure-order update.
Ext derives the input name from the component id, so dropping the global id renamed the input and broke the locator testDeathNecropsyForm uses to find it.
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.

3 participants