maintenance: title: Drug Level Monitoring Alerts for Select Drugs;; mlmname: SCH_DrugLevelMonitoring;; arden: version 2;; version: 5.50;; institution: St Clair;; author: Teresa Spicuzza, Allscripts Corp;; specialist: Teresa Spicuzza;; date: 2012-08-20;; validation: testing;; library: purpose: Recommendations for Drug Level Monitoring Alerts for Select Drugs ;; explanation: MLM will alert user to monitor patient for therapeutic drug levels for select medications identified with a class type of PRX_DrugMonitoring. Change history 06.10.2013 TMS Created CSR CSR 31334 01.07.2016 TMS Update call to SCH_Func_Creatinine_Clearance to include 5 parameters in the argument being returned. Changed from CrCl_Message, Crcl_Value, wt, patientage to CrCl_Message, Crcl_Value, SCRfromMLM, wt, patientage HD Ticket: 1994073 06.07.2016 TMS Update to change Valproic Acid and Phenytoin and add Carbamazepine to not alert if levels done during this admission, not only past 48 hours. CSR 34690 09.30.2019 TMS Updated alert to require reason when alert presented to user not in physician/physician extender group. CSR 37977 ;; keywords: Monitoring ;; knowledge: type: data-driven;; data: // Specify which .NET assemblies need to be loaded for ObjectsPlus standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; error_occurred := false; error_message := ""; str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}}; CrCl_info:= mlm {{{SINGLE-QUOTE}}}SCH_Func_Creatinine_Clearance{{{SINGLE-QUOTE}}}; log_execution_info := false; //Set the text for this variable to indicate whether to send the message or not send_alert := "DoNotSend"; //-------------------------------------------------------------------- if called_by_editor then EvokingObject := read last {Order: THIS where Name="Metformin 500mg Tab" }; endif; doalert := false; order_enter_event := event { OrderEnter User Order: where TypeCode = "Medication"}; (CatalogItemObj, FrequencyValue, UOMValue, DoseValue, OrderName, AdminIns, UserSchedType ,UserSchedDays, UserSchedDoses) := read last {Order: OrderCatalogMasterItem, FrequencyCode, UOM, DosageLow, Name, AdminInstructions, Interval, DaysInInterval, DoseMultiplier REFERENCING EvokingObject}; CatalogClassTypeValueObj := read last {OrderCatalogMasterItem: CatalogClassTypeValue, REFERENCING CatalogItemObj}; ClassTypeValue_code_list, ClassTypeValue_value_list := read last {CatalogClassTypeValue: Code, Value REFERENCING CatalogClassTypeValueObj where code = "PRX_DrugMonitoring"}; fire_on_UserCPOE := ("MD","DO","DDS","DPM","PA","PA-C","CRNP","IT"); fire_on_User := ("RN","RPh"); /* Get the current user{{{SINGLE-QUOTE}}}s occupation*/ (user_id,userguid) :=read last {UserInfo: idcode, guid}; UserCode := read last {"Select occupationcode " ||" From cv3user with (nolock) " ||" Where Guid = " || SQL(userguid) }; If usercode in fire_on_UserCPOE then alert_settings := ""; UDDD_dictionary_name := ""; UDDD_is_restricted := FALSE; continue_processing := true; elseif usercode in fire_on_User then alert_settings := "Must Comment"; UDDD_dictionary_name := "AlertAckComment"; UDDD_is_restricted := TRUE; continue_processing := true; else continue_processing := false; endif; dose_alert_dest := destination {alert} with [alert_type := "Warning", short_message := "Monitoring Recommendation", priority := "Low", scope := "Chart", rule_group := "Drug Monitoring", rule_number := 4080, send_with_order := send_alert, alert_dialog_settings :=alert_settings, ack_comment_UDDD := UDDD_dictionary_name, ack_comment_UDDD_is_restricted := UDDD_is_restricted, display_alert := true]; // continue_processing:= user_id in fire_on_User; // continue_processing:= usercode in fire_on_User; if EvokingEvent = order_enter_event and continue_processing = true and "PRX_DrugMonitoring" in ClassTypeValue_code_list then (ClientVisitGuid, ChartGuid, ClientGuid, CurrentLocation, LocationGuid, VisitStatus, AdmitDtm) := read last {ClientVisit: GUID, ChartGUID, ClientGUID, CurrentLocation, CurrentLocationGUID, VisitStatus, AdmitDtm }; (UserGUID ) := read last { UserInfo: GUID }; patientgender := read last { ClientInfo: Gendercode }; Creatinine, Creatdtm := read last {"Select top 1 bo.value, o.performeddtm " || " From cv3order as o with (nolock) " || " join cv3basicobservation as bo with (nolock) " || " on o.clientguid = bo.clientguid " || " and o.chartguid = bo.chartguid " || " and o.guid = bo.orderguid " || " and bo.status = {{{SINGLE-QUOTE}}}F{{{SINGLE-QUOTE}}} " || " and bo.Active = 1 " || " And bo.IsHistory = 0 " || " join cv3ordercatalogmasteritem as ocmi with (nolock) " || " on ocmi.guid = o.ordercatalogmasteritemguid " || " and ocmi.active = 1 " || " where o.clientguid = " || SQL(clientguid) // || " and o.chartguid = " || SQL(chartguid) || " and o.performeddtm >= " || SQL(AdmitDtm) || " and bo.itemname = {{{SINGLE-QUOTE}}}Creatinine Plasma/Serum{{{SINGLE-QUOTE}}} " || " order by o.performeddtm desc " }; if ClassTypeValue_value_list = "Digoxin" and Creatinine is not Null then (CrCl_Message, Crcl_Value, SCRfromMLM, wt, patientage) := call CrCl_info with (ClientVisitGuid, ChartGuid, ClientGuid, Creatinine); endif; Digoxin := read last {"Select top 1 bo.value " || " From cv3order as o with (nolock) " || " join cv3basicobservation as bo with (nolock) " || " on o.clientguid = bo.clientguid " || " and o.chartguid = bo.chartguid " || " and o.guid = bo.orderguid " || " and bo.status = {{{SINGLE-QUOTE}}}F{{{SINGLE-QUOTE}}} " || " and bo.Active = 1 " || " And bo.IsHistory = 0 " || " join cv3ordercatalogmasteritem as ocmi with (nolock) " || " on ocmi.guid = o.ordercatalogmasteritemguid " || " and ocmi.active = 1 " || " where o.clientguid = " || SQL(clientguid) // || " and o.chartguid = " || SQL(chartguid) || " and o.performeddtm >= (DATEADD(hour, -48, getdate())) " || " and bo.itemname = {{{SINGLE-QUOTE}}}Digoxin Plasma/Serum{{{SINGLE-QUOTE}}} " || " order by o.performeddtm desc " }; Phenytoin := read last {"Select top 1 bo.value " || " From cv3order as o with (nolock) " || " join cv3basicobservation as bo with (nolock) " || " on o.clientguid = bo.clientguid " || " and o.chartguid = bo.chartguid " || " and o.guid = bo.orderguid " || " and bo.status = {{{SINGLE-QUOTE}}}F{{{SINGLE-QUOTE}}} " || " and bo.Active = 1 " || " And bo.IsHistory = 0 " || " join cv3ordercatalogmasteritem as ocmi with (nolock) " || " on ocmi.guid = o.ordercatalogmasteritemguid " || " and ocmi.active = 1 " || " where o.clientguid = " || SQL(clientguid) || " and o.performeddtm >= " || SQL(AdmitDtm) || " and bo.itemname = {{{SINGLE-QUOTE}}}Dilantin Serum (Phenytoin){{{SINGLE-QUOTE}}} " || " order by o.performeddtm desc " }; Theophylline := read last {"Select top 1 bo.value " || " From cv3order as o with (nolock) " || " join cv3basicobservation as bo with (nolock) " || " on o.clientguid = bo.clientguid " || " and o.chartguid = bo.chartguid " || " and o.guid = bo.orderguid " || " and bo.status = {{{SINGLE-QUOTE}}}F{{{SINGLE-QUOTE}}} " || " and bo.Active = 1 " || " And bo.IsHistory = 0 " || " join cv3ordercatalogmasteritem as ocmi with (nolock) " || " on ocmi.guid = o.ordercatalogmasteritemguid " || " and ocmi.active = 1 " || " where o.clientguid = " || SQL(clientguid) // || " and o.chartguid = " || SQL(chartguid) || " and o.performeddtm >= (DATEADD(hour, -48, getdate())) " || " and bo.itemname = {{{SINGLE-QUOTE}}}Theophylline Plasma/Serum{{{SINGLE-QUOTE}}} " || " order by o.performeddtm desc " }; Valproic := read last {"Select top 1 bo.value " || " From cv3order as o with (nolock) " || " join cv3basicobservation as bo with (nolock) " || " on o.clientguid = bo.clientguid " || " and o.chartguid = bo.chartguid " || " and o.guid = bo.orderguid " || " and bo.status = {{{SINGLE-QUOTE}}}F{{{SINGLE-QUOTE}}} " || " and bo.Active = 1 " || " And bo.IsHistory = 0 " || " join cv3ordercatalogmasteritem as ocmi with (nolock) " || " on ocmi.guid = o.ordercatalogmasteritemguid " || " and ocmi.active = 1 " || " where o.clientguid = " || SQL(clientguid) || " and o.performeddtm >= " || SQL(AdmitDtm) || " and bo.itemname = {{{SINGLE-QUOTE}}}Valproic Acid Plasma (Depakote Plasma){{{SINGLE-QUOTE}}} " || " order by o.performeddtm desc " }; Carbamazepine := read last {"Select top 1 bo.value " || " From cv3order as o with (nolock) " || " join cv3basicobservation as bo with (nolock) " || " on o.clientguid = bo.clientguid " || " and o.chartguid = bo.chartguid " || " and o.guid = bo.orderguid " || " and bo.status = {{{SINGLE-QUOTE}}}F{{{SINGLE-QUOTE}}} " || " and bo.Active = 1 " || " And bo.IsHistory = 0 " || " join cv3ordercatalogmasteritem as ocmi with (nolock) " || " on ocmi.guid = o.ordercatalogmasteritemguid " || " and ocmi.active = 1 " || " where o.clientguid = " || SQL(clientguid) || " and o.performeddtm >= " || SQL(AdmitDtm) || " and bo.itemname = {{{SINGLE-QUOTE}}}Carbamazepine Serum (Tegretol){{{SINGLE-QUOTE}}} " || " order by o.performeddtm desc " }; If ClassTypeValue_value_list = "Phenytoin" then If Phenytoin is Null then // alert_message := "{{+B}}{{+R}}Ordered: " || OrderName || "{{-R}} \n\n Last Phenytoin level was > 48 hours ago. Monitor phenytoin levels closely especially when changing the dose or frequency. {{-B}}"; alert_message := "{{+B}}{{+R}}Ordered: " || OrderName || "{{-R}} \n\n No Phenytoin levels available for this admission. Monitor phenytoin levels closely especially when changing the dose or frequency. {{-B}}"; doalert := true; endif; endif; If ClassTypeValue_value_list = "Theophylline" then If Theophylline is Null then alert_message := "{{+B}}{{+R}}Ordered: " || OrderName || "{{-R}} \n\n Last Theophylline level was > 48 hours ago. Monitor theophylline levels closely especially when changing the dose or frequency. {{-B}}"; doalert := true; endif; endif; If ClassTypeValue_value_list = "Valproic" then If Valproic is Null then // alert_message := "{{+B}}{{+R}}Ordered: " || OrderName || "{{-R}} \n\n Last Valproic Acid level was > 48 hours ago. Monitor valproic acid levels closely especially when changing the dose or frequency. {{-B}}"; alert_message := "{{+B}}{{+R}}Ordered: " || OrderName || "{{-R}} \n\n No Valproic Acid levels available for this admission. Monitor valproic acid levels closely especially when changing the dose or frequency. {{-B}}"; doalert := true; endif; endif; If ClassTypeValue_value_list = "Carbamazepine" then If Carbamazepine is Null then alert_message := "{{+B}}{{+R}}Ordered: " || OrderName || "{{-R}} \n\n No Carbamazepine levels available for this admission. Monitor carbamazepine levels closely especially when changing the dose or frequency. {{-B}}"; doalert := true; endif; endif; If ClassTypeValue_value_list = "Digoxin" then If Digoxin is Null and ((CRCL_Value as number) < 50) then alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. " || " \n Calculated with a Serum Creatinine of: " || Creatinine || "mg/dl " || " \n\n {{+R}} Ordered: " || OrderName || "{{-R}} \n\n Last Digoxin level was > 48 hours ago. Monitor digoxin levels closely in patients with renal dysfunction escpecially when changing the dose or frequency. {{-B}}" || "\n\n\n Calculation Information: " || CrCl_Message; doalert := true; endif; endif; else doalert := false; endif; ;; priority: 50 ;; evoke: order_enter_event; ;; logic: if called_by_editor then conclude false; endif; //---------------------------------------------------------------- // If there is no evoking object then do nothing, this can // only be true for the MLM Editor //---------------------------------------------------------------- if EvokingObject is null then conclude false; endif; if continue_processing = false then conclude false; endif; conclude doalert; ;; action: write alert_message at dose_alert_dest ;; Urgency: 50;; end: