maintenance: title: Ordering: Pregnancy field visable only for females and blood warmer temp mandatory only if warmer field is yes;; mlmname: FORM_Lab_WarmBlood;; arden: version 2;; version: 4.50;; institution: St Clair Isolation Set MLM;; author: Don Warnick & Mary Sieger, Eclipsys Corp;; specialist: ;; date: 2006-07-25;; validation: testing;; library: purpose: HIde the pregnancy field if the patient is not a female and hide the blood warmer temp if blood warmer field is not yes ;; explanation: This MLM is called from the LAB BB_Transfuse Rx form. Upon form open the patient gender is interrogated and if they are female, the pregnancy box is visable. If the Blood Warmer field is filled with a yes, the Blood Warmer Temp field is mandatory. If no, then it is not. ;; keywords: Called MLMs, Form fields, Blood Warmer, Pregnancy ;; 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; CallingEvent := this_communication.CallingEvent; CallingField := this_communication.CallingFieldName; // 1. Display the BB Trans Rx_Dict_Pregnancy field only if the patient is female // 2. Make the BB Trans Rx_Num Temp field mandatory of Blood Warmer field is set to Yes Pregnancy_History := last of (field_list where field_list.DataItemName = "BB Trans Rx_Dict_Pregnancy" ); Blood_Warmed := last of (field_list where field_list.DataItemName = "BB Trans Rx_Dict_Blood Warmed" ); Blood_Temperature := last of (field_list where field_list.DataItemName = "BB Trans Rx_Num_Temp of Blood Warmer" ); If CallingEvent="FormOpen" then if exist client_info_obj then (patient_gender ):= read last {ClientInfo: GenderTypeIntlCode REFERENCING client_info_obj}; endif; if exist patient_gender and patient_gender = "M" then Pregnancy_History.control_visible := False; Pregnancy_History.control_mandatory := False; endif; elseif CallingEvent = "FieldChange" then If Blood_Warmed.Value = "No" then Blood_Temperature.control_mandatory := False; elseIf Blood_Warmed.Value = "Yes" then Blood_Temperature.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: