maintenance: title: Form_Berinert_Calc;; mlmname: Form_Berinert_Calc;; arden: version 2;; version: 5.50;; institution: St. Clair Hospital;; author: Teresa Spicuzza ;; specialist: Teresa Spicuzza ;; date: 2012-05-21;; validation: testing;; library: purpose: Caculate Berinert dose based on weight. Present dose rounded as: 500 - 600 units – round to 500 units 601 - 999 units – round to the nearest 50 units 1000 - 1100 units – round to 1000 units 1101 - 1499 units - round to the nearest 50 units 1500 - 1600 units – round to 1500 units 1601 - 1999 units – round to the nearest 50 units 2000 - 2100 units – round to 2000 units 2101 - 2499 units - round to nearest 50 units 2500 - 2600 units – round to 2500 units 2601 - 3000 units - round to nearest 50 units For patients < 25 kg, pop up a note that states: "Dosing in children < 12y/o is not established." and allow for a type in a dose; For patients > 150 kg, pop up a note that states: "Clinical trials did not include obese patients > 150 kg. No specific dosing recommendations are available." and allow for a type in a dose. ;; explanation: Dosing Weight in Kilograms * 20 = Dose If Dosing Weight in Kilograms is null alert user to ‘Please enter a Weight before proceeding’ Change history 03.18.2015 TMS New MLM to calculate and round Berinert C1 Esterase Inhibitor (Human) doses. CSR 24477 ;; keywords: Berinert, weight; C1 Esterase Inhibitor (Human) ;; knowledge: type: data-driven;; data: /********************Make Changes To Spelling And Flags In This Section*********************/ /*************************************************************************************************/ // 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; using "ObjectsPlusXA.SCM.Forms"; using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms"; // Assigns fields passed in the Form object to the Field object field_list:= this_form.fields; CallingEvent := this_communication.CallingEvent; CallingField := this_communication.CallingFieldName; CR := 13 formatted with "%c"; LF := 10 formatted with "%c"; CRLF:= CR||LF; adminInfo := first of (field_list where field_list.DataItemName = "AdminInstructions"); OrderInfo := first of (field_list where field_list.DataItemName = "PRX_NOTECOMMENT0"); comb_ht_wt_field := first of (field_list where field_list.DataItemName = "CombinedMeasurements"); dose := first of (field_list where field_list.DataItemName = "DosageLow"); dose_val := dose.value; if exists comb_ht_wt_field then comb_ht_wt_val := comb_ht_wt_field.value; wt := comb_ht_wt_val.weight; ht := comb_ht_wt_val.height; wt_type := comb_ht_wt_val.weighttype; bsa := comb_ht_wt_val.bsa; bmi := comb_ht_wt_val.bmi; endif; If CallingEvent = "FormOpen" or (CallingEvent = "FieldChange" and callingfield = "CombinedMeasurements") then if not exists wt or wt = 0 then this_communication.Message := "Please Enter a Weight " || "before proceeding." ; this_communication.MessageType := "Error"; else wt_val := wt as number; endif; If (wt_val >= 25 and wt_val <= 150) then //Dose dose_calc := (wt as number) * 20; If dose_calc >= 500 and dose_calc < 601 then halffactor := 250; roundfactor := 500; rndmessage := " (rounded to 500 mg) - "; elseif dose_calc >= 601 and dose_calc < 1000 then halffactor := 25; roundfactor := 50; rndmessage := " (rounded to nearest 50 mg) - "; elseif dose_calc >= 1000 and dose_calc < 1101 then halffactor := 500; roundfactor := 1000; rndmessage := " (rounded to 1000 mg) - "; elseif dose_calc >= 1101 and dose_calc < 1500 then halffactor := 25; roundfactor := 50; rndmessage := " (rounded to nearest 50 mg) - "; elseif dose_calc >= 1500 and dose_calc < 1601 then halffactor := 750; roundfactor := 1500; rndmessage := " (rounded to 1500 mg) - "; elseif dose_calc >= 1601 and dose_calc < 2000 then halffactor := 25; roundfactor := 50; rndmessage := " (rounded to nearest 50 mg) - "; elseif dose_calc >= 2000 and dose_calc < 2101 then halffactor := 1000; roundfactor := 2000; rndmessage := " (rounded to 2000 mg) - "; elseif dose_calc >= 2101 and dose_calc < 2500 then halffactor := 25; roundfactor := 50; rndmessage := " (rounded to nearest 50 mg) - "; elseif dose_calc >= 2500 and dose_calc < 2601 then halffactor := 1250; roundfactor := 2500; rndmessage := " (rounded to 2500 mg) - "; elseif dose_calc >= 2601 and dose_calc < 3000 then halffactor := 25; roundfactor := 50; rndmessage := " (rounded to nearest 50 mg) - "; elseif dose_calc >= 3000 then halffactor := 1500; roundfactor := 3000; rndmessage := " (rounded to 3000 mg) - "; endif; rnd_dose := int((dose_calc + halffactor)/roundfactor) * roundfactor; if exists dose then Dose.Value := rnd_dose ; mltodraw := rnd_dose/50; rawrate := ((rnd_dose /50) / 4); rateofadmin := int((rawrate + 0.5)/1) * 1; msg1 := "Dose calculated at 20 units/kg" ; msg1b := "Final concentration after reconstitution is 50 units/ml. " ; // msg1 := "Dose calculated at 20units/kg - Final concentration after reconstitution is 50units/ml. " ; msg2 := "Administer " ; msg2b := " units ("; msg3 := " ml) by slow IV injection at 4 ml/min. (" ; msg4 := " minutes)"; dose.control_read_only := true; admininfo.value := msg1 || rndmessage || msg1b || LF || LF || msg2 || rnd_dose || msg2b || mltodraw || msg3 || rateofadmin || msg4; endif; elseif (wt as number) < 25 and (wt as number) > 0 then this_communication.Message := "Dosing in children < 12y/o is not established. " || "Enter a dose if you wish to continue." ; this_communication.MessageType := "Informational"; admininfo.value := " "; Dose.Value := ""; dose.control_read_only := false; elseif (wt as number) > 150 then this_communication.Message := "Clinical trials did not include obese patients > 150 kg. No specific dosing recommendations are available. " || "Enter a dose if you wish to continue." ; this_communication.MessageType := "Informational"; admininfo.value := " "; Dose.Value := ""; dose.control_read_only := false; endif; // not exists wt endif; If CallingEvent = "FieldChange" and Callingfield = "DosageLow" then wt_val := wt as number; If (wt_val < 25 or wt_val > 150) and dose_val > 0 then mltodraw := dose.value/50; rawrate := ((dose.value /50) / 4); rateofadmin := int((rawrate + 0.5)/1) * 1; // msg1 := "Dose calculated at 20 units/kg" ; msg1b := "Final concentration after reconstitution is 50 units/ml. " ; msg2 := "Administer " ; msg2b := " units ("; msg3 := " ml) by slow IV injection at 4 ml/min. (" ; msg4 := " minutes)"; // dose.control_read_only := true; admininfo.value := msg1b || LF || LF || msg2 || dose.value || msg2b || mltodraw || msg3 || rateofadmin || msg4; 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: