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

444 lines
20 KiB
Plaintext

maintenance:
title: FORM_SET_GU_ANTIBIOTICS;;
mlmname: FORM_SET_GU_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 GU Antibiotics order set
;;
explanation: This MLM is called from GU Antibiotics Order Set
Change history
05.09.2016 JML CSR 34091: Created for GU Antibiotic Order Set
08.18.2016 JML Adding Ceftazidime / removing Cefepime due to shortage.
02.13.2018 JML CSR 35885 / 36163: Replaced gentamicin with amikacin; replaced ceftriaxone with mini-syringes due to drug shortage
;;
keywords: Called MLMs, Antibiotic GU, 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:="";
display_field_mlm := mlm {{{SINGLE-QUOTE}}}FORM_FUNC_DISPLAY_FORM_FIELD{{{SINGLE-QUOTE}}};
enable_chkbx_mlm := mlm {{{SINGLE-QUOTE}}}FORM_Func_Disable_OS_Checkboxes{{{SINGLE-QUOTE}}};
calc_abw_mlm := mlm {{{SINGLE-QUOTE}}}FORM_FUNC_CALC_ADJUSTED_BODY_WEIGHT{{{SINGLE-QUOTE}}};
antibiotic_guideline_mlm := mlm {{{SINGLE-QUOTE}}}FORM_FUNC_DISPLAY_ANTIBIOTIC_GUIDELINES{{{SINGLE-QUOTE}}};
exceptFld := ();
ceftriaxone_logic_run := false;
gentamicin_logic_run := false;
amikacin_logic_run := false;
// 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
Bactrim_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 1 );
Nitofurantoin_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 2 );
Ceftriaxone_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 3 );
Cefuroxime_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 5 );
Ceftriaxone2_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 10 );
// Cefepime_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 12 );
Ceftriaxone3_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 11 );
// Cefepime2_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 13 );
// Gentamicin_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 14 );
Amikacin_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 21 );
Bactrim2_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 15 );
Ciprofloxacin_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 16 );
Meropenem_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 17 );
// Gentamicin2_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 18 );
Amikacin2_Chk := first of ( field_list WHERE field_list.DataItemname = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 22 );
Ceftazidime_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 20 );
Ceftazidime2_Chk := first of ( field_list WHERE field_list.DataItemName = "PRX_Checkbox1" AND field_list.Control_MultiFieldOccNum = 19 );
Antibiotics_Grid := first of ( field_list WHERE field_list.DataItemName = "MultiOrderGrid" AND field_list.Control_MultiFieldOccNum = 1 );
Antibiotics_Grid_Value := Antibiotics_Grid.Value;
Bactrim := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Sulfamethox 800mg/Trimeth 160mg DS Tab");
Nitofurantoin := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Nitrofurantoin Macro/Mono 100mg Cap");
Ceftriaxone := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Ceftriaxone:" OR Antibiotics_Grid_Value.Name = "Ceftriaxone Mini-Syringe" );
Cefuroxime := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Cefuroxime 250mg Tab");
// Cefepime := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Cefepime:");
// Gentamicin := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Gentamicin:");
Amikacin := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Amikacin:");
Ciprofloxacin := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Ciprofloxacin 500mg Tab");
Meropenem := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Meropenem:" );
Ceftazidime := first of ( Antibiotics_Grid_Value WHERE Antibiotics_Grid_Value.Name = "Ceftazidime:" );
Ceftriaxone_Dose := first of ( field_list WHERE field_list.DataItemName = "DosageLow" AND field_list.Control_MultiFieldOccNum = 1 );
Ceftriaxone_WORX_Code := first of ( field_list WHERE field_list.DataItemName = "PRX_DRUGIDCODE" AND field_list.Control_MultiFieldOccNum = 1 );
// Gentamicin_Dose := first of ( field_list WHERE field_list.DataItemName = "DosageLow" AND field_list.Control_MultiFieldOccNum = 2 );
Amikacin_Dose := first of ( field_list WHERE field_list.DataItemName = "DosageLow" AND field_list.Control_MultiFieldOccNum = 3 );
ABW_Val := first of (field_list WHERE field_list.DataItemName = "PRX_ADJBodyWeight" 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
( 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
//********* Height / Weight Measurements *******
if ( CallingField = "CombinedMeasurements|1" ) then
if ( Ceftriaxone_Chk.Value = true OR Ceftriaxone2_Chk.Value = true OR Ceftriaxone3_Chk.Value = true ) then
ceftriaxone_logic_run := true;
endif;
if ( Amikacin_Chk.Value = true OR Amikacin2_Chk.Value = true ) then
amikacin_logic_run := true;
endif;
/*
if ( Gentamicin_Chk.Value = true OR Gentamicin2_Chk.Value = true ) then
gentamicin_logic_run := true;
endif;
*/
endif;
//************ BACTRIM *******************
if ( CallingField = "PRX_Checkbox1|1" OR CallingField = "PRX_Checkbox1|15" ) then
if ( CallingField = "PRX_Checkbox1|1" ) then
fieldValue := Bactrim_Chk.Value;
elseif ( CallingField = "PRX_Checkbox1|15" ) then
fieldValue := Bactrim2_Chk.Value;
endif;
if ( fieldValue = true ) then
Bactrim.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, "";
elseif ( fieldValue = false ) then
Bactrim.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//********* NITOFURANTOIN *****************
if ( CallingField = "PRX_Checkbox1|2" ) then
fieldValue := Nitofurantoin_Chk.Value;
if ( fieldValue = true ) then
Nitofurantoin.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, "";
elseif ( fieldValue = false ) then
Nitofurantoin.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//****************** CEFTRIAXONE **********************
if ( CallingField = "PRX_Checkbox1|3" OR CallingField = "PRX_Checkbox1|10" OR CallingField = "PRX_Checkbox1|11" ) then
if ( CallingField = "PRX_Checkbox1|3" ) then
fieldValue := Ceftriaxone_Chk.Value;
elseif ( CallingField = "PRX_Checkbox1|10" ) then
fieldValue := Ceftriaxone2_Chk.Value;
elseif ( CallingField = "PRX_Checkbox1|11" ) then
fieldValue := Ceftriaxone3_Chk.Value;
// exceptFld := exceptFld, Gentamicin_Chk.DataItemName || "|" || Gentamicin_Chk.Control_MultiFieldOccNum;
exceptFld := exceptFld, Amikacin_Chk.DataItemName || "|" || Amikacin_Chk.Control_MultiFieldOccNum;
endif;
if ( fieldValue = true ) then
Ceftriaxone.IsSelected := true;
ceftriaxone_logic_run := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
ceftriaxone_logic_run := false;
Ceftriaxone.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//*********** CEFUROXIME ********************
if ( CallingField = "PRX_Checkbox1|5" ) then
fieldValue := Cefuroxime_Chk.Value;
if ( fieldValue = true ) then
Cefuroxime.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, "";
elseif ( fieldValue = false ) then
Cefuroxime.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//******************* CEFEPIME **********************
/*
if ( CallingField = "PRX_Checkbox1|12" OR CallingField = "PRX_Checkbox1|13" ) then
if ( CallingField = "PRX_Checkbox1|12" ) then
fieldValue := Cefepime_Chk.Value;
elseif ( CallingField = "PRX_Checkbox1|13" ) then
fieldValue := Cefepime2_Chk.Value;
exceptFld := exceptFld, Gentamicin_Chk.DataItemName || "|" || Gentamicin_Chk.Control_MultiFieldOccNum;
endif;
if ( fieldValue = true ) then
Cefepime.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
Cefepime.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
*/
//*********** CEFTAZIDIME *******************
if ( CallingField = "PRX_Checkbox1|19" OR CallingField = "PRX_Checkbox1|20" ) then
if ( CallingField = "PRX_Checkbox1|19" ) then
fieldValue := Ceftazidime2_Chk.Value;
elseif ( CallingField = "PRX_Checkbox1|20" ) then
fieldValue := Ceftazidime_Chk.Value;
// exceptFld := exceptFld, Gentamicin_Chk.DataItemName || "|" || Gentamicin_Chk.Control_MultiFieldOccNum;
exceptFld := exceptFld, Amikacin_Chk.DataItemName || "|" || Amikacin_Chk.Control_MultiFieldOccNum;
endif;
if ( fieldValue = true ) then
Ceftazidime.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
Ceftazidime.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//*********** GENTAMICIN **********************
/*
if ( CallingField = "PRX_Checkbox1|14" OR CallingField = "PRX_Checkbox1|18" ) then
if ( CallingField = "PRX_Checkbox1|14" ) then
fieldValue := Gentamicin_Chk.Value;
exceptFld := exceptFld, Ceftriaxone3_Chk.DataItemName || "|" || Ceftriaxone3_Chk.Control_MultiFieldOccNum;
exceptFld := exceptFld, Ceftazidime_Chk.DataItemName || "|" || Ceftazidime_Chk.Control_MultiFieldOccNum;
elseif ( CallingField = "PRX_Checkbox1|18" ) then
fieldValue := Gentamicin2_Chk.Value;
exceptFld := exceptFld, Meropenem_Chk.DataItemName || "|" || Meropenem_Chk.Control_MultiFieldOccNum;
endif;
if ( fieldValue = true ) then
Gentamicin.IsSelected := true;
gentamicin_logic_run := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
Gentamicin.IsSelected := false;
gentamicin_logic_run := false;
endif;
endif;
*/
//*********** AMIKACIN *********************************
if ( CallingField = "PRX_Checkbox1|21" OR CallingField = "PRX_Checkbox1|22" ) then
if ( CallingField = "PRX_Checkbox1|21" ) then
fieldValue := Amikacin_Chk.Value;
exceptFld := exceptFld, Ceftriaxone3_Chk.DataItemName || "|" || Ceftriaxone3_Chk.Control_MultiFieldOccNum;
exceptFld := exceptFld, Ceftazidime_Chk.DataItemName || "|" || Ceftazidime_Chk.Control_MultiFieldOccNum;
elseif ( CallingField = "PRX_Checkbox1|22" ) then
fieldValue := Amikacin2_Chk.Value;
exceptFld := exceptFld, Meropenem_Chk.DataItemName || "|" || Meropenem_Chk.Control_MultiFieldOccNum;
endif;
if ( fieldValue = true ) then
Amikacin.IsSelected := true;
amikacin_logic_run := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
Amikacin.IsSelected := false;
amikacin_logic_run := false;
if ( CallingField = "PRX_Checkbox1|21" AND Ceftriaxone3_Chk.Value = false AND Ceftazidime_Chk.Value = false ) then
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
if ( CallingField = "PRX_Checkbox1|22" AND Meropenem_Chk.Value = false ) then
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
endif;
//*********** CIPROFLOXACIN ******************
if ( CallingField = "PRX_Checkbox1|16" ) then
fieldValue := Ciprofloxacin_Chk.Value;
if ( fieldValue = true ) then
Ciprofloxacin.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, "";
elseif ( fieldValue = false ) then
Ciprofloxacin.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
//********** MEROPENEM ***********************
if ( CallingField = "PRX_Checkbox1|17" ) then
fieldValue := Meropenem_Chk.Value;
// exceptFld := exceptFld, Gentamicin2_Chk.DataItemName || "|" || Gentamicin2_Chk.Control_MultiFieldOccNum;
exceptFld := exceptFld, Amikacin2_Chk.DataItemName || "|" || Amikacin2_Chk.Control_MultiFieldOccNum;
if ( fieldValue = true ) then
Meropenem.IsSelected := true;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, true, exceptFld;
elseif ( fieldValue = false ) then
Meropenem.IsSelected := false;
rtnValue := call enable_chkbx_mlm WITH this_communication, this_form, client_info_obj, CallingField, false, "";
endif;
endif;
endif; //End FieldChange
if ( ceftriaxone_logic_run = true ) then
if ( weightvalue = 0 OR weightvalue IS NULL ) then
//Display message that weight is missing
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "Weight Based Dosing Requires Weight To Be Entered." , "Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
else
if ( weightvalue < 80 ) then
Ceftriaxone_Dose.Value := ( 1 as number );
if ( Ceftriaxone.Name = "Ceftriaxone:" ) then
Ceftriaxone_WORX_Code.Value := "08561P";
elseif ( Ceftriaxone.Name = "Ceftriaxone Mini-Syringe" ) then
Ceftriaxone_WORX_Code.Value := "08561";
endif;
elseif ( weightvalue >= 80 ) then
Ceftriaxone_Dose.Value := ( 2 as number );
if ( Ceftriaxone.Name = "Ceftriaxone:" ) then
Ceftriaxone_WORX_Code.Value := "08555P";
elseif ( Ceftriaxone.Name = "Ceftriaxone Mini-Syringe" ) then
Ceftriaxone_WORX_Code.Value := "08555";
endif;
endif;
endif;
endif;
/*
if ( gentamicin_logic_run = true ) then
//Calculate Gentamicin dosing
//Get ABW
if ( weightvalue = 0 OR weightvalue IS NULL OR ht = 0 OR ht IS NULL ) then
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "Weight Based Dosing Requires Height & Weight To Be Entered.", "Alert", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
else
this_communication, this_form, ABW := call calc_abw_mlm WITH this_communication, this_form, client_info_obj;
ABW_Val.Value := ( ABW as number );
rawGentDose := ( ( ABW as number ) * 5);
roundingFactor := 20;
halfRoundingFactor := 10;
rounded_dose := int((rawGentDose + halfRoundingFactor)/roundingFactor) * roundingFactor;
Gentamicin_Dose.Value := rounded_dose;
endif;
endif;
*/
if ( amikacin_logic_run = true ) then
//Calculate Amikacin dosing
//Get ABW
if ( weightvalue = 0 OR weightvalue IS NULL OR ht = 0 OR ht IS NULL ) then
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "Weight Based Dosing Requires Height & Weight To Be Entered.", "Alert", "OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
else
this_communication, this_form, ABW := call calc_abw_mlm WITH this_communication, this_form, client_info_obj;
ABW_Val.Value := ( ABW as number );
rawAmikDose := ( ( ABW as number ) * 7.5);
roundingFactor := 25;
halfRoundingFactor := 12.5;
rounded_dose := int((rawAmikDose + halfRoundingFactor)/roundingFactor) * roundingFactor;
Amikacin_Dose.Value := rounded_dose;
endif;
endif;
;;
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: