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

172 lines
6.1 KiB
Plaintext

maintenance:
title: Ordering: Prevent the selection of conflicting Isolation Types and require at least one type be selected;;
mlmname: FORM_Isolation_Field_Edits;;
arden: version 2;;
version: 4.50;;
institution: St Clair Isolation Set MLM;;
author: Don Warnick, Eclipsys Corp;;
specialist: ;;
date: 2006-08-24;;
validation: testing;;
library:
purpose: Prevent the simultaneous slection of two conflicting Isolation Types and require that at least one Isolation Type be entered
;;
explanation: This MLM is called from the Isolation form (ISO Isolation).
If Isolation Type, "Protective" is selected, then the "Intensive Protective" selection becomes unavailable and vice versa.
If any Isolation Type is selcted, then the "No Isolation" selection becomes unavailable and vice versa.
Also require that at least one Isolation Type be selected
Changes: 07/12/2011 JM Added logic to accomodate the new label for Enhanced Droplet. Also allows only either
Droplet or Enhanced Droplet to be chosen, not both. Project#25736
;;
keywords: Called MLMs, Form fields, Isolation
;;
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;
// 1. Hide the ISO Intensive Protective check box if the ISO Protective check box has been selected and vice versa
// 2. Hide the No Isolation check box if any Isolation type has been selected and vice versa
// 3. Require that an Isolation Type be selected before closing the form
airborne := last of (field_list where field_list.DataItemName = "Iso_Airborne" );
contact := last of (field_list where field_list.DataItemName = "Iso_Contact" );
droplet := last of (field_list where field_list.DataItemName = "Iso_Droplet" );
enhanceddroplet := last of (field_list where field_list.DataItemName = "Iso_Enhanced Droplet" ); // Added 07/12/2011
protective := last of (field_list where field_list.DataItemName = "Iso_Protective" );
intensive_protective := last of (field_list where field_list.DataItemName = "Iso_Intensive Protective" );
no_isolation := last of (field_list where field_list.DataItemName = "Iso_No Isolation" );
If CallingEvent="FormClose"
then
If (airborne.value = False) and
(contact.value = False) and
(droplet.value = False) and
(enhanceddroplet.value = False) and // Added 07/12/2011
(protective.value = False) and
(intensive_protective.value = False) and
(no_isolation.value = False)
then
this_communication.DisplayForm := "Yes";
this_communication.Message := "No Isolation Type was selected" || "\n" || "\n" || "Please check at least one of the boxes";
this_communication.MessageType := "Error";
endif;
elseif CallingEvent = "FieldChange"
then
If CallingField <> "Iso_No Isolation"
then
If airborne.Value = True or
contact.Value = True or
droplet.Value = True or
enhanceddroplet.value = True or // Added 07/12/2011
protective.value = True or
intensive_protective.value = True
then
no_isolation.control_read_only := True;
else
no_isolation.control_read_only := False;
endif;
/* Changes below for #25736 07/12/2011 ******************** */
If CallingField = "Iso_Enhanced Droplet"
then
If enhanceddroplet.value = True
then
droplet.control_read_only := True;
else
droplet.control_read_only := False;
endif;
elseif CallingField = "Iso_Droplet"
then
If droplet.value = True
then
enhanceddroplet.Control_read_only := True;
else
enhanceddroplet.Control_read_only := False;
endif;
endif;
/* Changes above for #25736 07/12/2011 ******************* */
If CallingField = "Iso_Protective"
then
If protective.value = True
then
intensive_protective.control_read_only := True;
else
intensive_protective.control_read_only := False;
endif;
elseif CallingField = "Iso_Intensive Protective"
then
If intensive_protective.value = True
then
protective.control_read_only := True;
else
protective.control_read_only := False;
endif;
endif;
elseif CallingField = "Iso_No Isolation"
then
If no_isolation.Value = True
then
airborne.control_read_only := True;
contact.control_read_only := True;
droplet.control_read_only := True;
enhanceddroplet.control_read_only := True; // added 07/12/2011
protective.control_read_only := True;
intensive_protective .control_read_only := True;
else
airborne.control_read_only := False;
contact.control_read_only := False;
droplet.control_read_only := False;
enhanceddroplet.control_read_only := False; // added 07/12/2011
protective .control_read_only := False;
intensive_protective .control_read_only := False;
endif;
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: