Fix death notification firing, a duplicate Assign To field, and dropped birth/arrival times - #751
Fix death notification firing, a duplicate Assign To field, and dropped birth/arrival times#751labkey-martyp wants to merge 6 commits into
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.
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, 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'. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
That's what they've asked for now.
There was a problem hiding this comment.
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.
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.
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