Initial Checking with all 820 MLMs

This commit is contained in:
2020-02-02 00:54:01 -05:00
parent c59dc6de2e
commit 840d0432f4
828 changed files with 239162 additions and 0 deletions

View File

@@ -0,0 +1,230 @@
maintenance:
title: Intravenous Immune Globulin Orders;;
mlmname: FORM_Set_IVIG_Dosing;;
arden: version 2.5;;
version: 16.30;;
institution: St Clair Hospital;;
author: Teresa Spicuzza, Allscripts ext 7448;;
specialist: Teresa Spicuzza, Allscripts ext 7448;;
date: 2018-11-07;;
validation: testing;;
library:
purpose: Used for Intravenous Immune Globulin Dosing (Privigen).
;;
explanation: This MLM is called from the Intravenous Immune Globulin Orders
Change history
01.23.2019 TMS CSR 37605 and CSR 37612: Initial build
;;
keywords: Called MLMs, IVIG, Privigen, Intranvenous Immune Globulin 10% Liquid
;;
knowledge:
type: data-driven;;
data:
// 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;
/*******************Make Changes To Spelling And Flags In This Section*******************/
/* Set to true if a decision.log is needed.*/
log_execution_info := FALSE;
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
include standard_libs;
/***************************************************************************************/
// Initialize error message
error_message:="";
// Assigns fields passed in the Form object to the Field object
field_list:= this_form.fields;
CallingEvent := this_communication.CallingEvent;
CallingField := this_communication.CallingFieldName;
CR := 13 formatted with "%c";
LF := 10 formatted with "%c";
CRLF:= CR||LF;
TAB := 9 formatted with "%c";
MgPerKg:= last of (field_list where field_list.DataItemName = "PRX_DosePerKg" and field_List.Control_MultiFieldOccNum = 1);
FixedDose:= last of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 1);
OrderedDose := last of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 2);
OrderGrid:= last of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 1);
OrderGrid_List := OrderGrid.Value;
RateInfo := last of (field_list where field_list.DataItemName = "AdminInstructions" and field_List.Control_MultiFieldOccNum = 1);
OtherMedGrid:= last of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 7);
OtherMedGrid_List := OtherMedGrid.Value;
ReactionMedGrid:= last of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 8);
ReactionMedGrid_List := ReactionMedGrid.Value;
Diphenhydramine_Order := first of (ReactionMedGrid_List where ReactionMedGrid_List.Name = "Diphenhydramine Inj");
MethylPREDNISolone_Order := first of (ReactionMedGrid_List where ReactionMedGrid_List.Name = "MethylPREDNISolone Inj");
MLMTextBox := last of (field_list where field_list.DataItemName = "PRX_Generic_Text_Box" and field_List.Control_MultiFieldOccNum = 1);
DoseInfo1:= last of (field_list where field_list.DataItemName = "PRX_Dosing_Info" and field_List.Control_MultiFieldOccNum = 1);
DoseInfo2:= last of (field_list where field_list.DataItemName = "PRX_Dosing_Info" and field_List.Control_MultiFieldOccNum = 2);
EntryTime := (now as time) ;
GiveMinute := extract minute EntryTime;
GiveHour := extract hour EntryTime;
TitrateRate := "Initial Infusion Rate: 0.3 mL/kg/hour, for first 30 minutes" || CRLF
|| "If tolerated, infusion rate can be titrated as follows:" || CRLF
|| TAB || " 0.6 mL/kg for 30 minutes, then" || CRLF
|| TAB || " 0.9 mL/kg for 30 minutes, then" || CRLF
|| TAB || " 1.2 mL/kg for 30 minutes" || CRLF ||CRLF
|| TAB || "Maximum infusion rate: 2.4 mL/kg/hr";
Info1 := "Initial Infusion Rate: 0.3 mL/kg/hour, for first 30 minutes" ||TAB || TAB || "**Maximum infusion rate: 2.4 mL/kg/hr **"|| CRLF
|| "If tolerated, infusion rate can be titrated as follows:" || CRLF
|| TAB || " 0.6 mL/kg for 30 minutes, then" || CRLF
|| TAB || " 0.9 mL/kg for 30 minutes, then" || CRLF
|| TAB || " 1.2 mL/kg for 30 minutes";
RateInfo.value := TitrateRate;
DoseInfo1.value := Info1;
needweight := true;
// 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;
weightvalue := (wt as number);
If weightvalue is not null and weightvalue <> 0 then
needweight := false;
endif;
Endif;
If CallingEvent = "FieldChange" and CallingField = "CombinedMeasurements|1"
and MgPerKg.value is not null
and FixedDose.value is null then
RawDose := ((wt as number) * (MgPerKg.value as number)/1000);
OrderedDose.value := int((RawDose + 2.5)/5) * 5;
endif;
If CallingEvent = "FieldChange" and CallingField = "MultiOrderGrid|7" then
index_list := 1 seqto (count OtherMedGrid_List) ;
ReadOnlyMeds := ();
if true in OtherMedGrid_List.IsSelected then
for i in index_list do
If (OtherMedGrid_List.IsSelected[i]= true) then
ReadOnlyMeds := (ReadOnlyMeds ,false);
else
ReadOnlyMeds := (ReadOnlyMeds ,true);
endif;
enddo;
else
for i in index_list do
ReadOnlyMeds := (ReadOnlyMeds ,false);
enddo;
endif;
OtherMedGrid_List.IsReadOnly := ReadOnlyMeds ;
endif;
If CallingEvent = "FieldChange" and CallingField = "MultiOrderGrid|8" then
If Diphenhydramine_Order.IsSelected = True and MLMTextBox.value is null then
MethylPREDNISolone_Order.IsSelected := True;
MLMTextBox.value := "D";
elseif Diphenhydramine_Order.IsSelected = False and (MLMTextBox.value = "D" or MLMTextBox.value = "M") then
MethylPREDNISolone_Order.IsSelected := False;
MLMTextBox.value := "";
elseIf MethylPREDNISolone_Order.IsSelected = True and MLMTextBox.value is null then
Diphenhydramine_Order.IsSelected := True;
MLMTextBox.value := "M";
elseif MethylPREDNISolone_Order.IsSelected = False and (MLMTextBox.value = "D" or MLMTextBox.value = "M") then
Diphenhydramine_Order.IsSelected := False;
MLMTextBox.value := "";
endif;
endif;
If CallingEvent = "FieldChange" and CallingField = "PRX_DosePerKg|1" then
If FixedDose.value is not null then
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "You have already entered a value for FIXED Dosing."
||" \n\n Choose YES to continue with the entered FIXED Dose."
||" \n\n Choose NO to continue with WEIGHT BASED Dosing." ,"Alert","YesNo" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
if((dialogResult as string) = "Yes") then
MgPerKg.value := null;
FixedDoseNumber := (FixedDose.value as number);
OrderedDose.value := int((FixedDoseNumber + 2.5)/5) * 5;
elseif ((dialogResult as string) = "No") then
FixedDose.value := null;
endif;
endif;
If FixedDose.value is null then
If Needweight = true then
dialogResult2 := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with " Please enter a weight to"|| CRLF ||
"calculate Weight Based Dosing.", "Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
Else
RawDose := ((wt as number) * (MgPerKg.value as number)/1000);
OrderedDose.value := int((RawDose + 2.5)/5) * 5;
endif;
endif;
endif;
If CallingEvent = "FieldChange" and CallingField = "DosageLow|1" then
If MgPerKg.value is not null then
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "You have already entered a value for WEIGHT BASED Dosing."
||" \n\n Choose YES to continue with WEIGHT BASED Dosing."
||" \n\n Choose NO to continue with the entered FIXED Dose." ,"Alert","YesNo" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
if((dialogResult as string) = "Yes") then
If Needweight = true then
dialogResult2 := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with " Please enter a weight to"|| CRLF ||
"calculate Weight Based Dosing.", "Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
Else
RawDose := ((wt as number) * (MgPerKg.value as number)/1000);
OrderedDose.value := int((RawDose + 2.5)/5) * 5;
FixedDose.value := null;
endif;
elseif ((dialogResult as string) = "No") then
MgPerKg.value := null;
endif;
endif;
If MgPerKg.value is null then
FixedDoseNumber := (FixedDose.value as number);
OrderedDose.value := int((FixedDoseNumber + 2.5)/5) * 5;
endif;
endif;
If callingevent = "FormClose" then
Med_Order_Mgt := mlm {{{SINGLE-QUOTE}}}FORM_SET_Rx_Medication_Order_Mgt{{{SINGLE-QUOTE}}};
(this_communication, this_form) := call Med_Order_Mgt with this_communication, this_form, client_info_obj;
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: