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

117 lines
3.6 KiB
Plaintext

maintenance:
title: Home Medications Form;;
mlmname: FORM_HOME_MEDS;;
arden: version 2;;
version: 4.50;;
institution: St Clair;;
author: Eclipsys Corp;;
specialist: Mary Jo Goodwin ;;
date: 2006-12-29;;
validation: testing;;
library:
purpose: Display appropriate fields depending on which type of med is displayed
;;
explanation: This MLM is called from the three Medication Type fields.
Only one of these three fields can be populated so when one has
a value the other two will grey out.
;;
keywords: Called MLMs, Form fields, Chemical Restraint
;;
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*******************/
/***************************************************************************************/
// Initialize error message
error_message:="";
// Assigns fields passed in the Form object to the Field object
field_list:= this_form.fields;
CallingField :=this_communication.CallingFieldName;
med_field := last of (field_list where field_list.DataItemName = "NUR_HM_MedicationDict" );
herbal_field := last of (field_list where field_list.DataItemName = "NUR_HM_Herbal Vita Splmts" );
unknown_field := last of (field_list where field_list.DataItemName = "NUR_HM_Med Name Unknown");
If CallingField = "NUR_HM_MedicationDict" then
If exists med_field.Value then
// if chemical restraint then hide the regular frequency field ,
herbal_field.control_read_only := TRUE;
herbal_field.control_mandatory := FALSE;
herbal_field.value := NULL;
unknown_field.control_read_only := TRUE;
unknown_field.control_mandatory := FALSE;
unknown_field.value := NULL;
else
herbal_field.control_read_only := FALSE;
herbal_field.control_mandatory := TRUE;
unknown_field.control_read_only := FALSE;
unknown_field.control_mandatory := TRUE;
endif;
Elseif CallingField = "NUR_HM_Herbal Vita Splmts" then
If exists herbal_field.value then
// if medical condition then make the regualr frequency field visible,
med_field.control_read_only := TRUE;
med_field.control_mandatory := FALSE;
med_field.value := NULL;
unknown_field.control_read_only := TRUE;
unknown_field.control_mandatory := FALSE;
unknown_field.value := NULL;
else
med_field.control_read_only := FALSE;
med_field.control_mandatory := TRUE;
unknown_field.control_read_only := FALSE;
unknown_field.control_mandatory := TRUE;
endif;
Elseif CallingField = "NUR_HM_Med Name Unknown" then
If exists unknown_field.value then
med_field.control_read_only := TRUE;
med_field.control_mandatory := FALSE;
med_field.value := NULL;
herbal_field.control_read_only := TRUE;
herbal_field.control_mandatory := FALSE;
herbal_field.value := NULL;
else
med_field.control_read_only := FALSE;
med_field.control_mandatory := TRUE;
herbal_field.control_read_only := FALSE;
herbal_field.control_mandatory := TRUE;
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: