Files
St.Clair/MLMStripper/bin/Debug/SCH/SCH_ORDER_REC_INSULIN_PROTOCOL.mlm

114 lines
4.3 KiB
Plaintext

maintenance:
title: SCH_ORDER_REC_INSULIN_PROTOCOL;;
filename: SCH_ORDER_REC_INSULIN_PROTOCOL;;
arden: version 2.5;;
version: 1.01;;
institution: St.Clair Hospital;;
author: Shawn Head;;
specialist: Shawn Head;;
date: 2017-10-26;;
validation: testing;;
library:
purpose: This MLM will display an alert when Admission Order Rec is opened if one of the "ED Insulin" order items from the Diabetic management protocol order set are still active on the patients chart.
Teresa created 3 new items that have a double space between the first name and second name of the drugs. As of 11/6/2017 the 3 unique ED insulin order names include....
Insulin Detemir, Insulin Glargine, Insulin (NPH) Isophane.
;;
explanation:
Change History
STH 11.6.2017 - CSR# 35723 - Diabetic Management Protocol MLM for alerting inpatient physicians when the Diabetic Management Protocol order has been placed on the patient. This MLM
may later be replaced with compass and SHM.
SZ 04.10.2018 - CSR #35545 - Therapeutic Substitution of Lantus/Levemir. Added {{{SINGLE-QUOTE}}}Insulin, Basal (Lantus/Levemir)%{{{SINGLE-QUOTE}}} to SQL statement.
;;
keywords: ;;
knowledge:
type: data-driven;;
data:
sync_alert_dialog := "Must Acknowledge";
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
include standard_libs;
CR := 13 formatted with "%c";
LF := 10 formatted with "%c";
CRLF:= CR||LF;
ORM_alert := DESTINATION {Alert} WITH
[alert_type:= "WARNING", short_message:="Order Reconciliation Informational Alert",
priority:= "high", scope:= "Chart", rule_group:= "Alert", rule_number:= 1255, alert_dialog_settings := sync_alert_dialog, ];
ORM_Admission := event {OrderReconciliationPerform User: WHERE ReconcileTypeCode = "Admission"};
client_GUID := EVOKINGOBJECT.ClientGUID;
chart_GUID := EVOKINGOBJECT.ChartGUID;
client_visit_GUID := EVOKINGOBJECT.ClientVisitGUID;
currentLocation := read last {ClientVisit : CurrentLocation};
msg := "";
display_msg := TRUE;
PatientType := read last {ClientVisit : TypeCode};
userguid :=read last {UserInfo: guid};
(usertype) := read last {" select typecode,displayname "
|| " from cv3careprovider with (nolock) "
|| " where guid = " || SQL(userguid)
|| " and typecode not like {{{SINGLE-QUOTE}}}Non Staff%{{{SINGLE-QUOTE}}} "
|| " and (typecode like {{{SINGLE-QUOTE}}}%Physician%{{{SINGLE-QUOTE}}} or typecode in ({{{SINGLE-QUOTE}}}PA{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}PA-C{{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}CRNP{{{SINGLE-QUOTE}}})) "
};
if (currentLocation matches pattern "ER-%" OR currentLocation = "ER Major") then
display_msg := FALSE;
elseIf ((exists usertype)
and (PatientType = "inpatient" or PatientType = "observation"))
then
(InsulinProtocolOrder) := read last {
" Select name from cv3order with (nolock) "
|| " where clientguid = " || sql(client_GUID)
|| " and chartguid = " || sql(chart_GUID)
|| " and clientvisitguid = " || sql(client_visit_GUID)
|| " and (name like {{{SINGLE-QUOTE}}}Insulin Detemir%{{{SINGLE-QUOTE}}}
or name like {{{SINGLE-QUOTE}}}Insulin, Basal (Lantus/Levemir)%{{{SINGLE-QUOTE}}}
or name like {{{SINGLE-QUOTE}}}Insulin Glargine%{{{SINGLE-QUOTE}}}
or name like {{{SINGLE-QUOTE}}}Insulin (NPH) Isophane%{{{SINGLE-QUOTE}}})
and OrderStatusLevelNum >= 15
and OrderStatusLevelNum not in (69, 70) "};
if exists InsulinProtocolOrder
then
msg := "{{+B}}This patient has interim orders entered to manage their diabetes until a full reconciliation can be completed. " || CRLF || CRLF
|| "{{+R}}The admitting interim insulin orders may vary significantly from their home regimen.{{-R}}" || CRLF || CRLF
|| "Please review all diabetic management orders to ensure the patient is receiving the regimen necessary to control their diabetes.";
else
display_msg := FALSE;
endif;
else
display_msg := FALSE;
endif;
;;
evoke:
ORM_Admission;
;;
logic:
conclude TRUE;
;;
action:
if display_msg = True then
write msg at ORM_alert;
endif;
;;
end: