Files
St.Clair/MLMStripper/bin/Debug/FORM/FORM_SET_CDIFF_ANTIBIOTICS.mlm

205 lines
7.9 KiB
Plaintext

maintenance:
title: FORM_SET_CDIFF_ANTIBIOTICS;;
mlmname: FORM_SET_CDIFF_ANTIBIOTICS;;
arden: version 2.5;;
version: 15.10;;
institution: St Clair Hospital;;
author: Juliet M. Law, Allscripts ;;
specialist: Peggy Leschak, Allscripts;;
date: 2016-05-09;;
validation: testing;;
library:
purpose: Used for Intra-CDIFF Antibiotics order set
;;
explanation: This MLM is called from CDIFF Antibiotics Order Set
Change history
05.09.2016 JML CSR 34091: Created for CDIFF Antibiotic Order Set
;;
keywords: Called MLMs, Antibiotic CDIFF, Weight Based Dosing
;;
knowledge:
type: data-driven;;
data:
standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
include standard_libs;
using "ObjectsPlusXA.SCM.Forms";
using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
// This MLM is passed three arguments, of types
// communication_type, form_type and client info object respectively.
(this_communication, // Communication object
this_form, // Form object
client_info_obj //Arden ClientInfo object
) := argument;
ClientGuid := this_communication.ClientGUID;
ChartGuid := this_communication.ChartGUID;
ClientVisitGuid := this_communication.ClientVisitGUID;
PrimaryObjdetail:=this_communication.PrimaryObj;
OrderSetName := PrimaryObjdetail.OrderSetName;
/*******************Make Changes To Spelling And Flags In This Section*******************/
/* Set to True if a decision.log is needed.*/
log_execution_info := False;
/***************************************************************************************/
// Initialize error message
error_message:="";
enable_chkbx_mlm := mlm {{{SINGLE-QUOTE}}}FORM_Func_Disable_OS_Checkboxes{{{SINGLE-QUOTE}}};
antibiotic_guideline_mlm := mlm {{{SINGLE-QUOTE}}}FORM_FUNC_DISPLAY_ANTIBIOTIC_GUIDELINES{{{SINGLE-QUOTE}}};
crcl_mlm := mlm {{{SINGLE-QUOTE}}}FORM_MLM_Creatinine_Clearance_OS{{{SINGLE-QUOTE}}};
exceptFld := ();
// Assigns fields passed in the Form object to the Field object
field_list:= this_form.fields;
CallingEvent := this_communication.CallingEvent;
CallingField := this_communication.CallingFieldName;
//Define fields
Flagyl_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 12 );
Vancomycin_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 13 );
Vanco_Flagyl_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 14 );
Vanco_Enema_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 15 );
Antibiotics_Grid := first of ( field_list WHERE field_list.DataItemName = "MultiOrderGrid" AND field_list.Control_MultiFieldOccNum = 1 );
Antibiotics_Grid_Value := Antibiotics_Grid.Value;
Flagyl_Oral := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Metronidazole 500mg Tab" );
Flagyl_IV := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Metronidazole:" );
Vancomycin := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Vancomycin Soln" );
Vancomycin_Enema := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Vancomycin Enema" );
Vancomycin_Dose := first of ( field_list WHERE field_list.DataItemName = "DosageLow" AND field_list.Control_MultiFieldOccNum = 2 );
Vancomycin_Code := first of ( field_list WHERE field_list.DataItemName = "PRX_DrugIDCode" AND field_list.Control_MultiFieldOccNum = 1 );
CrCl_MgDl := first of ( field_list WHERE field_list.DataItemName = "PRX_CrCl_mg_dl" AND field_list.Control_MultiFieldOccNum = 1 );
// Get patient weight
comb_ht_wt_field := first of (field_list where field_list.DataItemName = "CombinedMeasurements");
if exists comb_ht_wt_field then
comb_ht_wt_val := comb_ht_wt_field.value;
wt := comb_ht_wt_val.weight;
ht := comb_ht_wt_val.height;
weightvalue := (wt as number);
endif;
// Get patient age
(birthDate) := read last {ClientInfo: BirthDate REFERENCING client_info_obj};
patientAge := (NOW - birthDate) / (1 year);
If patientage < 11.99 and CallingEvent = "FormOpen" then;
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "Patient under 12 years of age." ||"\n Please call physician for dosing. " ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
endif;
if ( CallingEvent = "FormOpen" ) then
//Retrieve CrCl values
(this_communication, this_form) := call crcl_mlm WITH this_communication, this_form, client_info_obj;
( this_communication, this_form ) := call antibiotic_guideline_mlm WITH this_communication, this_form, client_info_obj;
for item IN Antibiotics_Grid_Value do
item.IsReadonly := true;
enddo;
endif;
if ( CallingEvent = "FieldChange" ) then
//************ FLAGYL ********************
if ( CallingField = "PRX_Checkbox1|12" ) then
fieldValue := Flagyl_Chk.Value;
if ( fieldValue = true ) then
Flagyl_Oral.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, "";
elseif ( fieldValue = false ) then
Flagyl_Oral.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//********** VANCOMYCIN ********************
if ( CallingField = "PRX_Checkbox1|13" ) then
fieldValue := Vancomycin_Chk.Value;
if ( fieldValue = true ) then
Vancomycin.IsSelected := true;
Vancomycin_Dose.Value := (125 as number);
Vancomycin_Code.Value := "03346";
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, "";
elseif ( fieldValue = false ) then
Vancomycin.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//************** VANCOMYCIN + FLAGYL **************
if ( CallingField = "PRX_Checkbox1|14" ) then
fieldValue := Vanco_Flagyl_Chk.Value;
if ( fieldValue = true ) then
Vancomycin.IsSelected := true;
Flagyl_IV.IsSelected := true;
Vancomycin_Dose.Value := ( 500 as number );
Vancomycin_Code.Value := "03272";
exceptFld := exceptFld, Vanco_Enema_Chk.DataItemname || "|" || Vanco_Enema_Chk.Control_MultiFieldOccNum;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
Vancomycin.IsSelected := false;
Flagyl_IV.IsSelected := false;
if ( Vanco_Enema_Chk.Value = false ) then
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
endif;
//************** VANCOMYCIN ENEMA ********************
if ( CallingField = "PRX_Checkbox1|15" ) then
fieldValue := Vanco_Enema_Chk.Value;
if ( fieldValue = true ) then
Vancomycin_Enema.IsSelected := true;
exceptFld := exceptFld, Vanco_Flagyl_Chk.DataItemName || "|" || Vanco_Flagyl_Chk.Control_MultiFieldOccNum;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
Vancomycin_Enema.IsSelected := false;
if ( Vanco_Flagyl_Chk.Value = false ) then
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
endif;
endif; //End FieldChange
;;
evoke: // No evoke statement
;;
logic:
conclude True;
;;
action:
// This MLM returns two parameters, of types communication_type and form_type respectively.
return this_communication, this_form;
;;
end: