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

181 lines
6.0 KiB
Plaintext

maintenance:
title:Pharmacy Non Form Meds MLM;;
mlmname:FORM_NON_FORMMEDS;;
arden: version 2;;
version: 4.50;;
institution: St Clair Non Form Meds;;
author: Robert Spence, Eclipsys Corp;;
specialist: ;;
date: 2007-01-26;;
validation: testing;;
library:
purpose: This MLM sets the protected values of the non form meds forms
;;
explanation: This MLM is launched on the change of the verified by pharmacy checkbox/
;;
keywords: Called MLMs, Form fields, Protected, non formulary
;;
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;
FormType := this_communication.FormType;
opening_msg := "Use only for Medications not found through "
|| "manual entry or Non Formulary order set.\n\n"
|| "Verify Medication availability with Pharmacy before "
|| "continuing with order.\n\n"
|| "Check the Continue with non formulary Med box on the form to\n"
|| "proceed with this order";
// Assigning form fields to MLM fields
Prx_Check:= last of (field_list
where field_list.DataItemName = "PRX_Checkbox1" );
BrandName := last of (field_list
where field_list.DataItemName = "PRX_BRANDNAME" );
AdminIns := last of (field_list
where field_list.DataItemName = "AdminInstructions" );
Fluid := last of (field_list
where field_list.DataItemName = "BaseSolution" );
DosageLow := last of (field_list
where field_list.DataItemName = "DosageLow" );
DosageHigh := last of (field_list
where field_list.DataItemName = "DosageHigh" );
Uom := last of (field_list
where field_list.DataItemName = "UOM" );
Route := last of (field_list
where field_list.DataItemName = "OrderRouteCode" );
Frequency := last of (field_list
where field_list.DataItemName = "FrequencyCode" );
PRN := last of (field_list
where field_list.DataItemName = "IsPRN" );
Reason := last of (field_list
where field_list.DataItemName = "PRX_PRNCONDITION" );
StopAfter := last of (field_list
where field_list.DataItemName = "StopAfter" );
ReqDate := last of (field_list
where field_list.DataItemName = "RequestedDate" );
ReqTime := last of (field_list
where field_list.DataItemName = "RequestedTime" );
StopDate := last of (field_list
where field_list.DataItemName = "StopDate" );
StopTime := last of (field_list
where field_list.DataItemName = "StopTime" );
If CallingEvent = "FormOpen" then
BrandName.control_read_only:=True;
AdminIns.control_read_only:=True;
Fluid.control_read_only:=True;
DosageLow.control_read_only:=True;
DosageHigh.control_read_only:=True;
Uom.control_read_only:=True;
Route.control_read_only:=True;
Frequency.control_read_only:=True;
PRN.control_read_only:=True;
Reason.control_read_only:=True;
StopAfter.control_read_only:=True;
ReqDate.control_read_only:=True;
ReqTime.control_read_only:=True;
StopDate.control_read_only:=True;
StopTime.control_read_only:=True;
this_communication.Message:= opening_msg;
this_communication.MessageType := "Informational";
elseif callingevent ="FormClose" then
If Prx_Check.Value = false then
this_communication.DisplayForm := "Yes";
this_communication.Message := "Please check the Continue With Non Formulary Med Field";
this_communication.MessageType := "Error";
endif;
elseif CallingField = "PRX_CheckBox1" then
If Prx_Check.Value = True then
BrandName.control_read_only:=False;
AdminIns.control_read_only:=False;
Fluid.control_read_only:=False;
DosageLow.control_read_only:=False;
DosageHigh.control_read_only:=False;
Uom.control_read_only:=False;
Route.control_read_only:=False;
Frequency.control_read_only:=False;
PRN.control_read_only:=False;
Reason.control_read_only:=False;
StopAfter.control_read_only:=False;
ReqDate.control_read_only:=False;
ReqTime.control_read_only:=False;
StopDate.control_read_only:=False;
StopTime.control_read_only:=False;
else
BrandName.control_read_only:=True;
AdminIns.control_read_only:=True;
Fluid.control_read_only:=True;
DosageLow.control_read_only:=True;
DosageHigh.control_read_only:=True;
Uom.control_read_only:=True;
Route.control_read_only:=True;
Frequency.control_read_only:=True;
PRN.control_read_only:=True;
Reason.control_read_only:=True;
StopAfter.control_read_only:=True;
ReqDate.control_read_only:=True;
ReqTime.control_read_only:=True;
StopDate.control_read_only:=True;
StopTime.control_read_only:=True;
endif;
endif;
// this_communication.DisplayForm := "Yes";
// this_communication.Message := "MLM Field :" || CallingField || "\n" ||
// "MLM Event :" || CallingEvent || "\n" ||
// "Form type :" || FormType;
// this_communication.MessageType := "Informational";
;;
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: