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

158 lines
5.7 KiB
Plaintext

maintenance:
title: Infliximab Infusion Reaction ;;
filename: FORM_Infliximab_Reaction;;
arden: version 2.5;;
version: 16.3;;
institution: St. Clair;;
author: Teresa Spicuzza;;
specialist: ;;
date: 2018-12-12;;
validation: testing;;
library:
purpose: This MLM sets the Reaction Symptoms to mandatory when Yes to reaction is checked.
;;
explanation: This MLM sets the Reaction Symptoms to mandatory when Yes to reaction is checked.
.
History:
01.22.2018 TMS CSR 37640 MLM to make the reaction symptoms mandatory when patient noted to have reaction to Infliximab.
MLM will retrieve last documented order and present info to user.
;;
keywords: Called MLMs,
;;
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*******************/
log_execution_info := FALSE;
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
include standard_libs;
/***************************************************************************************/
CallingEvent := this_communication.CallingEvent;
CallingField := this_communication.CallingFieldName;
comm_obj := this_communication.primaryobj;
/***************************************************************************************/
// Initialize error message
error_message:="";
// Assigns fields passed in the Form object to the Field object
field_list:= this_form.fields;
YesBox := last of (field_list where field_list.DataItemName = "Checkbox" );
YesBox_value := YesBox.value;
NoBox := last of (field_list where field_list.DataItemName = "Checkbox 1" );
NoBox_value := NoBox.value;
ReactionSymptoms := first of ( field_list WHERE field_list.DataItemName = "GenericTextBox");
ClientGuid := this_communication.ClientGUID;
OrderCatGuid := this_communication.ItemID;
CR := 13 formatted with "%c";
LF := 10 formatted with "%c";
CRLF:= CR||LF;
TAB := 9 formatted with "%c";
Reaction, DateCharted, DataCode := read last {"
select top 1 oud.value, oud.CreatedWhen, oud.UserDataCode from cv3order o
join CV3OrderUserData oud on oud.OrderGUID = o.guid
where o.ordercatalogmasteritemguid = " || OrderCatGuid || "
and o.ClientGUID = " || ClientGuid || "
and (oud.UserDataCode = {{{SINGLE-QUOTE}}}GenericTextBox{{{SINGLE-QUOTE}}} or oud.UserDataCode = {{{SINGLE-QUOTE}}}Checkbox 1{{{SINGLE-QUOTE}}})
order by oud.CreatedWhen desc" };
If (DataCode = "Checkbox 1" or DataCode is Null) then
ReactionHx := "False";
Else
ReactionHx := "True";
Endif;
If CallingEvent = "FieldChange" then
If CallingField = "Checkbox" and YesBox_value = true then
ReactionSymptoms.control_mandatory := true;
NoBox.value := false;
If ReactionHx = "True" then
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "This patient has a previous reaction documented on " || DateCharted
||" \n Reaction/Symptoms: " || Reaction
||" \n\n Choose YES if you would like this reaction added to the current order"
||" \n\n Choose NO to continue with your own dialog" ,"Alert","YesNo" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
if((dialogResult as string) = "Yes") then
ReactionSymptoms.value := Reaction;
endif;
endif;
Elseif CallingField = "Checkbox" and YesBox_value = false then
ReactionSymptoms.control_mandatory := false;
ReactionSymptoms.value := null;
Elseif CallingField = "Checkbox 1" and NoBox_value = true and ReactionHx = "False" then
ReactionSymptoms.control_mandatory := false;
YesBox.value := false;
ReactionSymptoms.value := null;
Elseif CallingField = "Checkbox 1" and NoBox_value = true and ReactionHx = "True" then
dialogResult2 := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "This patient has a previous reaction documented on " || DateCharted
||" \n Reaction/Symptoms: " || Reaction
||" \n\n Choose YES if you would like this reaction added to the current order and Previous Reaction changed to YES"
||" \n\n Choose NO to continue documenting as NO previous reaction." ,"Alert","YesNo" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
if((dialogResult2 as string) = "Yes") then
ReactionSymptoms.control_mandatory := true;
YesBox.value := true;
NoBox.value := false;
ReactionSymptoms.value := Reaction;
elseif ((dialogResult2 as string) = "No") then
ReactionSymptoms.control_mandatory := false;
YesBox.value := false;
ReactionSymptoms.value := null;
endif;
endif;
endif;
If CallingEvent = "FormClose" then
If YesBox.Value = false and NoBox.Value = false then
hardstop := "yes";
ReasonMessage := "Please answer YES or NO to {{{SINGLE-QUOTE}}}Previous Reaction to Infliximab?{{{SINGLE-QUOTE}}} to continue.";
else hardstop := "no";
endif;
If hardstop = "yes" then //Present user with message box and stop order set from being submitted.
this_communication.DisplayForm := "yes";
this_communication.Message := ReasonMessage;
this_communication.MessageType := "Error";
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: