maintenance: title: Form_Lovenox_CalcDose_Simple;; mlmname: Form_Lovenox_CalcDose_Simple;; arden: version 2;; version: 4.50;; institution: St. Clair Hospital;; author: Teresa M. Spicuzza (Teresa.Spicuzza@stclair.org), 412.942.1721 ;; specialist: Eclipsys Corporation;; date: 2008-09-09;; validation: testing;; library: purpose: Calculate Lovenox dose based on weight - this MLM only calculates the dose and supplies the correct item code - it does not check for creatinine clearance and recommend dosing based upon CrCl value. ;; explanation: Dosing Weight in Kilograms * Dosing = Dose Change history 04.14.2011 TMS Initial Build from copy of Lovenox calculation MLM (Dev only) with creatinine clearance logic removed 01.16.2012 TMS Correct product code for 160mg dose from 07501 to 03468 - Ticket 146195 10.18.2012 TMS Added hold order logic for start time and start now. CSR 26926 05.08.2017 TMS Update dose cap from 150mg to 190mg for 1mg/kg dosing. CSR 33671 ;; keywords: lovenox, dose, weight; ;; 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; standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; comm_obj := this_communication.primaryobj; called_by := this_communication.CallingEvent; call_field := this_communication.CallingFieldName; If called_by_editor then client_guid := "9000001369400200"; visit_guid := visit_obj.GUID; chart_guid := "9000001918900170"; orderId := "1000002689073001"; called_by := "FormOpen"; else client_guid := this_communication.ClientGUID; visit_guid := this_communication.ClientVisitGUID; chart_guid := this_communication.ChartGuid; orderid := this_comm.ItemID; endif; //Initialize MLM pointers: str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}}; // Assigns fields passed in the Form object to the Field object field_list:= this_form.fields; // Get patient weight comb_ht_wt_field := first of (field_list where field_list.DataItemName = "CombinedMeasurements"); If exists comb_ht_wt_field then comb_ht_wt_val := comb_ht_wt_field.value; wt := comb_ht_wt_val.weight; weightvalue := (wt as number); endif; // Define other fields dosing10 := first of (field_list where field_list.DataItemName = "PRX_Lovenox1mgDosing"); dosing15 := first of (field_list where field_list.DataItemName = "PRX_Lovenox1.5mgDosing"); dose := first of (field_list where field_list.DataItemName = "DosageLow"); con := first of (field_list where field_list.DataItemName = "PRX_CONCENTRATION"); str := first of (field_list where field_list.DataItemName = "PRX_CONCSTRENGTH"); struom := first of (field_list where field_list.DataItemName = "PRX_CONCSTRENGTHUOM"); strvol := first of (field_list where field_list.DataItemName = "PRX_CONCSTRVOLUME"); strvoluom := first of (field_list where field_list.DataItemName = "PRX_CONCSTRVOLUMEUOM"); worxcode := first of (field_list where field_list.DataItemName = "PRX_DRUGIDCODE"); override := first of (field_list where field_list.DataItemName = "PRX_DosageOverride"); frequencyx := first of (field_list where field_list.DataItemName = "FrequencyCode"); frequency := frequencyx.Value; q24nowstat := ("Q24H","NOW","STAT","ONCE","TODAY","Given in Infusion Center"); mayprocess:= "YES"; start_now := last of (field_list where field_list.DataItemName = "PRX_Dosing Start Now" ); requested_time := last of (field_list where field_list.DataItemName = "RequestedTime" ); requested_time_value := requested_time.value; order_freq_summary := frequency.FrequencySummary; session_type := comm_obj.internalprocessingtype; // Define messages messageA := "Please round dose to the nearest 5mg"; messageB := "Please round dose to the nearest 10mg"; messageC := "Please verify dose."; messageG := "Lovenox 1.5 mg/kg is only dosed Q24H"; messageW := "Calculated dosing requires weight to be entered."; messageD := "Lovenox 1.5 mg/kg is not recommended for patients >136kg. Dosing regimen should be 1mg/kg."; messageN := "Lovenox is not recommended in patients <30kg. Contact physician."; // If session_type = "Hold" then If exists frequencyx and order_freq_summary = "STAT" then frequency.FrequencySummary := NULL ; endif; start_now.control_read_only := true; requested_time_value.ReqTimeCode := "Scheduled/Start Time"; endif; If call_field = "PRX_DosageOverride" and override.value = True then dosing10.value := False; dosing15.value := False; dose.control_read_only := false; dosing := "M"; dosing10.Control_Read_Only := True; dosing15.Control_Read_Only := True; mayprocess := "YES"; dose.value := ""; con.value := ""; str.value := ""; struom.value := ""; strvol.value := ""; strvoluom.value:= ""; worxcode.value := ""; endif; If call_field = "PRX_DosageOverride" and override.value = False then dosing10.value := False; dosing15.value := False; dose.control_read_only := true; dosing := ""; dosing10.Control_Read_Only := false; dosing15.Control_Read_Only := false; mayprocess := "NO"; dose.value := ""; endif; // Toggle between 1.0 and 1.5 dosing If call_field = "PRX_Lovenox1mgDosing" and dosing10.value = True then dosing15.value := False; override.value := False; dosing := "1"; dose.control_read_only := True; mayprocess := "YES"; endif; If call_field = "PRX_Lovenox1mgDosing" and dosing10.value = False then dosing15.value := True; override.value := False; dosing:= "1.5"; dose.control_read_only := True; mayprocess := "YES"; If frequency.FrequencySummary is not null then If frequency.FrequencySummary not in q24nowstat then messagetext := messageG; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; frequency.FrequencySummary := null; endif; endif; endif; If call_field = "PRX_Lovenox1.5mgDosing" and dosing15.value = True then dosing10.value := False; override.value := False; dosing:= "1.5"; dose.control_read_only := True; mayprocess := "YES"; If frequency.FrequencySummary is not null then If frequency.FrequencySummary not in q24nowstat then messagetext := messageG; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; frequency.FrequencySummary := null; endif; endif; endif; If call_field = "PRX_Lovenox1.5mgDosing" and dosing15.value = False then dosing10.value := True; override.value := False; dosing:= "1"; mayprocess := "YES"; endif; If ((call_field <> "PRX_Lovenox1mgDosing" and call_field <> "PRX_Lovenox1.5mgDosing") or call_field is null) and dosing10.value = True then dosing := "1"; endif; If ((call_field <> "PRX_Lovenox1.5mgDosing" and call_field <> "PRX_Lovenox1.5mgDosing") or call_field is null) and dosing15.value = True then dosing := "1.5"; endif; If ((call_field <> "PRX_Lovenox1mgDosing" and call_field <> "PRX_Lovenox1.5mgDosing") or call_field is null) and override.value = True then dosing := "M"; endif; If ((call_field = "DosageLow") and (override.value = True)) then dosing := "M"; endif; If called_by in ("FormClose", "FieldChange") then If frequency.FrequencySummary is not null then If frequency.FrequencySummary not in q24nowstat and dosing = "1.5" then messagetext := messageG; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; frequency.FrequencySummary := null; endif; endif; /* If (dosing = "1" or dosing = "1.5") and weightValue is null then messagetext := messageW; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; endif; */ //////////////////////////////////////////// Process Fields Section //////////////////////////////////////////// /* Manual Dose Logic */ If mayprocess = "YES" and dosing = "M" then; manual_dose := dose.value; worxcode.value := Null; manual_map_list :=( // dsg ds con s su v vu id "M|||30|(30mg/0.3ml)|30|MG|0.3|ML|06817", "M|||40|(40mg/0.4ml)|40|MG|0.4|ML|05997", "M|||45|(60mg/0.6ml)|60|MG|0.6|ML|06997", "M|||50|(60mg/0.6ml)|60|MG|0.6|ML|06997", "M|||55|(60mg/0.6ml)|60|MG|0.6|ML|06997", "M|||60|(60mg/0.6ml)|60|MG|0.6|ML|06997", "M|||65|(80mg/0.8ml)|80|MG|0.8|ML|06998", "M|||70|(80mg/0.8ml)|80|MG|0.8|ML|06998", "M|||75|(80mg/0.8ml)|80|MG|0.8|ML|06998", "M|||80|(80mg/0.8ml)|80|MG|0.8|ML|06998", "M|||85|(100mg/ml)|100|MG|1|ML|06999", "M|||90|(100mg/ml)|100|MG|1|ML|06999", "M|||95|(100mg/ml)|100|MG|1|ML|06999", "M|||100|(100mg/ml)|100|MG|1|ML|06999", "M|||110|(120mg/ml)|120|MG|1|ML|07500", "M|||120|(120mg/ml)|120|MG|1|ML|07500", "M|||130|(150mg/ml)|150|MG|1|ML|07501", "M|||140|(150mg/ml)|150|MG|1|ML|07501", "M|||150|(150mg/ml)|150|MG|1|ML|07501", "M|||160|(2 x 80mg)| | | | |03468", "M|||170|(100 + 70mg)| | | | |03469", "M|||180|(100 + 80mg)| | | | |03470", "M|||190|(100 + 90mg)| | | | |03471", "M|||200|(2 x 100mg)| | | | |03472" ); for j in 1 seqto count manual_map_list do manual_element_list := call str_parse with manual_map_list[j], "|"; field1 := manual_element_list[1]; field2 := manual_element_list[2]; field3 := manual_element_list[3]; field4 := manual_element_list[4]; field5 := manual_element_list[5]; field6 := manual_element_list[6]; field7 := manual_element_list[7]; field8 := manual_element_list[8]; field9 := manual_element_list[9]; field10:= manual_element_list[10]; If manual_dose = (field4 as number) then con.value := field5; str.value := field6; struom.value := field7; strvol.value := field8; strvoluom.value:= field9; worxcode.value := field10; endif; enddo; /* for j in 1 seqto count manual_map_list do */ If manual_dose < 101 and worxcode.value is null then messagetext := messageA; dose.value := ""; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; endif; If manual_dose > 100 and manual_dose < 200 and worxcode.value is null then messagetext := messageB; dose.value := ""; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; endif; If manual_dose > 200 or manual_dose < 30 and worxcode.value is null then dose.value := ""; messagetext := messageC; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; endif; endif; /* may process = YES and dosing = "M" */ /* Calculated dosing logic */ If mayprocess = "YES" and dosing <> "M" then // If (dosing = "1" or dosing = "1.5") and weightvalue < 1 then // messagetext := messageW; // this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; // endif; If (dosing = "1" or dosing = "1.5") and (weightvalue > 0 and weightvalue < 30) then messagetext := messageN; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; endif; If dosing = "1.5" and weightvalue > 136.4 then messagetext := messageD; dose.value := ""; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; endif; calc_map_list :=( // dsg wl wu ds con s su v vu id "1|0.5|29.4||(30mg/0.3ml)|30|MG|0.3|ML|06817", "1|29.5|34.4|30|(30mg/0.3ml)|30|MG|0.3|ML|06817", "1|34.5|35.4|40|(40mg/0.4ml)|40|MG|0.4|ML|05997", "1|35.5|43.4|40|(40mg/0.4ml)|40|MG|0.4|ML|05997", "1|43.5|46.4|45|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1|46.5|53.4|50|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1|53.5|56.4|55|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1|56.5|63.4|60|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1|63.5|66.4|65|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1|66.5|73.4|70|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1|73.5|76.4|75|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1|76.5|83.4|80|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1|83.5|86.4|85|(100mg/ml)|100|MG|1|ML|06999", "1|86.5|93.4|90|(100mg/ml)|100|MG|1|ML|06999", "1|93.5|96.4|95|(100mg/ml)|100|MG|1|ML|06999", "1|96.5|105.4|100|(100mg/ml)|100|MG|1|ML|06999", "1|105.5|115.4|110|(120mg/ml)|120|MG|1|ML|07500", "1|115.5|125.4|120|(120mg/ml)|120|MG|1|ML|07500", "1|125.5|135.4|130|(150mg/ml)|150|MG|1|ML|07501", "1|135.5|145.4|140|(150mg/ml)|150|MG|1|ML|07501", "1|145.5|155.4|150|(150mg/ml)|150|MG|1|ML|07501", "1|155.5|165.4|160|(2 x 80mg)| | | | |03468", "1|165.5|175.4|170|(100 + 70mg)| | | | |03469", "1|175.5|185.4|180|(100 + 80mg)| | | | |03470", "1|185.5|195.4|190|(100 + 90mg)| | | | |03471", "1.5|0.5|29.4||(60mg/0.6ml)|60|MG|0.6|ML|06997", "1.5|29.5|31.4|45|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1.5|31.5|35.4|50|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1.5|35.5|37.4|55|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1.5|37.5|42.4|60|(60mg/0.6ml)|60|MG|0.6|ML|06997", "1.5|42.5|44.4|65|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1.5|44.5|48.4|70|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1.5|48.5|51.4|75|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1.5|51.5|55.4|80|(80mg/0.8ml)|80|MG|0.8|ML|06998", "1.5|55.5|57.4|85|(100mg/ml)|100|MG|1|ML|06999", "1.5|57.5|61.4|90|(100mg/ml)|100|MG|1|ML|06999", "1.5|61.5|64.4|95|(100mg/ml)|100|MG|1|ML|06999", "1.5|64.5|70.4|100|(100mg/ml)|100|MG|1|ML|06999", "1.5|70.5|76.4|110|(120mg/ml)|120|MG|1|ML|07500", "1.5|76.5|83.4|120|(120mg/ml)|120|MG|1|ML|07500", "1.5|83.5|90.4|130|(150mg/ml)|150|MG|1|ML|07501", "1.5|90.5|96.4|140|(150mg/ml)|150|MG|1|ML|07501", "1.5|96.5|103.4|150|(150mg/ml)|150|MG|1|ML|07501", "1.5|103.5|110.4|160|(80 + 80mg)| | | | |03468", "1.5|110.5|116.4|170|(100 + 70mg)| | | | |03469", "1.5|116.5|123.4|180|(100 + 80mg)| | | | |03470", "1.5|123.5|130.4|190|(100 + 90mg)| | | | |03471", "1.5|130.5|136.4|200|(100 + 100mg)| | | | |03472" ); for i in 1 seqto count calc_map_list do calc_element_list := call str_parse with calc_map_list[i], "|"; field1 := calc_element_list[1]; field2 := calc_element_list[2]; field3 := calc_element_list[3]; field4 := calc_element_list[4]; field5 := calc_element_list[5]; field6 := calc_element_list[6]; field7 := calc_element_list[7]; field8 := calc_element_list[8]; field9 := calc_element_list[9]; field10:= calc_element_list[10]; // field2conv := (field2 as number); field3conv := (field3 as number); field4conv := (field4 as number); If (dosing = field1) and (weightvalue >= field2conv) and (weightvalue <= field3conv) then dose.value := field4; con.value := field5; str.value := field6; struom.value := field7; strvol.value := field8; strvoluom.value:= field9; worxcode.value := field10; endif; enddo; /* for i in 1 seqto count calc_map_list do */ If (dosing = "1") and (weightvalue >195.4) then dose.value := 190; con.value := "(100 + 90mg)"; str.value := ""; struom.value := ""; strvol.value := ""; strvoluom.value:= ""; worxcode.value := "03472"; endif; endif; /* may process = YES */ endif; /* If formclose or fieldchange)*/ If called_by = "FormClose" then If (dosing = "1" or dosing = "1.5") and weightValue is null then messagetext := messageW; this_communication.Message := messagetext ; this_communication.MessageType := "Informational"; endif; endif; ;; evoke: ;; logic: Conclude true; ;; action: // This MLM returns two parameters, of types //communication_type and form_type respectively. return this_communication, this_form; ;; Urgency: 50;; end: