maintenance: title: if Dose Unknown the last dose and time no longer mandatory;; filename: FORM_UnknownLastDose_TDM;; arden: version 2;; version: 4.50;; institution: Eclipsys, System MLM;; author: Beth Hilty and Teresa Spicuzza;; specialist: ;; date: 2006-03-14;; validation: testing;; library: purpose: This MLM sets the date and time of the last dose fields to not mandatory when last dose unknown is checked on form. ;; explanation: This MLM sets the date and time of the last dose fields to not mandatory when last dose unknown is checked on form. The MLM is not run from a trigger event, but rather is called by the application. Change History 11.01.2010 TMS Added logic for hold session - if priority is scheduled time make field not mandatory allowing the order to be placed in hold without time entered. This forces the time to be entered upon release. ;; keywords: Called MLMs, Form fields, Dose last given unknown ;; 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; comm_obj := this_communication.primaryobj; called_by := this_communication.CallingEvent; call_field := this_communication.CallingFieldName; // This sets the visible control on the field dataitem - PRX_PRN_Reason Unknown_Dose_field := last of (field_list where field_list.DataItemName = "LAB_Chem_CB_TDM" ); Date_field := first of (field_list where field_list.DataItemName = "LAB_Chem_Date_TDM"); Time_field := first of (field_list where field_list.DataItemName = "LAB_Chem_Time_TDM"); If exists Unknown_Dose_field and Unknown_Dose_field.value=true then Date_field.control_mandatory := FALSE; Time_field.control_mandatory := FALSE; // populate the fields that can be modified on the communication object // DisplayForm can be "Yes", "No", or "No Change" // Message is free text // MessageType can be Informational, Error, or Banner //this_communication.DisplayForm := "Yes"; //this_communication.Message := "The field {{{SINGLE-QUOTE}}}" // || Date_label ||"{{{SINGLE-QUOTE}}} must be completed."; //this_communication.MessageType := "Banner"; else Date_field.control_mandatory := TRUE; Time_field.control_mandatory := TRUE; endif; //added for hold orders requested_date := last of (field_list where field_list.DataItemName = "RequestedDate" ); requested_time := last of (field_list where field_list.DataItemName = "RequestedTime" ); requested_time_value := requested_time.value; session_type := comm_obj.internalprocessingtype; If (called_by = "FormOpen") or (called_by = "FieldChange") and (session_type = "Hold") then If exists (requested_time) and (requested_time_value.ReqTimeCode = "Scheduled Time") then requested_time.Control_mandatory := false; else requested_time.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: