maintenance: title: SCH_ALERT_ON_ANTICOAGULANT_ORDERS;; mlmname: SCH_ALERT_ON_ANTICOAGULANT_ORDERS;; arden: version 2.5;; version: 5.50;; institution: Allscripts;; author: Juliet M. Law;; specialist: Teresa Spicuzza;; date: 2011-07-25;; validation: testing;; library: purpose: Generate alert if an anticoagulant order exists that conflicts with anticoagulant medication being ordered. ;; explanation: When an order for an anticoagulant is requested, the MLM will check for an existing anticoagulant order. If one exists, then an alert will be generated informing the user that these two orders cannot coexist. The following anticoagulant medications report a conflict and generate a hard or soft stop alert: Soft Stop Alerts --------------------- Lovenox -> Heparin IV Xarelto -> Warfarin Hard Stop Alerts ------------------------ Lovenox -> Heparin SQ Lovenox -> Pradaxa Lovenox -> Xarelto Heparin IV -> Pradaxa Heparin IV -> Xarelto Heparin SQ -> Pradaxa Heparin SQ -> Xarelto Xarelto -> Pradaxa Pradaxa -> Xarelto Warfarin -> Xarelto Change History: 2012.08.19 JML Created 2012.04.04 JML Added logic to capture unsubmitted anticoagulant orders and save to session variable so it can be checked on a Form called MLM 2012.04.26 JML Added logic to include alerts for duplicate orders of Heparin IV, Heparin SQ, and Lovenox. 2012.05.09 JML Changed Lovenox duplicate med alert to soft stop 2012.05.16 JML Changed Heparin duplicate med alert to soft stop 2013.04.09 JML Changed Heparin IV -> Pradaxa & Xarelto from a hard stop to a soft stop 2013.05.01 JML CSR #31334: Added alerts for anticoagulant med additions Arixtra, Argatroban, and Eliquis 2014.10.07 TMS CSR #32392: Added "Warfarin Orders" to the Warfarin_Orderset_Event declaration. 2015.02.03 TMS Corrected name of Dabigatran order set to match catalog name. Ticket 1628100 2015.09.24 TMS Added low intesity heparin protocol to logic. CSR 33670 2016.03.21 JML CSR 33801: Added alert support for Post Op Cardiac Arrest Induced Hypothermia and Non-Formulary Orders order sets. 2017.10.05 SZ CSR #35039: requested changes cause unnecessary alert fatigue in ordersets “Rivaroxaban” and “Apixaban”. I have added child orders to both ordersets with modifier "- Initial Dose" and "- Maintenance Dose" and inserted code in this MLM to prevent orders with those modifiers from firing. 2018.05.31 JML CSR # 35994: Remove pradaxa, xarelto, and apixaban reorder events. This is to remove duplicate anticoagulant alerts that are firing when entering certain orders. 2018.09.11 JML CSR # 37062, 36317: Include functional call to anticoagulant conflict check MLM 2018.11.16 JML CSR # 37344/37345/37346: Added new DVT Anticoagulant Orders- Ortho Procedures order set; called from some ortho post op order sets. 2019.02.12 JML WO# 3622425: Modified Heparin IV duplicate alert to display both order name and order set name for tPA for Pulmonary Embolism due to alert verbiage confusion. ;; keywords: ;; knowledge: type: data-driven;; data: //.Net libraries standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; //Local session object local_session := cds_session.local; //Include MLM to create Alert On Action object create_alert_on_action_obj := MLM {{{SINGLE-QUOTE}}}STD_FUNC_CREATE_ALERT_ACTION_OBJECT{{{SINGLE-QUOTE}}}; /*******************************************************************/ //Set to true if logging needed log_execution_info := false; //Set the text for this variable to indicate whether to send the message or not send_alert := "DoNotSend"; //Set the stop message stop_message := false; soft_message := false; //Set stop hard_stop := false; found_unsubmitted_orders := false; existing_orders := (); alert_priority := "High"; include_generic_msg := true; include_trans_msg := false; //Destination Object Properties alert_dialog := "Must Acknowledge"; alert_message := ""; alert_override_msg := ""; ok_to_show_aoa := false; //Define list of anticoagulant medications (anticoagulant_meds) := READ {"SELECT ocmi.Name" || " FROM CV3OrderCatalogMasterItem ocmi WITH (NOLOCK)" || " WHERE ocmi.TherapeuticCategory = {{{SINGLE-QUOTE}}}coagulation modifiers | anticoagulants{{{SINGLE-QUOTE}}}" || " and ocmi.Name not like {{{SINGLE-QUOTE}}}zz%{{{SINGLE-QUOTE}}}" || " ORDER BY ocmi.Name"}; (heparin_inj_meds) := (anticoagulant_meds WHERE anticoagulant_meds IN ("Heparin Inj", "Heparin Inj -", "Heparin Inj-", "Heparin Inj.") ); (heparin_iv_meds) := (anticoagulant_meds WHERE anticoagulant_meds matches pattern "Heparin%25,000%" OR anticoagulant_meds MATCHES PATTERN "Heparin%Infusion%"); (lovenox_meds) := (anticoagulant_meds WHERE anticoagulant_meds MATCHES PATTERN "Enoxaparin%"); (pradaxa_meds) := (anticoagulant_meds WHERE anticoagulant_meds MATCHES PATTERN "Dabigatran%"); (xarelto_meds) := (anticoagulant_meds WHERE anticoagulant_meds MATCHES PATTERN "Rivaroxaban%"); (warfarin_meds) := (anticoagulant_meds WHERE anticoagulant_meds MATCHES PATTERN "Warfarin%"); //CSR #31334: Leapfrog changes (arixtra_meds) := (anticoagulant_meds WHERE anticoagulant_meds MATCHES PATTERN "Fondaparinux%"); (argatroban_meds) := (anticoagulant_meds WHERE anticoagulant_meds MATCHES PATTERN "Argatroban%"); (apixaban_meds) := (anticoagulant_meds WHERE anticoagulant_meds MATCHES PATTERN "Apixaban%"); //Define Event Triggers for anticoagulant orders and order sets pradaxa_orderset_event := event{OrderSetInit User OrderSet : WHERE OrderSetName = "Dabigatran Orders"}; //******** CSR 35994: Remove reorder events JML **************************************** //Pradaxa Order to prevent reordering //pradaxa_reorder_event := event{OrderInit User Order : // WHERE Name matches pattern "Dabigatran%"}; //pradaxa_reorder_event2 := event{OrderEnter User Order : // WHERE Name matches pattern "Dabigatran%"}; lovenox_orderset_event := event{OrderSetInit User OrderSet : WHERE OrderSetName IN ("Enoxaparin" , "Blood Formation/Coagulation" , "Enoxaparin Inj - (Lovenox) 40mg, SQ Q24H" , "Enoxaparin Inj Orders - Post Op Shoulder" , "Enoxaparin Inj Orders - Post Op Hip" , "Enoxaparin Inj Orders - Post Op Knee" , "Enoxaparin Orders - Calculated Dose with CrCl (CPOE Only)")}; heparin_orderset_event := event{OrderSetInit User OrderSet : WHERE OrderSetName IN ("Weight Based Heparin Protocol (Initial)" ,"Weight Based Heparin Protocol (Maint.)" ,"Post Op Vascular Heparin (Initial)" ,"Post Op Vascular Heparin (Maintenance)" ,"Cardiac/CCM Heparin Protocol (Initial)" ,"Cardiac/CCM Heparin Protocol (Maint)" ,"Low Intensity Heparin Protocol (Init)" ,"Low Intensity Heparin Protocol (Maint)" ,"Retavase Therapy for AMI." ,"Heparin (Vascular Orders) -" ,"Hemodialysis Medications" ,"Heparin IV Bolus (One Time Order Only)" ,"Heparin Inj - SQ" ,"ACS Orders" ,"Blood Formation/Coagulation")}; xarelto_orderset_event := event{OrderSetInit User OrderSet : WHERE OrderSetName = "Rivaroxaban"}; //******** CSR 35994: Remove reorder events JML **************************************** //Xarelto Order to prevent reordering //xarelto_reorder_event := event{OrderInit User Order : // WHERE Name matches pattern "Rivaroxaban%"}; //xarelto_reorder_event2 := event{OrderEnter User Order : // WHERE Name matches pattern "Rivaroxaban%"}; warfarin_orderset_event := event{OrderSetInit User OrderSet : WHERE OrderSetName IN ("Warfarin Sliding Scale" ,"Warfarin Tablet" ,"Warfarin Orders" ,"Warfarin Vial Injection")}; heparin_nonprotocol_event := event{OrderInit User Order : where typecode="Medication" and Name = "Heparin 25,000 Units + D5W 500ml"}; heparin_nonprotocol_event2 := event{OrderEnter User Order : WHERE typecode = "Medication" and Name = "Heparin 25,000 Units + D5W 500ml"}; //CSR #31334: Leapfrog changes argatroban_order_event := event {OrderInit User Order : WHERE Name matches pattern "Argatroban%"}; apixaban_orderset_event := event {OrderSetInit User OrderSet : WHERE OrderSetName = "Apixaban"}; //******** CSR 35994: Remove reorder events JML **************************************** //apixaban_reorder_event := event {OrderInit User Order : // WHERE Name matches pattern "Apixaban%"}; //apixaban_reorder_event2 := event {OrderEnter User Order : // WHERE Name matches pattern "Apixaban%"}; //These are the OS event triggers - secondary MLM FORM_FUNC_ANTICOAGULANT_CONFLICT_CHECK interacts with these events //within the OS themselves anticoag_os_event := event{OrderSetInit User OrderSet : WHERE OrderSetName matches pattern "VTE Prophylaxis%" OR OrderSetName IN ("CCM Admission Orders" ,"Non Formulary Medications - Order Set" ,"Total Knee Replacement Post Op Orders" ,"Total Hip Replacement Post Op Orders" ,"Fractured Hip Post Op Orders" ,"Post Op Cardiac Arrest Induced Hypothermia" ,"Post Op Shoulder" ,"tPA (Alteplase) for the Treatment of Pulmonary Embolism (PE)" , "DVT Anticoagulant Orders- Ortho Procedures")}; //Destination order_alert_dest := destination {alert} with [alert_type := warning, short_message := "Anticoagulant Order Conflict", priority := alert_priority, scope := Chart, rule_group := "Anticoagulant Conflict Group", rule_number := 8000, send_with_order := send_alert, alert_dialog_settings := alert_dialog, display_alert := true]; /*******************************************************************/ //Unit testing if called_by_editor then evokingobject := read last {OrderSet : THIS where OrderSetName matches pattern "Heparin Inj%"}; endif; //Capture current patient (clientGuid, clientName) := read last {ClientInfo : GUID, DisplayName}; clientVisitGuid := read last {ClientVisit : GUID}; chartGuid := read last {ClientVisit : ChartGUID}; //Determine evoking event - grab order or order set object if (EvokingEvent = heparin_nonprotocol_event OR EvokingEvent = heparin_nonprotocol_event2 //OR EvokingEvent = pradaxa_reorder_event //OR EvokingEvent = pradaxa_reorder_event2 //OR EvokingEvent = xarelto_reorder_event //OR EvokingEvent = xarelto_reorder_event2 //OR EvokingEvent = apixaban_reorder_event //OR EvokingEvent = apixaban_reorder_event2 OR EvokingEvent = argatroban_order_event) then (this_order_id, this_order) := read last {Order : GUID, Name Referencing EvokingObject}; else (this_order_id, this_order) := read last {OrderSet : GUID, OrderSetName Referencing EvokingObject}; endif; //Check for unsubmitted anticoagulant orders (existing_orders, origOrderSet) := READ { UnsubmittedOrders: Name, OrderSetName WHERE Name matches pattern "Heparin Inj%" OR Name matches pattern "Heparin 25%" OR Name matches pattern "Heparin 25%" OR Name matches pattern "Enoxaparin%" OR Name matches pattern "Dabigatran%" OR Name matches pattern "Rivaroxaban%" OR Name matches pattern "Warfarin%" OR Name matches pattern "Fondaparinux%" OR Name matches pattern "Argatroban%" OR Name matches pattern "Apixaban%" }; //If triggering on unsubmitted orders, set boolean to true for logic to configure alert destination and // set local session var to the list of unsubmitted orders - local session var will be checked // in the OS conflict check if ((exists (existing_orders)) AND (count(existing_orders) > 0)) then hard_stop := true; if (EvokingEvent = anticoag_os_event) then local_session.SessionUnsubmittedAnticoagulantOrders := existing_orders; endif; else //No unsubmitted anticoagulant order - check for existing anticoagulant active orders (existing_orders, origOrderSet) := read {"SELECT o.Name, o.OrderSetName, o.TouchedWhen" || " FROM CV3Order as o with (nolock) JOIN CV3OrderCatalogMasterItem AS ocmi with (nolock)" || " ON o.OrderCatalogMasterItemGUID = ocmi.GUID" || " WHERE o.ClientGUID = " || clientGuid || " AND o.ClientVisitGUID = " || clientVisitGuid || " AND o.ChartGUID = " || chartGuid || " AND (o.Name like {{{SINGLE-QUOTE}}}Enoxaparin%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Heparin%25,000%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Heparin Inj%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Dabigatran%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Rivaroxaban%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Warfarin%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Fondaparinux%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Argatroban%{{{SINGLE-QUOTE}}}" || " OR o.Name like {{{SINGLE-QUOTE}}}Apixaban%{{{SINGLE-QUOTE}}})" || " AND" || " ((o.OrderStatusLevelNum > 15" || " AND o.OrderStatusLevelNum NOT IN ({{{SINGLE-QUOTE}}}69{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}70{{{SINGLE-QUOTE}}}, {{{SINGLE-QUOTE}}}100{{{SINGLE-QUOTE}}}))" || " OR o.OrderStatusCode = {{{SINGLE-QUOTE}}}HOLD{{{SINGLE-QUOTE}}})" , primarytime = touchedWhen}; order_count := count(existing_orders) as number; if (order_count > 0) then hard_stop := true; endif; endif; if (hard_stop) then //Keep counter in case other anticoagulant order exist that are not in conflict i := 0; //loop through existing, active patient orders for orderItem in existing_orders do i := i + 1; //LOVENOX CHECK (trying to order) if ((EvokingEvent = lovenox_orderset_event)) then //LOVENOX -> HEPARIN IV, ARGATROBAN if ((orderItem in heparin_iv_meds) OR (orderItem in argatroban_meds)) then soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_trans_msg := true; //ARGATROBAN custom message if (orderItem in argatroban_meds) then alert_override_msg := "\n \n Start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} infusion is stopped."; //HEAPRIN IV custom message elseif (orderItem in heparin_iv_meds) then alert_override_msg := "\n \n Start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 2 hours before to 2 hours after {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} infusion is stopped based on last aPTT."; endif; //LOVENOX -> HEPARIN SQ, PRADAXA, XARELTO, ARIXTRA, APIXABAN elseif ((orderItem in heparin_inj_meds) OR (orderItem in pradaxa_meds) OR (orderItem in xarelto_meds) OR (orderItem in arixtra_meds) OR (orderItem in apixaban_meds)) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; //APIXABAN custom message if (orderItem in apixaban_meds) then alert_override_msg := "\n \n Discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //XARELTO custom message elseif (orderItem IN xarelto_meds) then alert_override_msg := "\n When switching from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and give {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //PRADAXA custom message elseif (orderItem IN pradaxa_meds) then alert_override_msg := "\n If CrCl is greater than or equal to 30 ml/min, begin {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 12 hours after last {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose." || "\n\nIf CrCl is less than 30 ml/min, begin {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 24 hours after last {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose."; endif; //LOVENOX -> LOVENOX (duplicate) elseif ((orderItem IN lovenox_meds)) then soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_generic_msg := false; alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}Enoxaparin{{-R}}." || " You MUST discontinue the previous {{+R}}Enoxaparin{{-R}} " || "order before placing a new {{+R}}Enoxaparin{{-R}} order, UNLESS the therapies will not be overlapping." || "\n\nIf this is a One Time dose, OR if the therapies will not overlap and will be given sequentially, click {{{SINGLE-QUOTE}}}Proceed{{{SINGLE-QUOTE}}}{{-B}}"; endif; //PRADAXA CHECK (trying to order) elseif (EvokingEvent = pradaxa_orderset_event ) then // OR EvokingEvent = pradaxa_reorder_event // OR EvokingEvent = pradaxa_reorder_event2) then //PRADAXA -> HEPARIN SQ, LOVENOX, XARELTO, WARFARIN, ARIXTRA, APIXABAN if ((orderItem in heparin_inj_meds) OR (orderItem in lovenox_meds) OR (orderItem in xarelto_meds) OR (orderItem in warfarin_meds) OR (orderItem in arixtra_meds) OR (orderItem in apixaban_meds)) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; //WARFARIN custom message if (orderItem in warfarin_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when INR {{+B}}is less than{{-B}} 2.0"; //ARIXTRA custom message elseif (orderItem in arixtra_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 0-2 hours before the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //APIXABAN custom message elseif (orderItem in apixaban_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //LOVENOX custom message elseif (orderItem in lovenox_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 0-2 hours before the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; endif; //PRADAXA -> HEPARIN IV, ARGATROBAN elseif ((orderItem in heparin_iv_meds) OR (orderItem in argatroban_meds)) then soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_generic_msg := false; alert_override_msg := "{{+B}}{{+R}}" || this_order || "{{-R}} and {{+R}}" || order_name || "{{-R}} should not be used together due to increased bleeding risk" || " except when transitioning from {{+R}}" || order_name || "{{-R}} to {{+R}}" || this_order || "{{-R}}{{-B}}." || "\n\nStart {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}" || " when {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}}" || " infusion is stopped."; //PRADAXA -> PRADAXA (duplicate) elseif ( orderItem IN pradaxa_meds ) then soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_generic_msg := false; alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}Pradaxa{{-R}}." || " You MUST discontinue the previous {{+R}}Pradaxa{{-R}} " || "order before placing a new {{+R}}Pradaxa{{-R}} order, UNLESS the therapies will not be overlapping." || "\n\nIf this is a One Time dose, OR if the therapies will not overlap and will be given sequentially, click {{{SINGLE-QUOTE}}}Proceed{{{SINGLE-QUOTE}}}{{-B}}"; endif; //XARELTO CHECK (trying to order) elseif (EvokingEvent = xarelto_orderset_event ) then // OR EvokingEvent = xarelto_reorder_event // OR EvokingEvent = xarelto_reorder_event2) then //XARELTO -> HEPARIN SQ, LOVENOX, PRADAXA, WARFARIN, ARIXTRA, APIXABAN if ((orderItem in heparin_inj_meds) OR (orderItem in lovenox_meds) OR (orderItem in pradaxa_meds) OR (orderItem in warfarin_meds) OR (orderItem in arixtra_meds) OR (orderItem in apixaban_meds)) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; //WARFARIN custom message if (orderItem in warfarin_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when INR {{+B}}is less than{{-B}} 3.0"; //ARIXTRA custom message elseif (orderItem in arixtra_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 0-2 hours before the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //APIXABAN custom message elseif (orderItem in apixaban_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //LOVENOX custom message elseif (orderItem in lovenox_meds) then alert_override_msg := "\n \n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 0-2 hours before the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; endif; //XARELTO -> HEPARIN IV, ARGATROBAN elseif ((orderItem in heparin_iv_meds) OR (orderItem in argatroban_meds)) then soft_message := true; order_name := orderItem; alert_priority := "High"; alert_dialog := "Must Acknowledge"; include_generic_msg := false; alert_override_msg := "{{+B}}{{+R}}" || this_order || "{{-R}} and {{+R}}" || order_name || "{{-R}} should not be used together due to increased bleeding risk" || " except when transitioning from {{+R}}" || order_name || "{{-R}} to {{+R}}" || this_order || "{{-R}}{{-B}}." || "\n\nStart {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}" || " when {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}}" || " infusion is stopped."; //XARELTO -> XARELTO (duplicate) elseif ( orderItem IN xarelto_meds ) and (EVOKINGOBJECT.Modifier <> "- Initial Dose") and (EVOKINGOBJECT.Modifier <> "- Maintenance Dose") then //CSR #35039 SZ soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_generic_msg := false; alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}Xarelto{{-R}}." || " You MUST discontinue the previous {{+R}}Xarelto{{-R}} " || "order before placing a new {{+R}}Xarelto{{-R}} order, UNLESS the therapies will not be overlapping." || "\n\nIf this is a One Time dose, OR if the therapies will not overlap and will be given sequentially, click {{{SINGLE-QUOTE}}}Proceed{{{SINGLE-QUOTE}}}{{-B}}"; endif; //WARFARIN CHECK (trying to order) elseif (EvokingEvent = warfarin_orderset_event) then //WARFARIN -> XARELTO, APIXABAN if ((orderItem in xarelto_meds) OR (orderItem in apixaban_meds)) then soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; //APIXABAN custom message if (orderItem in apixaban_meds) then alert_override_msg := "When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} because it affects the INR." || "\n \n Use Heparin or Lovenox with {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} as bridge therapy while waiting for the INR to rise" || " if therapeutic levels are needed immediately."; //XARELTO custom message elseif (orderItem in xarelto_meds) then alert_override_msg := "\n When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} because {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} affects the INR." || "\n\nUse Heparin or Lovenox with {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} as bridge therapy while waiting for the INR to rise" || " if therapeutic levels are needed immediately."; //GENERIC message else alert_override_msg := "{{+B}}{{+R}}" || this_order || "{{-R}} and {{+R}}" || order_name || "{{-R}} should not be used together due to increased bleeding risk" || " except when transitioning from {{+R}}" || order_name || "{{-R}} to {{+R}}" || this_order || "{{-R}}{{-B}}."; endif; endif; //HEPARIN CHECK (trying to order) elseif ((EvokingEvent = heparin_orderset_event) OR (EvokingEvent = heparin_nonprotocol_event) OR (EvokingEvent = heparin_nonprotocol_event2)) then //HEPARIN SQ CHECK (trying to order) if (this_order = "Heparin Inj - SQ") then //HEPARIN SQ -> LOVENOX, PRADAXA, XARELTO, HEPARIN IV, ARIXTRA, ARGATROBAN, APIXABAN if ((orderItem in lovenox_meds) OR (orderItem in pradaxa_meds) OR (orderItem in xarelto_meds) OR (orderItem in heparin_iv_meds) OR (orderItem in arixtra_meds) OR (orderItem in argatroban_meds) OR (orderItem in apixaban_meds)) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; //HEPARIN SQ -> HEPARIN SQ (duplicate) elseif (orderItem in heparin_inj_meds) then soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_generic_msg := false; alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}Heparin SQ{{-R}}." || " You MUST discontinue the previous {{+R}}Heparin SQ{{-R}} " || "order before placing a new {{+R}}Heparin SQ{{-R}} order, UNLESS the therapies will not be overlapping." || "\n\nIf this is a One Time dose, OR if the therapies will not overlap and will be given sequentially, click {{{SINGLE-QUOTE}}}Proceed{{{SINGLE-QUOTE}}}{{-B}}"; endif; //HEPARIN IV CHECK (trying to order) else //HEPARIN IV -> PRADAXA, XARELTO, LOVENOX, ARIXTRA, ARGATROBAN, APIXABAN if ((orderItem in pradaxa_meds) OR (orderItem in xarelto_meds) OR (orderItem in lovenox_meds) OR (orderItem in arixtra_meds) OR (orderItem in argatroban_meds) OR (orderItem in apixaban_meds)) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; //APIXABAN custom message if (orderItem in apixaban_meds) then alert_override_msg := "When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} infusion when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //XARELTO custom message elseif (orderItem in xarelto_meds) then alert_override_msg := "\n When switching from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue the {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} infusion when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose whould have been due."; //PRADAXA custom message elseif (orderItem in pradaxa_meds) then alert_override_msg := "If CrCl is greater than or equal to 30 ml/min, begin {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 12 hours after last {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose." || "\n\nIf CrCl is less than 30 ml/min, begin {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} 24 hours after last {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose."; endif; //HEPARIN IV -> HEPARIN SQ elseif (orderItem IN heparin_inj_meds) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; include_generic_msg := false; alert_override_msg := "{{+B}}Avoid concurrent use of {{+R}}" || this_order || "{{-R}} and {{+R}}" || order_name || " SQ{{-R}} due to increased bleeding risk.{{-B}}" || "\nContact physician to adjust orders."; //HEPARIN IV -> HEPARIN IV (duplicate) elseif (orderItem in heparin_iv_meds) then soft_message := true; order_name := orderItem; alert_dialog := "Must Acknowledge"; alert_priority := "Low"; include_generic_msg := false; if ( origOrderSet[i] = "tPA (Alteplase) for the Treatment of Pulmonary Embolism (PE)" ) then alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}" || order_name || "{{-R}} from {{+B}}" || origOrderSet[i] || ". Please discontinue the {{+R}}" || order_name || "{{-R}} before placing an order"; else alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}" || origOrderSet[i] || "{{-R}}. Please discontinue the {{+R}}" || origOrderSet[i] || "{{-R}} before placing an order"; endif; //HEPARIN NON PROTOCOL ORDER handling if ((EvokingEvent = heparin_nonprotocol_event) OR (EvokingEvent = heparin_nonprotocol_event2)) then alert_override_msg := alert_override_msg || " for {{+R}}" || this_order || "{{-R}}.{{-B}}"; else alert_override_msg := alert_override_msg || " from the {{+R}}" || this_order || "{{-R}}.{{-B}}"; endif; //end EvokingEvent = heparin_nonprotocol_event endif; //End orderItem IN pradaxa_meds...elseif... endif; //End this_order = Heparin_Inj = SQ....else.... //ARGATROBAN CHECK (trying to order) elseif (EvokingEvent = argatroban_order_event) then //ARGATROBAN -> LOVENOX, ARIXTRA, HEPARIN SQ, HEPARIN IV, PRADAXA, XARELTO, APIXABAN if ((orderItem IN lovenox_meds) OR (orderItem IN arixtra_meds) OR (orderItem IN heparin_inj_meds) OR (orderItem IN heparin_iv_meds) OR (orderItem IN pradaxa_meds) OR (orderItem IN xarelto_meds) OR (orderItem IN apixaban_meds)) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; //PRADAXA custom message if (orderItem IN pradaxa_meds) then alert_override_msg := "If CrCl is greater than or equal to 30 ml/min, begin {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} infusion 12 hours after last {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose." || "\n \n If CrCl is less than 30 ml/min, begin {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} infusion 24 hours after last {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose."; //XARELTO custom message elseif (orderItem IN xarelto_meds) then alert_override_msg := "When switching from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} , discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} infusion when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //APIXABAN custom message elseif (orderItem IN apixaban_meds) then alert_override_msg := "When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} infusion when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; endif; //ARGATROBAN -> ARGATROBAN (duplicate) elseif (orderItem IN argatroban_meds) then soft_message := true; order_name := orderItem; alert_dialog := "Must Acknowledge"; alert_priority := "Low"; include_generic_msg := false; alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}Argatroban{{-R}}." || " You MUST discontinue the previous {{+R}}Argatroban{{-R}} " || "order before placing a new {{+R}}Argatroban{{-R}} order, UNLESS the therapies will not be overlapping." || "\n\nIf this is a One Time dose, OR if the therapies will not overlap and will be given sequentially, click {{{SINGLE-QUOTE}}}Proceed{{{SINGLE-QUOTE}}}{{-B}}"; endif; //APIXABAN CHECK (trying to order) elseif (EvokingEvent = apixaban_orderset_event ) then // OR EvokingEvent = apixaban_reorder_event // OR EvokingEvent = apixaban_reorder_event2) then //APIXABAN -> LOVENOX, ARIXTRA, HEPARIN SQ, WARFARIN, PRADAXA, XARELTO if ((orderItem IN lovenox_meds) OR (orderItem IN arixtra_meds) OR (orderItem IN heparin_inj_meds) OR (orderItem IN warfarin_meds) OR (orderItem IN pradaxa_meds) OR (orderItem IN xarelto_meds)) then stop_message := true; order_name := orderItem; alert_dialog := "No Override Allowed"; //LOVENOX, ARIXTRA, PRADAXA, XARELTO custom message if ((orderItem IN lovenox_meds) OR (orderItem IN arixtra_meds) OR (orderItem IN pradaxa_meds) OR (orderItem IN xarelto_meds)) then alert_override_msg := "When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when the next {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} dose would have been due."; //WARFARIN custom message elseif (orderItem IN warfarin_meds) then alert_override_msg := "When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when INR less then 2.0."; endif; //APIXABAN -> HEPARIN IV, ARGATROBAN elseif ((orderItem IN heparin_iv_meds) OR (orderItem IN argatroban_meds)) then soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_trans_msg := true; alert_override_msg := "When converting from {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} to {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}}, discontinue {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} and start {{+B}}{{+R}}" || this_order || "{{-R}}{{-B}} when {{+B}}{{+R}}" || order_name || "{{-R}}{{-B}} infusion is stopped."; //APIXABAN -> APIXABAN (duplicate) elseif (orderItem IN apixaban_meds) and (EVOKINGOBJECT.Modifier <> "- Initial Dose") and (EVOKINGOBJECT.Modifier <> "- Maintenance Dose") then //CSR #35039 SZ soft_message := true; order_name := orderItem; alert_priority := "Low"; alert_dialog := "Must Acknowledge"; include_generic_msg := false; alert_override_msg := "{{+B}}Duplicate Medication Alert! This patient already has an order for {{+R}}Apixaban{{-R}}." || " You MUST discontinue the previous {{+R}}Apixaban{{-R}} " || "order before placing a new {{+R}}Apixaban{{-R}} order, UNLESS the therapies will not be overlapping." || "\n\nIf this is a One Time dose, OR if the therapies will not overlap and will be given sequentially, click {{{SINGLE-QUOTE}}}Proceed{{{SINGLE-QUOTE}}}{{-B}}"; endif; endif; //End EvokingEvent = heparin_orderset_event...elseif...else enddo; //End looping through existing, active patient anticoagulant orders endif; // End hard_stop = true //Set alert priority and dialog settings based on CONFLICT order_alert_dest.Priority := alert_priority; order_alert_dest.Alert_Dialog_Settings := alert_dialog; //Configure message based on alert and custom settings if ((stop_message and soft_message) OR (stop_message and not(soft_message))) then alert_message := "{{+B}}Avoid concurrent use of {{+R}}" || this_order || "{{-R}} and {{+R}}" || order_name || "{{-R}} due to increased bleeding risk.{{-B}} Contact physician to adjust orders."; //Determine if we display an override message along with or in place of the generic message if (alert_override_msg <> "") then if (include_generic_msg) then alert_message := alert_message || "\n\n" || alert_override_msg; else alert_message := alert_override_msg; endif; endif; elseif (soft_message) then alert_message := "{{+B}}{{+R}}" || this_order || "{{-R}} and {{+R}}" || order_name || "{{-R}} " || " should not be used together due to increased bleeding risk"; if (include_trans_msg) then alert_message := alert_message || " except when transitioning from {{+R}}" || order_name || "{{-R}} to {{+R}}" || this_order || "{{-R}}{{-B}}."; else alert_message := alert_message || ".{{-B}} Contact physician to adjust orders"; endif; if (alert_override_msg <> "") then if (include_generic_msg) then alert_message := alert_message || "\n\n" || alert_override_msg; else alert_message := alert_override_msg; endif; endif; else hard_stop := false; endif; ;; priority: 50 ;; evoke: pradaxa_orderset_event; xarelto_orderset_event; lovenox_orderset_event; heparin_orderset_event; heparin_nonprotocol_event; heparin_nonprotocol_event2; warfarin_orderset_event; //pradaxa_reorder_event; //pradaxa_reorder_event2; //xarelto_reorder_event; //xarelto_reorder_event2; argatroban_order_event; apixaban_orderset_event; //apixaban_reorder_event; //apixaban_reorder_event2; anticoag_os_event ;; logic: conclude hard_stop ;; action: write alert_message at order_alert_dest; ;; Urgency: 50;; end: