765 lines
36 KiB
Plaintext
765 lines
36 KiB
Plaintext
maintenance:
|
|
|
|
title: Dosing recommendations based upon CrCl;;
|
|
mlmname: SCH_Renal_Dosing_Recommendations;;
|
|
arden: version 2;;
|
|
version: 5.50;;
|
|
institution: St Clair;;
|
|
author: Teresa Spicuzza, Allscripts Corp;;
|
|
specialist: Teresa Spicuzza;;
|
|
date: 2012-07-02;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: Renal Dosing Recommendations
|
|
;;
|
|
|
|
explanation: MLM will read table and suggest dosing based upon medication, dose and CrCl.
|
|
|
|
Change history
|
|
07.02.2012 TMS Created for pilot CSR 30865
|
|
08.21.2012 TMS Updated for all CPOE and logic for <User Schedule> CSR 30865
|
|
08.31.2012 TMS Updated to include order, dose and schedule in alert dialog CSR 30865
|
|
06.05.2013 TMS Updated with additional rules to accommodate additional drugs. CSR 31334
|
|
06.09.2014 TMS Updated with change to message for Apixaban (Eliquis) Rule K. CSR 32852
|
|
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
|
|
05.31.2017 TMS Updated with rules O, P, Q, R to accommodate changes for digoxin dosing and to add
|
|
Metformin alerts with GFR value. CSR 35032 and 35636
|
|
10.26.2017 TMS Add user data item retrieval to search for checkbox to suppress renal alert when
|
|
value is true. Currently used for to suppress alert for Apixaban for DVT/PE but
|
|
fire when used Atrial Fib. CSR 35059
|
|
05.16.2018 TMS Add "With Dialysis Treatment" to Frequency retrievals that contain As Ordered.
|
|
CSR 33940
|
|
09.30.2019 TMS Updated alert to require reason when alert presented to user not in physician/physician extender
|
|
group. CSR 37977
|
|
;;
|
|
keywords: Renal Dosing
|
|
|
|
;;
|
|
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="Loratadine 10mg Tab" };
|
|
endif;
|
|
SP := " ";
|
|
CR := 13 formatted with "%c";
|
|
LF := 10 formatted with "%c";
|
|
CRLF:= CR||LF;
|
|
TAB := 9 formatted with "%c";
|
|
messageA := SP;
|
|
messageB := SP;
|
|
messageC := SP;
|
|
doalert := false;
|
|
SupressRenalAlert := false;
|
|
order_enter_event := event { OrderEnter User Order: where TypeCode = "Medication"};
|
|
|
|
(CatalogItemObj, FrequencyValue, UOMValue, DoseValue, OrderName, OrderRoute, AdminIns, UserSchedType ,UserSchedDays, UserSchedDoses) := read last {Order: OrderCatalogMasterItem, FrequencyCode, UOM, DosageLow, Name, OrderRouteCode, AdminInstructions, Interval, DaysInInterval, DoseMultiplier
|
|
REFERENCING EvokingObject};
|
|
CatalogClassTypeValueObj := read last {OrderCatalogMasterItem: CatalogClassTypeValue,
|
|
REFERENCING CatalogItemObj};
|
|
|
|
ClassTypeValue_code_list, ClassTypeValue_value_list := read {CatalogClassTypeValue: Code, Value
|
|
REFERENCING CatalogClassTypeValueObj where code = "PRX_RenalAdjustment"};
|
|
|
|
/* Get the OrderAdditionalInfo object pointer */
|
|
OrderAdditionalInfoObj := read last { Order: OrderAdditionalInfo
|
|
REFERENCING EvokingObject };
|
|
|
|
/* Get information from the OrderAdditionalInfo object */
|
|
( SummaryLine, FreqfromTime,FreqUOM ) := read last { OrderAdditionalInfo: FreqSummaryLine ,FreqFromTime, FreqUOM
|
|
REFERENCING OrderAdditionalInfoObj };
|
|
|
|
/* Get the OrderUserData object pointer */
|
|
OrderUserDataObj := read last
|
|
{ Order: OrderUserData
|
|
REFERENCING EvokingObject };
|
|
|
|
for r in (1 seqto(count(OrderUserDataObj))) do
|
|
|
|
CurOrder_UserDataFields := OrderUserDataObj[r];
|
|
(userdatacodelist, valuelist ) := read { OrderUserData: UserDataCode, Value REFERENCING CurOrder_UserDataFields } ;
|
|
for s in (1 seqto(count(userdatacodelist))) do
|
|
if ((userdatacodelist [s] = "PRX_Suppress_Renal_Alert") and valuelist [s] = "1" ) then
|
|
SupressRenalAlert := True;
|
|
endif;
|
|
enddo;
|
|
enddo;
|
|
|
|
|
|
|
|
|
|
|
|
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) };
|
|
|
|
|
|
// continue_processing:= user_id in fire_on_User;
|
|
// continue_processing:= usercode in fire_on_User;
|
|
|
|
If usercode in fire_on_UserCPOE then
|
|
sync_alert_dialog := "";
|
|
UDDD_dictionary_name := "";
|
|
UDDD_is_restricted := FALSE;
|
|
continue_processing := true;
|
|
elseif usercode in fire_on_User then
|
|
sync_alert_dialog := "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 := "Renal Dosing Recommendation",
|
|
priority := "Low",
|
|
scope := "Chart",
|
|
rule_group := "Renal Dosing",
|
|
rule_number := 4050,
|
|
send_with_order := send_alert,
|
|
alert_dialog_settings := "",
|
|
ack_comment_UDDD := UDDD_dictionary_name,
|
|
ack_comment_UDDD_is_restricted := UDDD_is_restricted,
|
|
display_alert := true];
|
|
|
|
|
|
for r in (1 seqto 1) do
|
|
classvaluelist := call str_parse with ClassTypeValue_value_list [r],",";
|
|
|
|
classvalue := classvaluelist[1];
|
|
enddo;
|
|
//
|
|
/* *** for dev testing only *** added to use typed in number in administation instruction field for creatinine level *** for dev testing only ***
|
|
tempcreat := (adminins as number);
|
|
crentered := (tempcreat is number);
|
|
tempSerumCr := (tempcreat as number);
|
|
|
|
If crentered = false then tempcreat := null; endif;
|
|
|
|
// ****end of DEV only ***
|
|
*/
|
|
|
|
(schedtime, freqcode, timefrom, timeuom) := read last
|
|
{" select fsd.ScheduledTime, cft.FrequencyCode, cft.TimeFromValue, cft.TimeUom from CV3CodedFreqTranslation cft"
|
|
|| " join CV3FixedScheduleDefinition fsd on fsd.ParentGUID = cft.guid "
|
|
|| " where cft.FrequencyCode = " || sql(frequencyvalue) || " and FrequencyClass = {{{SINGLE-QUOTE}}}<Default>{{{SINGLE-QUOTE}}} and cft.Active = 1"
|
|
|| " order by fsd.ScheduledTime "
|
|
};
|
|
|
|
(TimesPerDay) := read last {" select count (fsd.ScheduledTime) from CV3CodedFreqTranslation cft"
|
|
|| " join CV3FixedScheduleDefinition fsd on fsd.ParentGUID = cft.guid "
|
|
|| " where cft.FrequencyCode = " || sql(frequencyvalue) || " and FrequencyClass = {{{SINGLE-QUOTE}}}<Default>{{{SINGLE-QUOTE}}} and cft.Active = 1"
|
|
};
|
|
|
|
|
|
Oncegroup := ("Now", "STAT", "Once", "One Time", "Today,", "Load", "Pre-procedure",
|
|
"Post-procedure","Pre-Transfusion", "Post-Transfusion","Between Blood",
|
|
"PRE OP,", "POST OP", "As Ordered", "As Directed", "Given in Infusion Center",
|
|
"Given in Delivery Room", "With Dialysis Treatment");
|
|
|
|
|
|
If frequencyvalue in Oncegroup then
|
|
frequencygroup := "Other";
|
|
|
|
elseif frequencyvalue <> "<User Schedule>" then
|
|
If timefrom = 1 and timeuom = "day" then
|
|
|
|
If TimesPerDay = 1 then frequencygroup := "Q24H"; dosemult := 1; endif;
|
|
If TimesPerDay = 2 then frequencygroup := "Q12H"; dosemult := 2; endif;
|
|
If TimesPerDay = 3 then frequencygroup := "Q8H"; dosemult := 3; endif;
|
|
If TimesPerDay = 4 then frequencygroup := "Q6H"; dosemult := 4; endif;
|
|
If TimesPerDay = 6 then frequencygroup := "Q4H"; dosemult := 6; endif;
|
|
If TimesPerDay = 8 then frequencygroup := "Q3H"; dosemult := 8; endif;
|
|
If TimesPerDay = 12 then frequencygroup := "Q2H"; dosemult := 12; endif;
|
|
If TimesPerDay = 24 then frequencygroup := "Q1H"; dosemult := 24; endif;
|
|
|
|
elseIf timefrom = 2 and timeuom = "day" then
|
|
If TimesPerDay = 1 then frequencygroup := "Q48H"; endif;
|
|
|
|
else frequencygroup := "Other";
|
|
endif;
|
|
endif;
|
|
|
|
If frequencyvalue = "<User Schedule>" then
|
|
If UserSchedType = "Weekly" then
|
|
If UserSchedDays <= 2 and UserSchedDoses = 1 then
|
|
frequencygroup := "Q7D";
|
|
endif;
|
|
|
|
elseif UserSchedType = "Daily" and UserSchedDays = 1 and FreqFromTime = 1 and FreqUom = "day" then
|
|
If UserSchedDoses = 1 then frequencygroup := "Q24H"; dosemult := 1; endif;
|
|
If UserSchedDoses = 2 then frequencygroup := "Q12H"; dosemult := 2; endif;
|
|
If UserSchedDoses = 3 then frequencygroup := "Q8H"; dosemult := 3; endif;
|
|
If UserSchedDoses = 4 then frequencygroup := "Q6H"; dosemult := 4; endif;
|
|
If UserSchedDoses = 6 then frequencygroup := "Q4H"; dosemult := 6; endif;
|
|
If UserSchedDoses = 8 then frequencygroup := "Q3H"; dosemult := 8; endif;
|
|
If UserSchedDoses = 12 then frequencygroup := "Q2H"; dosemult := 12; endif;
|
|
|
|
elseif UserSchedType = "Daily" and UserSchedDays = 1 and FreqFromTime = 2 and FreqUom = "day" then
|
|
If UserSchedDoses = 1 then frequencygroup := "Q48H"; endif;
|
|
|
|
endif;
|
|
endif; //If frequencyvalue = "<User Schedule>"
|
|
|
|
TotalDoseValue := (DoseValue as number) * (dosemult as number);
|
|
|
|
(ClientVisitGuid, ChartGuid, ClientGuid, CurrentLocation, LocationGuid, VisitStatus) := read last {ClientVisit: GUID, ChartGUID, ClientGUID, CurrentLocation, CurrentLocationGUID, VisitStatus };
|
|
(UserGUID ) := read last { UserInfo: GUID };
|
|
|
|
//Obtain CrCl value
|
|
if EvokingEvent = order_enter_event and continue_processing = true and SupressRenalAlert = False then
|
|
if "PRX_RenalAdjustment" in ClassTypeValue_code_list then
|
|
SerumCr, 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 >= (DATEADD(hour, -240, getdate())) "
|
|
|| " and o.performeddtm >= (DATEADD(hour, -8700, getdate())) "
|
|
|| " and bo.itemname = {{{SINGLE-QUOTE}}}Creatinine Plasma/Serum{{{SINGLE-QUOTE}}} "
|
|
|| " order by o.performeddtm desc "
|
|
};
|
|
|
|
Race := read last
|
|
{" Select RaceCode from cv3client where RaceCode like {{{SINGLE-QUOTE}}}%African%{{{SINGLE-QUOTE}}} and Guid = " ||SQL (clientguid)};
|
|
|
|
If Race is not null and SerumCr is not null then
|
|
|
|
GFR, GFRName, GFRUom, AbnCode := read last
|
|
{"Select top 1 bo.value, bo.itemname, bo.UnitofMeasure, bo.AbnormalityCode "
|
|
|| " 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, -240, getdate())) "
|
|
|| " and bo.itemname = {{{SINGLE-QUOTE}}}GFR (African American){{{SINGLE-QUOTE}}} "
|
|
|| " order by o.performeddtm desc "
|
|
};
|
|
else
|
|
|
|
GFR, GFRName, GFRUom, AbnCode := read last
|
|
{"Select top 1 bo.value, bo.itemname, bo.UnitofMeasure, bo.AbnormalityCode "
|
|
|| " 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, -240, getdate())) "
|
|
|| " and bo.itemname = {{{SINGLE-QUOTE}}}GFR (Caucasian/Other){{{SINGLE-QUOTE}}} "
|
|
|| " order by o.performeddtm desc "
|
|
};
|
|
endif;
|
|
|
|
(CrCl_Message, Crcl_Value, SCRfromMLM, wt, patientage) := call CrCl_info with (ClientVisitGuid, ChartGuid, ClientGuid, SerumCr);
|
|
|
|
continue := "yes";
|
|
If patientage is NULL or wt is NULL then
|
|
birthdate := read last { ClientInfo: BirthDate };
|
|
patientAge := (NOW - birthdate) / (1 year);
|
|
patientage:= (int (patientage));
|
|
wtgm := read last
|
|
{ " Select Text from CV3PhysicalNoteDeclaration "
|
|
|| " where ClientGUID = " || SQL(clientguid)
|
|
|| " and ClientVisitGUID = " || SQL(clientvisitguid)
|
|
|| " and TypeCode = {{{SINGLE-QUOTE}}}weight{{{SINGLE-QUOTE}}} "
|
|
|| " order by Entered asc "
|
|
};
|
|
|
|
wt := (wtgm as number) / 1000; endif;
|
|
|
|
parametercount := 0;
|
|
If patientage >= 80 then parametercount := parametercount + 1; endif;
|
|
If (wt as number) <= 60 then parametercount := parametercount + 1; endif;
|
|
If (SerumCr as number) >= 1.5 then parametercount := parametercount + 1; endif;
|
|
If (SerumCr as number) >= 2 then Scr_GT_Two := True; Else Scr_GT_Two := False; endif;
|
|
|
|
|
|
// dev only
|
|
// If tempSerumCr >= 2 then Scr_GT_Two := True; Else Scr_GT_Two := False; endif;
|
|
// If SerumCr is null and tempSerumCr >= 1.5 then parametercount := parametercount + 1; endif;
|
|
// end dev only
|
|
else
|
|
continue := "no";
|
|
endif;
|
|
endif;
|
|
|
|
if (continue = "yes" and Crcl_value is not null and FrequencyGroup <> "Other") or
|
|
(continue = "yes" and Crcl_value is null and FrequencyGroup <> "Other" and parametercount >= 2) or
|
|
(continue = "yes" and classvalue = "Metformin" and ABNCode = "L") or
|
|
(continue = "yes" and FrequencyGroup <> "Other" and Scr_GT_Two = True) then
|
|
|
|
medlist := ();
|
|
medlist := read { "select value from cv3userdictionaryvalue v with (nolock)"
|
|
|| " where userdictionarycode = {{{SINGLE-QUOTE}}}PRX_RenalDosing{{{SINGLE-QUOTE}}} "
|
|
|| " and active = {{{SINGLE-QUOTE}}}1{{{SINGLE-QUOTE}}} "
|
|
};
|
|
|
|
|
|
NumRules:= count medlist;
|
|
for k in (1 seqto (NumRules)) do
|
|
rules := call str_parse with medlist[k],"|";
|
|
|
|
|
|
//Rule Class = Acyclovir IV
|
|
//Rule Type = E
|
|
//Rule Msg Type =
|
|
//Rule Order =
|
|
//Rule Dose =
|
|
//Rule Dose Hi =
|
|
//Rule UOM =
|
|
//Rule Route =
|
|
//Rule Freq Qual = IsNot
|
|
//Rule Freq = Q24H
|
|
//Rule CrCl = 10
|
|
//Rule CrCl Low =
|
|
//Rule CrCl Hi =
|
|
//Rule Msg = Administer 50% of the recommended dose Q24H.
|
|
RuleClass := rules[1];
|
|
RuleType := rules[2];
|
|
RuleMsgType := rules[3];
|
|
RuleOrder := rules[4];
|
|
RuleDose := rules[5];
|
|
RuleDoseHi := rules[6];
|
|
RuleUOM := rules[7];
|
|
RuleRoute := rules[8];
|
|
RuleFreqQual := rules[9];
|
|
RuleFreq := rules[10];
|
|
RuleCrCl := rules[11];
|
|
RuleCrClLow := rules[12];
|
|
RuleCrClHi := rules[13];
|
|
RuleMsg := rules[14];
|
|
|
|
|
|
If RuleClass = classvalue and ruletype = "A" then
|
|
|
|
If ((CrCl_Value as number) < (RuleCrCl as number)) then
|
|
|
|
If ((DoseValue as number)= (RuleDose as number)) and UOMValue = RuleUom and Frequencygroup = RuleFreq then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "B" then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) then
|
|
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom and Frequencygroup = RuleFreq then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "C" then
|
|
|
|
If ((CrCl_Value as number) < (RuleCrCl as number)) then
|
|
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "D" then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) then
|
|
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "E" then
|
|
|
|
If ((CrCl_Value as number) < (RuleCrCl as number)) then
|
|
|
|
If RuleFreqQual = "Is" and Frequencygroup = RuleFreq then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
elseif RuleFreqQual = "IsNot" and Frequencygroup <> RuleFreq then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "F" then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) then
|
|
|
|
If RuleFreqQual = "Is" and Frequencygroup = RuleFreq then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
elseif RuleFreqQual = "IsNot" and Frequencygroup <> RuleFreq then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "G" then
|
|
|
|
If ((CrCl_Value as number) < (RuleCrCl as number)) then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "H" then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "I" and OrderName = RuleOrder then
|
|
|
|
If ((CrCl_Value as number) < (RuleCrCl as number)) then
|
|
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "J" and OrderName = RuleOrder then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) then
|
|
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
elseif RuleClass = classvalue and ruletype = "K" then
|
|
|
|
|
|
//new k (for Eliquis only)
|
|
If ((parametercount as number) >= (RuleMsgType as number)) then
|
|
If SerumCr is Null then
|
|
alert_message :=
|
|
|
|
" \n Ordered: {{+B}} {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Dosing recommendation based upon the weight and age of this patient: {{+R}}" || Rulemsg || " 10 mg po BID X 7 days, then 5 mg po BID. {{-R}} {{-B}}";
|
|
|
|
doalert := true;
|
|
elseif SerumCr is not Null then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s Serum Creatinine is " || SerumCr || "mg/dl "
|
|
|| " \n\n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Dosing recommendation based upon the weight, age, and Serum Creatinine for this patient: {{+R}}" || Rulemsg ||" 10 mg po BID X 7 days, then 5 mg po BID. {{-R}} {{-B}}";
|
|
|
|
|
|
doalert := true;
|
|
endif;
|
|
|
|
endif;
|
|
|
|
// end new k
|
|
|
|
|
|
// dev only
|
|
//SerumCr := tempSerumCr;
|
|
// end dev
|
|
/* If (((CrCl_Value as number) > (RuleCrCl as number)) and
|
|
(parametercount as number) >= (RuleMsgType as number)) or
|
|
((CrCl_Value is Null) and (parametercount as number) >= (RuleMsgType as number)) then
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
If CrCl_Value is Null and SerumCr is Null then
|
|
alert_message :=
|
|
|
|
" \n Ordered: {{+B}} {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Dosing recommendation based upon the weight, age, and Serum Creatinine for this patient is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
|
|
doalert := true;
|
|
elseif CrCl_Value is Null and SerumCr is not Null then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s Serum Creatinine is " || SerumCr || "mg/dl "
|
|
|| " \n\n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Dosing recommendation based upon the weight, age, and Serum Creatinine for this patient is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
|
|
|
|
doalert := true;
|
|
else
|
|
|
|
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n\n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Dosing recommendation based upon the weight, age, and Serum Creatinine for this patient is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true; endif;
|
|
endif;
|
|
endif;
|
|
|
|
|
|
*/
|
|
elseif RuleClass = classvalue and ruletype = "L" then
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) then
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
If (RuleMsgType as number) = 1 then
|
|
messageA := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
alert_message := messageA || messageB || messageC || "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
elseIf (RuleMsgType as number) > 1 and (RuleMsgType as number) < 99 then
|
|
messageB := "{{+B}}{{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
alert_message := messageA || messageB || messageC || "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
elseIf (RuleMsgType as number) = 99 then
|
|
messageC := "{{+B}}{{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
alert_message := messageA || messageB || messageC || "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
endif;
|
|
elseif RuleClass = classvalue and ruletype = "M" then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) then
|
|
|
|
If ((TotalDoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
elseif RuleClass = classvalue and ruletype = "N" then
|
|
|
|
If ((CrCl_Value as number) < (RuleCrCl as number))and (Scr_GT_Two = True) then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this Serum Creatinine or CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
elseif ((CrCl_Value is Null) and (Scr_GT_Two = True)) or (((CrCl_Value as number) > (RuleCrCl as number)) and (Scr_GT_Two = True)) then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s Serum Creatinine is " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this Serum Creatinine is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
doalert := true;
|
|
elseIf ((CrCl_Value as number) < (RuleCrCl as number)) and (Scr_GT_Two = False) then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "O" then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) then
|
|
|
|
If ((DoseValue as number)> (RuleDose as number)) and UOMValue = RuleUom and Frequencygroup = RuleFreq then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "P" then
|
|
|
|
If ((CrCl_Value as number) >= (RuleCrClLow as number)) and ((CrCl_Value as number) < (RuleCrClHi as number)) and Frequencygroup = RuleFreq then
|
|
|
|
If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated CrCl is " || CrCl_Value || "ml/min. "
|
|
|| " \n Calculated with a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this CrCl is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}"
|
|
|| "\n\n Calculation Information: " || CrCl_Message;
|
|
doalert := true;
|
|
endif;
|
|
endif;
|
|
|
|
elseif RuleClass = classvalue and ruletype = "Q" and AbnCode = "L" then
|
|
|
|
If ((GFR as number) < (RuleCrCl as number)) then
|
|
|
|
//If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
alert_message := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated " || GFRName || " is " || GFR || " " || GFRUom
|
|
|| " \n and a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this GFR is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
doalert := true;
|
|
// endif;
|
|
endif;
|
|
elseif RuleClass = classvalue and ruletype = "R" and AbnCode = "L" then
|
|
If ((GFR as number) >= (RuleCrClLow as number)) and ((GFR as number) <= (RuleCrClHi as number)) then
|
|
// If ((DoseValue as number)>= (RuleDose as number)) and UOMValue = RuleUom then
|
|
If (RuleMsgType as number) = 1 then
|
|
messageA := "{{+B}} This patient{{{SINGLE-QUOTE}}}s estimated " || GFRName || " is " || GFR || " " || GFRUom
|
|
|| " \n and a Serum Creatinine of: " || SerumCr || "mg/dl "
|
|
|| " \n Ordered: {{+R}}"||OrderName || " " || DoseValue || " " || UomValue|| ", " || SummaryLine
|
|
|| "\n\n {{-R}}Renal dosing recommendation for a patient with this GFR is: {{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
alert_message := messageA || messageB || messageC ;
|
|
doalert := true;
|
|
elseIf (RuleMsgType as number) > 1 and (RuleMsgType as number) < 99 then
|
|
messageB := "{{+B}}{{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
alert_message := messageA || messageB || messageC ;
|
|
doalert := true;
|
|
elseIf (RuleMsgType as number) = 99 then
|
|
messageC := "{{+B}}{{+R}}" || Rulemsg || "{{-R}} {{-B}}";
|
|
alert_message := messageA || messageB || messageC ;
|
|
doalert := true;
|
|
endif;
|
|
//endif;
|
|
endif;
|
|
else
|
|
|
|
nomessage := "";
|
|
endif;
|
|
|
|
|
|
enddo;
|
|
|
|
|
|
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 = "no"
|
|
then
|
|
conclude false;
|
|
endif;
|
|
|
|
|
|
conclude doalert;
|
|
|
|
;;
|
|
action:
|
|
|
|
write alert_message at dose_alert_dest
|
|
;;
|
|
Urgency: 50;;
|
|
end:
|