maintenance: title: Generic Read Only On Order Set Open;; mlmname: FORM_Set_Generic_ReadOnly;; arden: version 2;; version: 5.00;; institution: St Clair;; author: Robert Spence, Eclipsys Corp ext 7461;; specialist: Robert Spence, Eclipsys Corp ext 7461;; date: 2010-02-11;; validation: testing;; library: purpose: Used to gray our any orderset field on form open. ;; explanation: Following this strategy to improve CPOE turnaround Change history ;; keywords: Generic, FormOpen, Read Only ;; 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; LegendIn := (); LegendOut := (); LegendIn := ("MOI","MOC","MOG"); LegendOut := ("MultiOrderInline","MultiOrderCheckbox","MultiOrderGrid"); /***************************************************************************************/ // Use String parse str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}}; genfieldcall := mlm {{{SINGLE-QUOTE}}}FORM_Set_Generic_ReadOnly_FieldCall{{{SINGLE-QUOTE}}}; // Initialize error message error_message:=""; // Assigns fields passed in the Form object to the Field object field_list:= this_form.fields; workfield2 := last of (field_list where field_list.DataItemName = "MLMOnOpenReadOnly_A" ); workfield := workfield2.value; // workfield will be in format xxx-y|xxx-y // where xxx is one of MOI, MOC, MOG // y is the occurrence number of the Inline, Check Box or Grid. CallingEvent := this_communication.CallingEvent; CallingField := this_communication.CallingFieldName; ListFields:=(); ListFields:= call str_parse with workfield,"|"; NumMembs:= count ListFields; NumLegend:= count LegendIn; for k in (1 seqto (NumMembs)) do intypelist := call str_parse with ListFields[k],"-"; intype:= first of (intypelist); intypeocc:= last of (intypelist); intypenum := intypeocc as number; name:=""; for l in (1 seqto (NumLegend)) do if LegendIn[l] = intype then name:= LegendOut[l]; endif; enddo; if (name <> "") then (this_communication, this_form) := call genfieldcall with this_communication, this_form, client_info_obj,name,intypenum; endif; enddo; ;; 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: