Skip to content

Commit

Permalink
Added the popup message on the medication data entry panels and anima…
Browse files Browse the repository at this point in the history
…l history snapshot page,
  • Loading branch information
kollil committed May 7, 2024
1 parent 78f128c commit e35041b
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}
});
59 changes: 38 additions & 21 deletions onprc_ehr/resources/web/onprc_ehr/window/ManageRecordWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
{
Expand All @@ -68,7 +72,6 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner)
}

//Added 4-24-2024 R. Blasa

@Override
protected List<String> getMoreActionButtonConfigs()
{
Expand All @@ -79,9 +82,6 @@ protected List<String> getMoreActionButtonConfigs()
return ret;
}




@Override
protected boolean canInsert()
{
Expand Down

0 comments on commit e35041b

Please sign in to comment.