Skip to content

Commit

Permalink
Message box code added
Browse files Browse the repository at this point in the history
  • Loading branch information
kollil committed Mar 13, 2024
1 parent d91de89 commit 668f59a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2014 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/

// Created: 3-12-2024 by Kollil and Raymond
/*
This java script is added to create a pop-up message box when a 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 start date on CMU Calendar?', function(val){
if (val == 'yes'){
this.onSubmit(btn, true);
}
else {

}
}, this);
}
else {
this.onSubmit(btn, true);
}

return false;
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import org.labkey.api.ehr.EHRService;
import org.labkey.api.ehr.dataentry.AnimalDetailsFormSection;
import org.labkey.api.ehr.dataentry.DataEntryFormContext;
import org.labkey.api.ehr.dataentry.DrugAdministrationFormSection;
import org.labkey.api.ehr.dataentry.FormSection;
import org.labkey.api.ehr.dataentry.TaskForm;
import org.labkey.api.ehr.dataentry.TaskFormSection;
import org.labkey.api.ehr.dataentry.DrugAdministrationFormSection;
import org.labkey.api.ehr.security.EHRClinicalEntryPermission;
import org.labkey.api.module.Module;
import org.labkey.api.module.ModuleLoader;
Expand Down Expand Up @@ -55,9 +55,12 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner)
for (FormSection s : this.getFormSections())
{
s.addConfigSource("TreatmentDrugsClinical");

}
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/TreatmentDrugsClinical.js"));
//Added by Kollil, 3/12/24
//This java script was added to show a message box when the user selects MPA medication on the Medication order form.
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/TreatmentOrdersDataEntryPanel.js"));
setJavascriptClass("ONPRC_EHR.panel.TreatmentOrdersDataEntryPanel");

if (ctx.getContainer().getActiveModules().contains(ModuleLoader.getInstance().getModule("onprc_billing")))
{
Expand All @@ -66,8 +69,6 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner)

}



@Override
protected boolean canInsert()
{
Expand All @@ -76,4 +77,5 @@ protected boolean canInsert()

return super.canInsert();
}

}

0 comments on commit 668f59a

Please sign in to comment.