maintenance: title: Priority for Warfarin Orders;; mlmname: FORM_Rx_Warfarin_Priority;; arden: version 2.5;; version: 6.10;; institution: St Clair ;; author: Eclipsys Corp;; specialist: Teresa Spicuzza;; date: 2014-08-05;; validation: testing;; library: purpose: If {{{SINGLE-QUOTE}}}Irregular Schedule{{{SINGLE-QUOTE}}} is selected then populate {{{SINGLE-QUOTE}}}RequestedDTM{{{SINGLE-QUOTE}}} with Date and time of earliest date/time in the Schedule ;; explanation: This MLM is called from the medication form selects the frequency {{{SINGLE-QUOTE}}}Irregular Schedule{{{SINGLE-QUOTE}}} The Schedule will be reviewed and the earliest date/time identified. This date/time will be put in to the RequestedDTM field using the {{{SINGLE-QUOTE}}}Scheduled/Start Time{{{SINGLE-QUOTE}}} option. Change History 08/05/2014 TMS New MLM to set the priority of Warfarin Orders, copied from Form Med Irreg Schedule CSR 32392 ;; keywords: Called MLMs, Form fields, Irregular Schedule, Warfarin ;; 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; PrimaryObjdetail:=this_communication.PrimaryObj; session_type := PrimaryObjdetail.internalprocessingtype; /*******************Make Changes To Spelling And Flags In This Section*******************/ /* These variables must containt he same wording as the options in the drop down list */ /***************************************************************************************/ // Initialize error message error_message:=""; // References the LOCAL SESSION object local_session := cds_session.local; standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; // Obtain fields passed in the Form object to the Field object field_list:= this_form.fields; requested_date := last of (field_list where field_list.DataItemName = "RequestedDate" ); requested_time := last of (field_list where field_list.DataItemName = "RequestedTime" ); //stop_after:= last of (field_list where field_list.DataItemName = "StopAfter" ); //stop_after_Value := stop_after.value; //stop_date := last of (field_list where field_list.DataItemName = "StopDate" ); // stop_time := last of (field_list where field_list.DataItemName = "StopTime" ); //stop_time_value := stop_time.value ; is_prn := last of (field_list where field_list.DataItemName = "IsPRN" ); regular_freq := last of (field_list where field_list.DataItemName = "FrequencyCode"); requested_time_value := requested_time.value; regular_freq_value := regular_freq.value; start_now := last of (field_list where field_list.DataItemName = "PRX_Dosing Start Now" ); start_now_value := start_now.value; stat_then := first of (field_list where field_list.DataItemName = "PRX_Dosing Stat and Then"); stat_then_value := stat_then.value; TotalDosing := first of ( field_list WHERE field_list.DataItemName = "PRX_Dosing Total Doses"); TotalDosing_value := TotalDosing.value; RX_Comments_field := last of (field_list where field_list.DataItemName = "Rx Comments"); RX_Instructions_field := last of (field_list where field_list.DataItemName = "Rx Instructions"); //FreqText := " "; AltDaysDose1 := last of (field_list where field_list.DataItemName = "PRX_SchedDays1" and field_List.Control_MultiFieldOccNum = 1); AltDaysDose1_list := AltDaysDose1.value; //SP := " "; //DQ := 34 formatted with "%c"; DailyFreq := last of (field_list where field_list.DataItemName = "PRX_Std_Schedule"); DailyFreq_value := DailyFreq.value; CallingEvent := this_communication.CallingEvent; CallingField := this_communication.CallingFieldName; PrimaryObjdetail:=this_communication.PrimaryObj; OrderName := PrimaryObjdetail.name; RX_Comments_field_value := RX_Comments_field.value; str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}}; FreqTranslate := (); FreqTranslate := read { "select value from cv3userdictionaryvalue v with (nolock)" || " where userdictionarycode = {{{SINGLE-QUOTE}}}PRX_ORM Frequency Translation{{{SINGLE-QUOTE}}} " || " and active = {{{SINGLE-QUOTE}}}1{{{SINGLE-QUOTE}}} " }; If exists AltDaysDose1 and (AltDaysDose1_list <> "None") then regular_freq_value.FrequencySummary := ""; regular_freq_value.FreqFromTime := 1; regular_freq_value.FreqToTime := 0; regular_freq_value.FreqUOM := "week"; regular_freq_value.FreqTimes := "21:00"; Dayslist := call str_parse with ((AltDaysDose1_list),","); regular_freq_value.FreqWeeklyDays := dayslist; endif; If exists AltDaysDose1 and AltDaysDose1_list = "None" then If exists Dailyfreq and Dailyfreq_value <> "None" then regular_freq_value.FrequencySummary := Dailyfreq_value; If Dailyfreq_value = "Now" then requested_time_value.ReqTimeValue := NULL; requested_time_value.ReqTimeCode := "Routine"; elseif Dailyfreq_value = "Stat" then requested_time_value.ReqTimeValue := NULL; requested_time_value.ReqTimeCode := "STAT"; else; requested_time_value.ReqTimeValue := "21:00"; requested_time_value.ReqTimeCode := "Scheduled/Start Time"; endif; endif; endif; // if the frequency is {{{SINGLE-QUOTE}}}User Schedule{{{SINGLE-QUOTE}}} then PRN, stat/then, now/then is not available If regular_freq_value.FrequencySummary = "" then is_prn.control_visible := FALSE; start_now.control_read_only := True; start_now.value := False; stat_then.value := False; stat_then.control_read_only := True; TotalDosing.value := NULL; TotalDosing.control_read_only := True; else is_prn.control_visible := TRUE; endif; If (regular_freq_value.FrequencySummary <> "STAT")and (requested_time_value.ReqTimeCode = "STAT") then requested_time_value.ReqTimeValue := NULL; requested_time_value.ReqTimeCode := NULL; 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: