From e35041b452f489e81b22f388cfda888eebb19bf6 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 7 May 2024 11:47:36 -0700 Subject: [PATCH 1/7] Added the popup message on the medication data entry panels and animal history snapshot page, --- .../panel/TreatmentOrdersDataEntryPanel.js | 40 +++++++++++++ .../onprc_ehr/window/ManageRecordWindow.js | 59 ++++++++++++------- .../dataentry/BulkClinicalEntryFormType.java | 5 ++ .../dataentry/ClinicalReportFormType.java | 5 ++ .../dataentry/ClinicalRoundsFormType.java | 12 ++-- .../dataentry/TreatmentsFormType.java | 10 ++-- 6 files changed, 97 insertions(+), 34 deletions(-) create mode 100644 onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js 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() { From 243b170b4ddece4c685eaace7509e23c1e494729 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 7 May 2024 13:40:28 -0700 Subject: [PATCH 2/7] Changed the EHR reference to onprc_ehr in the manage treatments section --- onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js index 61a10ac65..fcea44581 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js @@ -170,7 +170,7 @@ Ext4.define('ONPRC_EHR.panel.AnimalDetailsPanel', { hidden: EHR.Security.hasClinicalEntryPermission() && !EHR.Security.hasPermission(EHR.QCStates.COMPLETED, 'update', [{schemaName: 'study', queryName: 'Treatment Orders'}]), handler: function(){ if (this.subjectId){ - Ext4.create('EHR.window.ManageTreatmentsWindow', {animalId: this.subjectId}).show(); + Ext4.create('onprc_ehr.window.ManageTreatmentsWindow', {animalId: this.subjectId}).show(); } else { console.log('no id'); From 4132e0f466e071bfeb5eb1133779df9efce126aa Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 26 Jun 2024 13:09:00 -0700 Subject: [PATCH 3/7] MPA message project final testing --- onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js | 1 + onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js | 2 +- .../labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java | 2 +- .../org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java | 2 +- .../org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java | 2 +- .../src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js index fcea44581..bd5ad075c 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js @@ -170,6 +170,7 @@ Ext4.define('ONPRC_EHR.panel.AnimalDetailsPanel', { hidden: EHR.Security.hasClinicalEntryPermission() && !EHR.Security.hasPermission(EHR.QCStates.COMPLETED, 'update', [{schemaName: 'study', queryName: 'Treatment Orders'}]), handler: function(){ if (this.subjectId){ + //Changed the container to onprc_ehr by Kollil, 6/26/24 Ext4.create('onprc_ehr.window.ManageTreatmentsWindow', {animalId: this.subjectId}).show(); } else { diff --git a/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js b/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js index e6f4617e4..12e2b34fa 100644 --- a/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js +++ b/onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js @@ -93,7 +93,7 @@ Ext4.define('ONPRC_EHR.window.ManageRecordWindow', { var rec = form.getRecord(); if (!rec) return; - //Added by Kollil, 5/3/24 + //Added by Kollil, 6/26/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') 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 c45218e3e..2bd6f731c 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java @@ -80,7 +80,7 @@ public BulkClinicalEntryFormType(DataEntryFormContext ctx, Module owner) setDisplayReviewRequired(true); setJavascriptClass("ONPRC_EHR.panel.ExamCasesDataEntryPanel"); - //Added by Kollil, 3/12/24 + //Added by Kollil, 6/26/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"); 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 a08db44f2..d600f39a2 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java @@ -106,7 +106,7 @@ public ClinicalReportFormType(DataEntryFormContext ctx, Module owner) setDisplayReviewRequired(true); setJavascriptClass("ONPRC_EHR.panel.ExamCasesDataEntryPanel"); - //Added by Kollil, 3/12/24 + //Added by Kollil, 6/26/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"); 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 5f25dd4a4..0204c5e82 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java @@ -72,7 +72,7 @@ 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 + //Added by Kollil, 6/26/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"); 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 afa853150..59faefca1 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java @@ -59,7 +59,7 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner) //Added 4-24-2024 R. Blasa addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/FormTemplateWindow.js")); - //Added by Kollil, 3/12/24 + //Added by Kollil, 6/26/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"); From 819990895ad0e992757a97900690c7abdc1c73e5 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 26 Jun 2024 17:33:54 -0700 Subject: [PATCH 4/7] Added the MPA pop up message to the animal details -> Manage Treatments --- .../onprc_ehr/panel/ManageTreatmentsPanel.js | 46 +++++++++++++++++++ .../panel/TreatmentOrdersDataEntryPanel.js | 3 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/ManageTreatmentsPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/ManageTreatmentsPanel.js index a759687be..ebfe154cb 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/ManageTreatmentsPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/ManageTreatmentsPanel.js @@ -77,6 +77,52 @@ Ext4.define('onprc_ehr.panel.ManageTreatmentsPanel', { }, (owner ? owner.animalId : null), category); }, + onSubmit: function(btn) { + var form = this.down('#formPanel'); + var rec = form.getRecord(); + if (!rec) + return; + //Added by Kollil, 6/26/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 details panel + 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 Order', + 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 { + + } + }, this) + } + else { + this.down('#dataEntryPanel').onSubmit(btn); + } + }, + createTreatmentWindow: function(btn, config, animalId, category){ var cfg = Ext4.apply({ schemaName: 'study', diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js index e2da80ee2..af4757870 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/TreatmentOrdersDataEntryPanel.js @@ -1,6 +1,7 @@ /* 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 +Modified: Kollil, 6/26/24 */ Ext4.define('ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel', { extend: 'EHR.panel.TaskDataEntryPanel', @@ -14,7 +15,7 @@ Ext4.define('ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel', { var ids = []; store.each(function(r){ - if (r.get('Id')&& r.get('code')=='E-85760' && r.get('category') == 'Clinical' ) + if (r.get('Id') && r.get('code')=='E-85760') // && r.get('category') == 'Clinical' ) // Removed the category filter, as the medication requires the validation whenever its ordered ids.push(r.get('Id')) }, this); ids = Ext4.unique(ids); From de7c052cedb36a1f5e1514d2330b021b9cca6c0b Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 13 Nov 2024 16:47:54 -0800 Subject: [PATCH 5/7] updated code files --- .../onprc_ehr/panel/AnimalDetailsCasePanel.js | 2 +- .../panel/AnimalDetailsExtendedPanel.js | 5 +- .../web/onprc_ehr/panel/AnimalDetailsPanel.js | 2 +- .../web/onprc_ehr/plugin/onprc_RowEditor.js | 72 +++++++++++++++++++ .../org/labkey/onprc_ehr/ONPRC_EHRModule.java | 3 +- .../AnimalDetailsRoundsFormSection.java | 1 + .../dataentry/ClinicalReportFormType.java | 4 -- .../dataentry/ClinicalRoundsFormType.java | 8 +-- .../ExtendedAnimalDetailsFormSection.java | 15 +--- 9 files changed, 85 insertions(+), 27 deletions(-) create mode 100644 onprc_ehr/resources/web/onprc_ehr/plugin/onprc_RowEditor.js diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsCasePanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsCasePanel.js index 752c7f113..fd05972c9 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsCasePanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsCasePanel.js @@ -146,7 +146,7 @@ Ext4.define('ONPRC_EHR.panel.AnimalDetailsCasePanel', { xtype: 'ldk-linkbutton', style: 'margin-top: 10px;', scope: this, - text: '[Show Full Hx]', + text: '[Show Full Hx show]', handler: function(){ if (this.subjectId){ EHR.window.ClinicalHistoryWindow.showClinicalHistory(null, this.subjectId, null); diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsExtendedPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsExtendedPanel.js index 9eb35842b..ddf02077d 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsExtendedPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsExtendedPanel.js @@ -62,7 +62,7 @@ Ext4.define('ONPRC_EHR.panel.AnimalDetailsExtendedPanel', { xtype: 'ldk-linkbutton', style: 'margin-top: 10px;', scope: this, - text: '[Show Full Hx]', + text: '[Show Full Hx show]', handler: function(){ if (this.subjectId){ EHR.window.ClinicalHistoryWindow.showClinicalHistory(null, this.subjectId, null); @@ -92,7 +92,8 @@ Ext4.define('ONPRC_EHR.panel.AnimalDetailsExtendedPanel', { hidden: EHR.Security.hasClinicalEntryPermission() && !EHR.Security.hasPermission(EHR.QCStates.COMPLETED, 'update', [{schemaName: 'study', queryName: 'Treatment Orders'}]), handler: function(){ if (this.subjectId){ - Ext4.create('EHR.window.ManageTreatmentsWindow', {animalId: this.subjectId}).show(); + //Changed the container to onprc_ehr by Kollil, 11/13/24 + Ext4.create('onprc_ehr.window.ManageTreatmentsWindow', {animalId: this.subjectId}).show(); } else { console.log('no id'); diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js index bd5ad075c..955d563a1 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/panel/AnimalDetailsPanel.js @@ -140,7 +140,7 @@ Ext4.define('ONPRC_EHR.panel.AnimalDetailsPanel', { xtype: 'ldk-linkbutton', style: 'margin-top: 10px;', scope: this, - text: '[Show Full Hx]', + text: '[Show Full Hx show]', handler: function(){ if (this.subjectId){ EHR.window.ClinicalHistoryWindow.showClinicalHistory(null, this.subjectId, null); diff --git a/onprc_ehr/resources/web/onprc_ehr/plugin/onprc_RowEditor.js b/onprc_ehr/resources/web/onprc_ehr/plugin/onprc_RowEditor.js new file mode 100644 index 000000000..c5ba0bca1 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/plugin/onprc_RowEditor.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2013-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + * + * Created by Kollil on 11/12/24 in efforts to create the MPA pop up message display + */ +Ext4.onReady(function(){ +Ext4.define('ONPRC_EHR.plugin.RowEditor', { + extend: 'EHR.plugin.RowEditor', + + getDetailsPanelCfg: function () { + return { + xtype: 'onprc_ehr-animaldetailspanels', + itemId: 'detailsPanel', + showDisableButton: false + } + }, + + getWindowCfg: function(){ + return { + modal: true, + width: 900, + border: false, + items: [{ + items: [this.getDetailsPanelCfg(), this.getFormPanelCfg()] + }], + buttons: this.getWindowButtons(), + closeAction: 'destroy', + listeners: { + scope: this, + close: this.onWindowClose, + destroy: this.onWindowClose, + beforerender: function(win){ + var cols = win.down('#formPanel').items.get(0).items.getCount(); + if (cols > 1){ + var newWidth = cols * (EHR.form.Panel.defaultFieldWidth + 20); + if (newWidth > win.width) { + win.setWidth(newWidth); + } + } + }, + afterrender: function(editorWin){ + this.keyNav = new Ext4.util.KeyNav({ + target: editorWin.getId(), + scope: this, + up: function(e){ + if (e.ctrlKey){ + this.loadPreviousRecord(); + } + }, + down: function (e){ + if (e.ctrlKey){ + this.loadNextRecord(); + } + } + }); + }, + animalchange: { + fn: function(id){ + this.getEditorWindow().down('#detailsPanel').loadAnimal(id); + }, + scope: this, + buffer: 200 + } + } + } + }, + +}); + EHR.Utils.rowEditorPlugin = 'ONPRC_EHR.plugin.RowEditor'; +}); \ No newline at end of file diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java index bfb4c126e..982ec9b48 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java @@ -274,6 +274,7 @@ private void registerEHRResources() EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/ManageTreatmentsWindow.js"), this); EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/ManageTreatmentsPanel.js"), this); EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/SmallFormSnapShotPanel.js"), this); +// EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/onprc_RowEditor.js"), this); //Added: 8-24-2016 R.Blasa EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/DemographicsRecord.js"), this); @@ -281,8 +282,6 @@ private void registerEHRResources() //Added: 2-22-2017 R.Blasa EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/NarrowSnapshotPanel.js"), this); - - //Added: 10-25-2017 R.Blasa References new Xtype EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/form/field/CEG_PlantextArea.js"), this); diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AnimalDetailsRoundsFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AnimalDetailsRoundsFormSection.java index 6f80026a2..300abf3f6 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AnimalDetailsRoundsFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AnimalDetailsRoundsFormSection.java @@ -31,3 +31,4 @@ public AnimalDetailsRoundsFormSection() } } + 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 d600f39a2..d9c1314fc 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalReportFormType.java @@ -18,7 +18,6 @@ import org.labkey.api.ehr.EHRService; import org.labkey.api.ehr.dataentry.AbstractFormSection; import org.labkey.api.ehr.dataentry.DataEntryFormContext; -import org.labkey.onprc_ehr.dataentry.ExtendedAnimalDetailsFormSection; import org.labkey.api.ehr.dataentry.FormSection; import org.labkey.api.ehr.dataentry.NonStoreFormSection; import org.labkey.api.ehr.dataentry.SimpleFormPanelSection; @@ -27,13 +26,11 @@ import org.labkey.api.ehr.dataentry.TaskForm; import org.labkey.api.ehr.dataentry.TaskFormSection; import org.labkey.api.ehr.dataentry.WeightFormSection; -import org.labkey.api.ehr.dataentry.DrugAdministrationFormSection; import org.labkey.api.ehr.security.EHRClinicalEntryPermission; import org.labkey.api.module.Module; import org.labkey.api.query.Queryable; import org.labkey.api.view.template.ClientDependency; - import java.util.Arrays; import java.util.List; @@ -65,7 +62,6 @@ public ClinicalReportFormType(DataEntryFormContext ctx, Module owner) //Added 5-23-2015 Blasa new SimpleGridPanel("study", "housing", "Housing Transfers",EHRService.FORM_SECTION_LOCATION.Tabs) - )); setTemplateMode(AbstractFormSection.TEMPLATE_MODE.NO_ID); 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 0204c5e82..219d2d065 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ClinicalRoundsFormType.java @@ -23,7 +23,6 @@ import org.labkey.api.ehr.dataentry.TaskForm; import org.labkey.api.ehr.dataentry.TaskFormSection; import org.labkey.api.ehr.dataentry.WeightFormSection; -import org.labkey.api.ehr.dataentry.DrugAdministrationFormSection; import org.labkey.api.ehr.security.EHRClinicalEntryPermission; import org.labkey.api.module.Module; import org.labkey.api.query.Queryable; @@ -47,14 +46,15 @@ public ClinicalRoundsFormType(DataEntryFormContext ctx, Module owner) new TaskFormSection(), //Added 5-9-2016 R.Blasa new AnimalDetailsRoundsFormSection(), - new ClinicalRoundsRemarksFormSection(), //NOTE: originally removed in order to enforce non-editable IDs //however, have been re-added apparently people do use them new BloodDrawFormSection(false, EHRService.FORM_SECTION_LOCATION.Tabs), new WeightFormSection(EHRService.FORM_SECTION_LOCATION.Tabs), - new DrugAdministrationFormSection(EHRService.FORM_SECTION_LOCATION.Tabs, DrugAdministrationFormSection.LABEL, ClientDependency.supplierFromPath("onprc_ehr/window/ONPRC_AddScheduledTreatmentWindow.js")), - new TreatmentOrdersFormSection(EHRService.FORM_SECTION_LOCATION.Tabs), +// new DrugAdministrationFormSection(EHRService.FORM_SECTION_LOCATION.Tabs, DrugAdministrationFormSection.LABEL, ClientDependency.supplierFromPath("onprc_ehr/window/ONPRC_AddScheduledTreatmentWindow.js")), + new DrugAdministrationFormSection(ClientDependency.supplierFromPath("onprc_ehr/window/ONPRC_AddScheduledTreatmentWindow.js")), +// new TreatmentOrdersFormSection(EHRService.FORM_SECTION_LOCATION.Tabs), + new TreatmentOrdersFormSection(), new ClinicalObservationsFormSection(EHRService.FORM_SECTION_LOCATION.Tabs, false) )); diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ExtendedAnimalDetailsFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ExtendedAnimalDetailsFormSection.java index 78f1184b6..b971535f5 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ExtendedAnimalDetailsFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ExtendedAnimalDetailsFormSection.java @@ -1,6 +1,5 @@ package org.labkey.onprc_ehr.dataentry; -import org.labkey.onprc_ehr.dataentry.AnimalDetailsFormSection; import org.labkey.api.ehr.dataentry.NonStoreFormSection; import org.labkey.api.view.template.ClientDependency; @@ -10,20 +9,10 @@ public class ExtendedAnimalDetailsFormSection extends NonStoreFormSection { public ExtendedAnimalDetailsFormSection() { -// super(); -// -// setXtype("onprc_ehr-animaldetailsextendedpanel"); - - super("AnimalDetails", "Animal Details", "onprc_ehr-animaldetailsextendedpanel"); - addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/AnimalDetailsCasePanel.js")); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/AnimalDetailsExtendedPanel.js")); - - - - - - } + } } + From af1618b35db7a80bdb9aeaeb6d8a5bccf966c80f Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Wed, 20 Nov 2024 06:30:31 -0800 Subject: [PATCH 6/7] Row Editor dependencies --- onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java index 2bf5cabb4..5fb4b6be6 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java @@ -96,9 +96,7 @@ import org.labkey.onprc_ehr.security.ONPRC_EHRCMUAdministrationRole; import org.labkey.onprc_ehr.security.ONPRC_EHRCustomerEditPermission; import org.labkey.onprc_ehr.security.ONPRC_EHRCustomerEditRole; -import org.labkey.onprc_ehr.security.ONPRC_EHREnvironmentalPermission; import org.labkey.onprc_ehr.security.ONPRC_EHREnvironmentalRole; -//import org.labkey.onprc_ehr.security.ONPRC_EHRPMICEditRole; import org.labkey.onprc_ehr.security.ONPRC_EHRTransferRequestRole; import org.labkey.onprc_ehr.table.ONPRC_EHRCustomizer; @@ -284,7 +282,11 @@ private void registerEHRResources() EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/ManageTreatmentsWindow.js"), this); EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/ManageTreatmentsPanel.js"), this); EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/SmallFormSnapShotPanel.js"), this); -// EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/onprc_RowEditor.js"), this); + + // Consider creating a base FormType to include these dependencies instead of blasting them on every page + EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("ehr/plugin/RowEditor.js"), this); + EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/onprc_RowEditor.js"), this); + EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/AnimalDetailsPanel.js"), this); //Added: 8-24-2016 R.Blasa EHRService.get().registerClientDependency(ClientDependency.supplierFromPath("onprc_ehr/DemographicsRecord.js"), this); From 099e44deb3af52e6c8e33ca7231bee20eb4f934b Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Wed, 20 Nov 2024 06:31:24 -0800 Subject: [PATCH 7/7] Rename ONPRC Animal Details --- .../org/labkey/onprc_ehr/dataentry/AuxProcedureFormType.java | 4 +--- .../labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java | 4 +--- .../src/org/labkey/onprc_ehr/dataentry/NecropsyFormType.java | 2 +- ...ilsFormSection.java => ONPRCAnimalDetailsFormSection.java} | 4 ++-- .../org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java | 4 +--- 5 files changed, 6 insertions(+), 12 deletions(-) rename onprc_ehr/src/org/labkey/onprc_ehr/dataentry/{AnimalDetailsFormSection.java => ONPRCAnimalDetailsFormSection.java} (89%) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AuxProcedureFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AuxProcedureFormType.java index ac4d5effa..42c7350da 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AuxProcedureFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AuxProcedureFormType.java @@ -15,7 +15,6 @@ */ package org.labkey.onprc_ehr.dataentry; -import org.labkey.onprc_ehr.dataentry.AnimalDetailsFormSection; import org.labkey.api.ehr.dataentry.BloodDrawFormSection; import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.ehr.dataentry.FormSection; @@ -23,7 +22,6 @@ import org.labkey.api.ehr.dataentry.TaskForm; import org.labkey.api.ehr.dataentry.TaskFormSection; import org.labkey.api.ehr.dataentry.WeightFormSection; -import org.labkey.onprc_ehr.dataentry.DrugAdministrationFormSection; import org.labkey.api.module.Module; import org.labkey.api.view.template.ClientDependency; @@ -47,7 +45,7 @@ public AuxProcedureFormType(DataEntryFormContext ctx, Module owner) new TaskFormSection(), - new AnimalDetailsFormSection(), + new ONPRCAnimalDetailsFormSection(), // new SimpleGridPanel("study", "encounters", "Procedures" ), new ClinicalEncountersFormSection(), //Added 5-4-2015 Blasa new BloodDrawFormSection(false), 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 2bd6f731c..cd5240619 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BulkClinicalEntryFormType.java @@ -16,14 +16,12 @@ package org.labkey.onprc_ehr.dataentry; import org.labkey.api.ehr.EHRService; -import org.labkey.onprc_ehr.dataentry.AnimalDetailsFormSection; import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.ehr.dataentry.FormSection; import org.labkey.api.ehr.dataentry.SimpleGridPanel; import org.labkey.api.ehr.dataentry.TaskForm; import org.labkey.api.ehr.dataentry.TaskFormSection; import org.labkey.api.ehr.dataentry.WeightFormSection; -import org.labkey.onprc_ehr.dataentry.DrugAdministrationFormSection; import org.labkey.api.ehr.security.EHRClinicalEntryPermission; import org.labkey.api.module.Module; import org.labkey.api.view.template.ClientDependency; @@ -45,7 +43,7 @@ public BulkClinicalEntryFormType(DataEntryFormContext ctx, Module owner) { super(ctx, owner, NAME, "Bulk Clinical Entry", "Clinical", Arrays.asList( new TaskFormSection(), - new AnimalDetailsFormSection(), + new ONPRCAnimalDetailsFormSection(), //Added 6-5-2015 Blasa new ClinicalEncountersFormSection(), diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/NecropsyFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/NecropsyFormType.java index 20363e527..3e8225cb6 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/NecropsyFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/NecropsyFormType.java @@ -51,7 +51,7 @@ public NecropsyFormType(DataEntryFormContext ctx, Module owner) new NecropsyInstructionFormSection(), //Added: 12-21-2021 R.Blasa new ClinicalEncountersFormPanelSection("Necropsy"), //Modified: 12-20-2018 R.Blasa - new AnimalDetailsFormSection(), + new ONPRCAnimalDetailsFormSection(), new GrossFindingsFormPanelSection(), new PathologyFormSection("ehr", "encounter_participants", "Staff"), new PathologyNotesFormPanelSection(), diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AnimalDetailsFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ONPRCAnimalDetailsFormSection.java similarity index 89% rename from onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AnimalDetailsFormSection.java rename to onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ONPRCAnimalDetailsFormSection.java index f92ae6abb..152174270 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/AnimalDetailsFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/ONPRCAnimalDetailsFormSection.java @@ -20,9 +20,9 @@ //Created:12-20-2018 R.Blasa -public class AnimalDetailsFormSection extends NonStoreFormSection +public class ONPRCAnimalDetailsFormSection extends NonStoreFormSection { - public AnimalDetailsFormSection() + public ONPRCAnimalDetailsFormSection() { super("AnimalDetails", "Animal Details", "onprc_ehr-animaldetailspanels"); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/panel/AnimalDetailsPanel.js")); 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 a8d614fb0..1949f1dc9 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TreatmentsFormType.java @@ -16,12 +16,10 @@ package org.labkey.onprc_ehr.dataentry; import org.labkey.api.ehr.EHRService; -import org.labkey.onprc_ehr.dataentry.AnimalDetailsFormSection; import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.ehr.dataentry.FormSection; import org.labkey.api.ehr.dataentry.TaskForm; import org.labkey.api.ehr.dataentry.TaskFormSection; -import org.labkey.onprc_ehr.dataentry.DrugAdministrationFormSection; import org.labkey.api.ehr.security.EHRClinicalEntryPermission; import org.labkey.api.module.Module; import org.labkey.api.module.ModuleLoader; @@ -44,7 +42,7 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner) { super(ctx, owner, NAME, LABEL, "Clinical", Arrays.asList( new TaskFormSection(), - new AnimalDetailsFormSection(), + new ONPRCAnimalDetailsFormSection(), new DrugAdministrationFormSection(ClientDependency.supplierFromPath("onprc_ehr/window/ONPRC_AddScheduledTreatmentWindow.js")), new TreatmentOrdersFormSection() ));