diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js new file mode 100644 index 000000000..e2da80ee2 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js @@ -0,0 +1,40 @@ +/* Created: 3-12-2024 by Kollil and Raymond +This script is added to create a pop-up message box when MPA injection is selected in the medication order form. +Refer to the ticket #9669 +*/ +Ext4.define('ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel', { + extend: 'EHR.panel.TaskDataEntryPanel', + + onBeforeSubmit: function(btn){ + if (!btn || !btn.targetQC || ['Completed'].indexOf(btn.targetQC) == -1){ + return; + } + var store = this.storeCollection.getClientStoreByName('Treatment Orders'); + LDK.Assert.assertNotEmpty('Unable to find Treatment Orders store', store); + + var ids = []; + store.each(function(r){ + if (r.get('Id')&& r.get('code')=='E-85760' && r.get('category') == 'Clinical' ) + ids.push(r.get('Id')) + }, this); + ids = Ext4.unique(ids); + + if (!ids.length) + return; + + if (ids.length){ + Ext4.Msg.confirm('Medication Question', 'Have you confirmed MPA start date on CMU Calendar?', function(val){ + if (val == 'yes'){ + this.onSubmit(btn, true); + } + else { + + } + }, this); + } + else { + this.onSubmit(btn, true); + } + return false; + } +}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js b/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js index 04d2aaa45..e6f4617e4 100644 --- a/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js +++ b/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js @@ -93,30 +93,47 @@ Ext4.define('ONPRC_EHR.window.ManageRecordWindow', { var rec = form.getRecord(); if (!rec) return; - if (!rec.get('taskid')) { - var tsk = LABKEY.Utils.generateUUID().toUpperCase(); - LABKEY.Query.insertRows({ - schemaName: 'ehr', - queryName: 'tasks', - rows: [{ - taskid: tsk, - formtype: 'treatments', - title: 'Medication/Diet', - assignedto: LABKEY.Security.currentUser.userid, - qcstate: EHR.Security.getQCStateByLabel('Completed').RowId, - datecompleted: new Date(), - category: 'Task' - }], - scope: this, - failure: EHR.Utils.onError, - success: function () { - Ext4.Msg.hide(); + //Added by Kollil, 5/3/24 + //Refer to the ticket #9669 + //This code snippet is added to show a pop-up question box when the user selects MPA medication on animal history snapshot screen - > Manage Treatments link. + if (rec.get('Id') && rec.get('code')=='E-85760') + { + Ext4.Msg.confirm('Medication Question', 'Have you confirmed MPA start date on CMU Calendar?', function(val){ + if (val == 'yes') { + if (!rec.get('taskid')) { + var tsk = LABKEY.Utils.generateUUID().toUpperCase(); + LABKEY.Query.insertRows({ + schemaName: 'ehr', + queryName: 'tasks', + rows: [{ + taskid: tsk, + formtype: 'treatments', + title: 'Medication/Diet', + assignedto: LABKEY.Security.currentUser.userid, + qcstate: EHR.Security.getQCStateByLabel('Completed').RowId, + datecompleted: new Date(), + category: 'Task' + }], + scope: this, + failure: EHR.Utils.onError, + success: function () { + Ext4.Msg.hide(); + } + }); + rec.set('taskid', tsk); + } + this.down('#dataEntryPanel').onSubmit(btn); + } + else { + } - }); - rec.set('taskid', tsk); + }, this) + } + else { + this.down('#dataEntryPanel').onSubmit(btn); } - this.down('#dataEntryPanel').onSubmit(btn); }, + onFormLoad: function(results){ this.formResults = results; this.setTitle(this.formResults.formConfig.label); diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java index 8d72bf2dc..c45218e3e 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java @@ -79,6 +79,11 @@ public BulkClinicalEntryFormType(DataEntryFormContext ctx, Module owner) addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/ExamCasesDataEntryPanel.js")); setDisplayReviewRequired(true); setJavascriptClass("ONPRC_EHR.panel.ExamCasesDataEntryPanel"); + + //Added by Kollil, 3/12/24 + //This script was added to show a pop-up question box when the user selects MPA medication on the Medication order form. + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js")); + setJavascriptClass("ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel"); } @Override diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java index a25e05949..a08db44f2 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java @@ -105,6 +105,11 @@ public ClinicalReportFormType(DataEntryFormContext ctx, Module owner) addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/ExamCasesDataEntryPanel.js")); setDisplayReviewRequired(true); setJavascriptClass("ONPRC_EHR.panel.ExamCasesDataEntryPanel"); + + //Added by Kollil, 3/12/24 + //This script was added to show a pop-up question box when the user selects MPA medication on the Medication order form. + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js")); + setJavascriptClass("ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel"); } @Override diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java index 3a883b5ae..5f25dd4a4 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java @@ -72,14 +72,10 @@ public ClinicalRoundsFormType(DataEntryFormContext ctx, Module owner) addClientDependency(ClientDependency.supplierFromPath("ehr/model/sources/ClinicalDefaults.js")); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/ClinicalRounds.js")); - - - - - - - - + //Added by Kollil, 3/12/24 + //This script was added to show a pop-up question box when the user selects MPA medication on the Medication order form. + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js")); + setJavascriptClass("ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel"); } @Override diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java index be803534c..afa853150 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java @@ -56,9 +56,13 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner) } addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/TreatmentDrugsClinical.js")); - //Added 4-24-2024 R. Blasa + //Added 4-24-2024 R. Blasa addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/FormTemplateWindow.js")); + //Added by Kollil, 3/12/24 + //This script was added to show a pop-up question box when the user selects MPA medication on the Medication order form. + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js")); + setJavascriptClass("ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel"); if (ctx.getContainer().getActiveModules().contains(ModuleLoader.getInstance().getModule("onprc_billing"))) { @@ -68,7 +72,6 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner) } //Added 4-24-2024 R. Blasa - @Override protected List getMoreActionButtonConfigs() { @@ -79,9 +82,6 @@ protected List getMoreActionButtonConfigs() return ret; } - - - @Override protected boolean canInsert() {