diff --git a/nirc_ehr/resources/queries/study/arrival.query.xml b/nirc_ehr/resources/queries/study/arrival.query.xml index ffe21086..3b8933b1 100644 --- a/nirc_ehr/resources/queries/study/arrival.query.xml +++ b/nirc_ehr/resources/queries/study/arrival.query.xml @@ -11,6 +11,7 @@ Arrival Date + DateTime Arrival Type diff --git a/nirc_ehr/resources/queries/study/birth.js b/nirc_ehr/resources/queries/study/birth.js index 26b5e66a..66b4e9a2 100644 --- a/nirc_ehr/resources/queries/study/birth.js +++ b/nirc_ehr/resources/queries/study/birth.js @@ -17,7 +17,6 @@ function onInit(event, helper){ skipHousingCheck: true, announceAllModifiedParticipants: true, allowDatesInDistantPast: true, - removeTimeFromDate: true, skipAssignmentCheck: true, }); diff --git a/nirc_ehr/resources/queries/study/birth.query.xml b/nirc_ehr/resources/queries/study/birth.query.xml index 40849889..ea501cee 100644 --- a/nirc_ehr/resources/queries/study/birth.query.xml +++ b/nirc_ehr/resources/queries/study/birth.query.xml @@ -12,6 +12,7 @@ Birth Date + DateTime Birth Location diff --git a/nirc_ehr/resources/queries/study/deaths.js b/nirc_ehr/resources/queries/study/deaths.js index 9e1133f1..8695ed58 100644 --- a/nirc_ehr/resources/queries/study/deaths.js +++ b/nirc_ehr/resources/queries/study/deaths.js @@ -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); diff --git a/nirc_ehr/resources/web/nirc_ehr/buttons/deathNecropsyButtons.js b/nirc_ehr/resources/web/nirc_ehr/buttons/deathNecropsyButtons.js index 344873ff..cd8f4f2d 100644 --- a/nirc_ehr/resources/web/nirc_ehr/buttons/deathNecropsyButtons.js +++ b/nirc_ehr/resources/web/nirc_ehr/buttons/deathNecropsyButtons.js @@ -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: [{ @@ -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, }]