Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nirc_ehr/resources/queries/study/arrival.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<column columnName="Id"/>
<column columnName="date">
<columnTitle>Arrival Date</columnTitle>
<formatString>DateTime</formatString>
</column>
<column columnName="arrivalType">
<columnTitle>Arrival Type</columnTitle>
Expand Down
1 change: 0 additions & 1 deletion nirc_ehr/resources/queries/study/birth.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function onInit(event, helper){
skipHousingCheck: true,
announceAllModifiedParticipants: true,
allowDatesInDistantPast: true,
removeTimeFromDate: true,
skipAssignmentCheck: true,
});

Expand Down
1 change: 1 addition & 0 deletions nirc_ehr/resources/queries/study/birth.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</column>
<column columnName="date">
<columnTitle>Birth Date</columnTitle>
<formatString>DateTime</formatString>
</column>
<column columnName="cage">
<columnTitle>Birth Location</columnTitle>
Expand Down
18 changes: 10 additions & 8 deletions nirc_ehr/resources/queries/study/deaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,21 @@ EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Even
});

EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.COMPLETE, 'study', 'Deaths', function(event, errors, helper){
// A delete arrives here as the deleted row with a null oldRow, which otherwise reads as a draft leaving draft.
if (event === 'delete')
return;

var rows = helper.getRows() || [];
for (var i = 0; i < rows.length; i++) {
var row = rows[i].row;
var oldRow = rows[i].oldRow;

// Notification will get sent when:
// 1) a brand-new row saved directly as 'Request: Pending' (i.e., when a user clicks 'Submit Death'), or
// 2) a draft death record moving from 'In Progress' to 'Request: Pending'.
if (!helper.isETL() &&
row && row.Id &&
row.QCStateLabel &&
row.QCStateLabel.toUpperCase() === 'REQUEST: PENDING' &&
(!oldRow || !oldRow.QCStateLabel || oldRow.QCStateLabel.toUpperCase() === 'IN PROGRESS')) {
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'.
var wasDraft = !oldRow || !oldRow.QCStateLabel || oldRow.QCStateLabel.toUpperCase() === 'IN PROGRESS';
if (wasDraft && row.QCStateLabel.toUpperCase() !== 'IN PROGRESS') {
console.log("Sending NIRC Death Notification")
triggerHelper.sendDeathNotification(row.Id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Ext4.define('NIRC_EHR.window.DeathNecropsySubmitForReviewWindow', {
text: 'Cancel',
scope: this,
handler: function(btn){
btn.up('window').hide();
btn.up('window').close();
}
}],
items: [{
Expand All @@ -127,8 +127,10 @@ Ext4.define('NIRC_EHR.window.DeathNecropsySubmitForReviewWindow', {
value: this.getDefaultRecipient(),
displayField: 'DisplayName',
valueField: 'UserId',
// No global 'id' here: a reopened window would adopt the previous window's element and render a second combo.
itemId: 'assignedTo',
id: 'assignedTo',
// Ext derives the input's name from the component id when 'name' is absent, so set it explicitly rather than leaning on the id.
name: 'assignedTo',
anyMatch: true,
caseSensitive: false,
}]
Expand Down
Loading