Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// 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 MPA 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();
}

}