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

126 lines
3.7 KiB
Plaintext

maintenance:
title: Test Base Solution Auto Fill;;
mlmname: FORM_PRX_AutoFill_Base;;
arden: version 2;;
version: 4.50;;
institution: St Clair Base Solution;;
author: Robert Spence, Eclipsys Corp;;
specialist: ;;
date: 2006-09-05;;
validation: testing;;
library:
purpose: This MLM sets the field PRN Base solution volume and units
;;
explanation: This MLM takes the data sent to CDS from Med order form fields in the Forms and
Communications objects and compares it to Client Information to determine whether to display
certain fields and make them mandatory.
A Banner message is presented to the user to remind them that these fields must be
completed.
If the patient data does not meet the above conditions the fields are not visible on
the form.
The MLM is not run from a trigger event, but rather is called by the application.
It should be configured to run on Form Open.
;;
keywords: Called MLMs, Form fields, PRN, PRN Reason text
;;
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;
CallingField :=this_communication.CallingFieldName;
CallingEvent :=this_communication.CallingEvent;
BaseSolution_obj := OBJECT [Name, ItemID, Dose, UOM, OrderCatalogMasterItemGUID];
BaseSolution_field := first of (field_list where field_list.DataItemName = "BaseSolution");
BaseSolution_Value := BaseSolution_field.Value;
ResetBase_field :=first of (field_list where field_list.DataItemName = "PRX_ResetDiluent");
If CallingField ="PRX_ResetDiluent"
then
If ResetBase_Field.Value = True
then
BaseSolution_field.control_read_only := False;
BaseSolution_Value.Name:="";
ResetBase_Field.Value := False;
ResetBase_Field.Control_Visible := False;
endif;
elseif CallingField = "BaseSolution"
then
If exists BaseSolution_field
then
If BaseSolution_Value.Name = "0.9% NaCl 500ml ."
then
BaseSolution_Value.Dose :=500;
BaseSolution_Value.UOM :="ML";
BaseSolution_field.control_read_only := True;
ResetBase_Field.Control_Visible := True;
elseif BaseSolution_Value.Name = "D5 0.45% NaCl 500ml ."
then
BaseSolution_Value.Dose :=500;
BaseSolution_Value.UOM :="ML";
BaseSolution_field.control_read_only := True;
ResetBase_Field.Control_Visible := True;
elseif BaseSolution_Value.Name = "D5W 100ml ."
then
BaseSolution_Value.Dose :=100;
BaseSolution_Value.UOM :="ML";
BaseSolution_field.control_read_only := True;
ResetBase_Field.Control_Visible := True; endif;
endif;
// this_communication.DisplayForm := "Yes";
// this_communication.Message := "Base Solution Field Is: " || BaseSolution_field || "\n" ||
// "Value of Same is : "|| BaseSolution_Value.Name;
// this_communication.MessageType := "Error";
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: