maintenance: title: Med With Chem Restraint;; mlmname: FORM_MED_CHEM_RESTRAINT;; 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 whether med if for Chemical Restraint or for a Medical Condition ;; explanation: This MLM is called from the medication form once the user indicates if med is for {{{SINGLE-QUOTE}}}Chemical Retraint{{{SINGLE-QUOTE}}} or for a {{{SINGLE-QUOTE}}}Medical Condition{{{SINGLE-QUOTE}}}. If drug is for a Chemical Restraint then the {{{SINGLE-QUOTE}}}Medical Condition{{{SINGLE-QUOTE}}} field is grayed out, the FrequencyCode field is hidden and a UDDI to enter the frequency (it is a subset of frequencies from the main list) is displayed. A second MLM will run when the frequency in the UDDI is selected and it will copy value to the hidden FrequencyCode field. If drug is for a Medical Condition then field {{{SINGLE-QUOTE}}}Medical Condition{{{SINGLE-QUOTE}}} will become mandatory. Change history 04.12.2013 BB CSR# 26711 MLM - Update MLM to include new Orderset Form checkboxes for toggle gray out. 08.09.2013 TMS Commented out lines that make prn reason box hidden and not mandatory. This is controlled through the FORM_PRN_REASON MLM to accommodate behavioral health mandatory reason for med orders. CSR 31639 ;; 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:=""; triggerng_field := this_communication.CALLINGFIELDNAME; // Assigns fields passed in the Form object to the Field object field_list:= this_form.fields; // Added for Orderset Forms [BB] oschem_cb := last of (field_list where field_list.DataItemName = "NUR_Chemical Restraint" and field_List.Control_MultiFieldOccNum = 1); osmed_cb := last of (field_list where field_list.DataItemName = "NUR_Not Chemical Restraint" and field_List.Control_MultiFieldOccNum = 1); chem_cb := last of (field_list where field_list.DataItemName = "NUR_Chemical Restraint" ); med_cb := last of (field_list where field_list.DataItemName = "NUR_Not Chemical Restraint" ); med_cond := last of (field_list where field_list.DataItemName = "NUR_Nonchemical Restraint Ind"); restraint_freq := last of (field_list where field_list.DataItemName = "PRX_Chemical Restraint Freq"); regular_freq := last of (field_list where field_list.DataItemName = "FrequencyCode"); is_prn := last of (field_list where field_list.DataItemName = "IsPRN"); is_prn_reason := last of (field_list where field_list.DataItemName = "PRX_PRNCondition"); regular_freq_value := regular_freq.value; if triggerng_field = "NUR_Chemical Restraint" and chem_cb.value = true then med_cb.value := FALSE; med_cb.control_read_only := TRUE; osmed_cb.value := FALSE; osmed_cb.control_read_only := TRUE; elseif triggerng_field = "NUR_Chemical Restraint" and chem_cb.value = false then med_cb.value := TRUE; med_cb.control_read_only := FALSE; chem_cb.control_read_only := TRUE; elseif triggerng_field = "NUR_Not Chemical Restraint" and med_cb.value = true then chem_cb.value := false; chem_cb.control_read_only := true; elseif triggerng_field = "NUR_Not Chemical Restraint" and med_cb.value = false then chem_cb.value := TRUE; chem_cb.control_read_only := false; med_cb.control_read_only := true; endif; // Added to include the logic on the Orderset Form, as it has the same name and multi field occasion number [BB] if triggerng_field = "NUR_Chemical Restraint|1" and oschem_cb.value = true then osmed_cb.value := FALSE; osmed_cb.control_read_only := TRUE; elseif triggerng_field = "NUR_Chemical Restraint|1" and oschem_cb.value = false then osmed_cb.value := TRUE; osmed_cb.control_read_only := FALSE; oschem_cb.control_read_only := TRUE; elseif triggerng_field = "NUR_Not Chemical Restraint|1" and osmed_cb.value = true then oschem_cb.value := false; oschem_cb.control_read_only := true; elseif triggerng_field = "NUR_Not Chemical Restraint|1" and osmed_cb.value = false then oschem_cb.value := TRUE; oschem_cb.control_read_only := false; osmed_cb.control_read_only := true; endif; if chem_cb.Value = true then // if chemical restraint then hide the regular frequency field , regular_freq.control_read_only := TRUE; regular_freq.control_mandatory := FALSE; regular_freq_value.FrequencySummary := NULL; // display the UDDI with the subset of frequencies restraint_freq.control_read_only := FALSE; restraint_freq.control_mandatory := TRUE; restraint_freq.value := NULL; // and make the medical condition field read only med_cond.value := ""; med_cond.control_read_only := TRUE; med_cond.control_mandatory := FALSE; // and {{{SINGLE-QUOTE}}}IsPRN{{{SINGLE-QUOTE}}} is no longer an option is_prn.value := false; is_prn.control_read_only := TRUE; is_prn_reason.value := NULL; // is_prn_reason.control_mandatory := FALSE; // is_prn_reason.control_visible := FALSE; elseif med_cb.value = true then // if medical condition then make the regualr frequency field visible, regular_freq.control_read_only := FALSE; regular_freq.control_mandatory := TRUE; regular_freq_value.FrequencySummary := NULL; // hide the UDDI for the subset of frequencies restraint_freq.control_read_only := TRUE; restraint_freq.control_mandatory := FALSE; restraint_freq.value := NULL; // and make the medical condition field visible and mandatory med_cond.value := ""; med_cond.control_read_only := FALSE; med_cond.control_mandatory := TRUE; // and {{{SINGLE-QUOTE}}}IsPRN{{{SINGLE-QUOTE}}} is an option is_prn.value := FALSE; is_prn.control_read_only := FALSE; is_prn_reason.value := NULL; // is_prn_reason.control_mandatory := FALSE; // is_prn_reason.control_visible := FALSE; 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: