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

217 lines
7.4 KiB
Plaintext

maintenance:
title: St.Clair: Promod selection on tube feeds;;
mlmname: FORM_Diet_TubeFeed_Promod;;
arden: version 2;;
version: 4.50;;
institution: St Clair;;
author: Don Warnick, Eclipsys Corp;;
specialist: ;;
date: 2006-08-23;;
validation: testing;;
library:
purpose: Value the DIET_DSS_Supplement with Promod if the Promod Check Box is selected.
;;
explanation: This MLM is called from two forms, the DIET_TubeFeed.
It values the DIET_DSS_Supplement with Protein Powder if the Add Protien Powder Check Box is checked.
It values the DIET_DSS_Supplement with blanks if the Add Protien Powder Check Box is unchecked.
Change history
09.08.2009 JM Changes made to make the Prosource Frequency mandatory if Add Prosource Liquid Protein is selected.
09.08.2009 JM Also, added requirement that two fields be mandatory if Selectable Add Banana Flakes is checked.
09.09.2011 MJP Changed supplement field value from Prosource Liquid Protein to LiquaCel Liquid Protein Vary.
09.02.2014 DW CSR# 32365 - Additional fields become mandatory when continuous schedule is selected
04.26.2016 DW CSR# 34212 - Dietitian May Modify button selection
;;
keywords: Called MLMs, Form fields, Protein Powder
;;
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;
/***************************************************************************************/
// 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;
// Value the Diet_DSS_Supplement field based upon the status of the Protein Powder Check Box
Supplement_Field := last of (field_list where field_list.DataItemName = "DIET_DSS_Protein" );
AddPromod_Field := last of (field_list where field_list.DataItemName = "DIET_Add Promod" );
scoops := last of (field_list where field_list.DataItemName = "DIET_TUBE_VL_scoops_# Scoops" );
ProFreq := last of (field_list where field_list.DataItemName = "DIET_Add Protein Frequency"); //23047
Banana_Field := last of (field_list where field_list.DataItemName = "DIET_DSS_Banana"); //23047
BFlakes_Field := last of (field_list where field_list.DataItemName = "DIET_Banana Flakes"); //23047
Flakes := (field_list where field_list.DataItemName = "DIET_#Packets_Banana Flakes"); //23047
BFFreq := (field_list where field_list.DataItemName = "DIET_Add Banana Frequency"); //23047
schedule := last of (field_list where field_list.DataItemName = "DIET_Tube Feed Schedule" );
amount := last of (field_list where field_list.DataItemName = "DIET_TUBE_VL_cc_AMOUNT" );
frequency:= last of (field_list where field_list.DataItemName = "DIET_TUBE_VO_Frequency" );
flowstart := last of (field_list where field_list.DataItemName = "DIET_TUBE_VL_mL/hr Start Rate" );
flowgoal := last of (field_list where field_list.DataItemName = "DIET_TUBE_VL_mL/hr Goal Rate" );
feedadv := last of (field_list where field_list.DataItemName = "DIET_Tube Feed Advance" );
feedadvfreq:= last of (field_list where field_list.DataItemName = "DIET_Tube Feed Adv Freq" );
Dietitian_May_Modify_SummaryLine:= last of (field_list where field_list.DataItemName = "DIET_May Not Modify" );
Dietitian_May_Modify_Selection := last of (field_list where field_list.DataItemName = "DIET_May Modify" );
// FIELD CHANGE
if (CallingEvent = "FieldChange") then
// If the "Dietitian May Modfiy" button is de-selected, select the special instructions box "Not to be modified by dietitian"
If CallingField="DIET_May Modify" then
If Dietitian_May_Modify_Selection.Value = true
then
Dietitian_May_Modify_SummaryLine.Value := false;
endif;
If Dietitian_May_Modify_Selection.Value = false
then
Dietitian_May_Modify_SummaryLine.Value := true;
endif;
endif;
endif; // Field Change
// FORM CLOSE
If CallingEvent = "FormCLose"
then
If schedule.value = "Continuous" and flowstart.value is null and flowgoal.value is null
then
this_communication.Message := " Flow Rate Required "; this_communication.MessageType := "Informational";
endif;
else
If AddPromod_Field.value = true
then
Supplement_Field.value := "LiquaCel Liquid Protein Vary";
scoops.control_mandatory:= true;
scoops.control_read_only:=false;
ProFreq.control_mandatory:= true;
ProFreq.control_read_only:=false;
else
Supplement_Field.value := "";
scoops.control_mandatory:= false;
scoops.control_read_only:=true;
ProFreq.control_mandatory:= false;
ProFreq.control_read_only:=true;
scoops.value := "";
ProFreq.value := "";
endif;
If BFlakes_Field.value = true
then
Banana_Field.value := "Banana Flakes";
Flakes.control_mandatory:= true;
Flakes.control_read_only:=false;
BFFreq.control_mandatory:= true;
BFFreq.control_read_only:=false;
else
Banana_Field.value := "";
Flakes.control_mandatory:= false;
Flakes.control_read_only:=true;
BFFreq.control_mandatory:= false;
BFFreq.control_read_only:=true;
Flakes.value := "";
BFFreq.value := "";
endif;
If schedule.value = "Continuous"
then
// flowstart.control_mandatory:=true;
flowstart.control_read_only:=false;
// flowgoal.control_mandatory:=true;
flowgoal.control_read_only:=false;
// feedadv.control_mandatory:=true;
feedadv.control_read_only:=false;
// feedadvfreq.control_mandatory:=true;
feedadvfreq.control_read_only:=false;
amount.control_mandatory:=false;
amount.control_read_only:=true;
amount.value := "";
frequency.control_mandatory:=false;
frequency.control_read_only:=true;
frequency.value := "";
elseif schedule.value="Intermittent"
then
amount.control_mandatory:=true;
amount.control_read_only:=false;
frequency.control_mandatory:=true;
frequency.control_read_only:=false;
flowstart.control_mandatory:=false;
flowstart.control_read_only:=true;
flowstart.value := "";
flowgoal.control_mandatory:=false;
flowgoal.control_read_only:=true;
flowgoal.value := "";
feedadv.control_mandatory:=false;
feedadv.control_read_only:=true;
feedadv.value := "";
feedadvfreq.control_mandatory:=false;
feedadvfreq.control_read_only:=true;
feedadvfreq.value := "";
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: