Initial Checking with all 820 MLMs
This commit is contained in:
355
MLMStripper/bin/Debug/FORM/FORM_HALOPERIDOL_IV_ORDERS.mlm
Normal file
355
MLMStripper/bin/Debug/FORM/FORM_HALOPERIDOL_IV_ORDERS.mlm
Normal file
@@ -0,0 +1,355 @@
|
||||
maintenance:
|
||||
|
||||
|
||||
|
||||
maintenance:
|
||||
title: Haloperidol IV Order on Monitored Bed Check;;
|
||||
mlmname: Form_Haloperidol_IV_Orders;;
|
||||
arden: version 2;;
|
||||
version: 5.50;;
|
||||
institution: St. Clair Hospital;;
|
||||
author: Teresa M. Spicuzza ;;
|
||||
specialist: Eclipsys Corporation;;
|
||||
date: 2012-05-23;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose: Prohibit ordering of Haldol by IV Push or IVPB on a non-nmonitored unit unless being ordered for end of life care.
|
||||
.
|
||||
;;
|
||||
explanation: This MLM will hard stop user from entering an order for Haldol by IV push or IVPB if patient is not on a monitored unit and not ordered for end of life care..
|
||||
|
||||
Change history
|
||||
|
||||
05.23.2012 TS Created CSR 30783 To Production on 9/25/2012
|
||||
03.13.2015 TS Modified for new delirium protocol to enable ordering of IV
|
||||
Haldol if dose is less than 2mg. CSR 33144
|
||||
03.18.2015 TS Modified alert messages to note "doses greater than 2 mg" CSR 33144
|
||||
04.24.2015 TS Modified to inlcude monitoring admin message for IV administration of Haldol CSR 33144
|
||||
05.07.2015 TS Modified to write monitoring admin message for IV administration of Haldol to a new
|
||||
data item to eliminate removing user typed instructions. Ticket 1730634
|
||||
11.27.2018 TS CSR 37432 Modified for Post Anesthesia Orders - if haldol IV greater than 2mg
|
||||
is ordered alert user that the patient will need a monitored bed for 24 hours
|
||||
and create an order for Cardiac Monitor to be added to worksheet.
|
||||
;;
|
||||
keywords:
|
||||
Haldol, Haloperidol, IV Push;
|
||||
;;
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
data:
|
||||
|
||||
// This MLM is passed three arguments, of types
|
||||
// communication_type, form_type and client info object respectively.
|
||||
|
||||
standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
||||
include standard_libs;
|
||||
|
||||
using "ObjectsPlusXA.SCM.Forms";
|
||||
using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
|
||||
|
||||
(this_communication, // Communication object
|
||||
this_form, // Form object
|
||||
client_info_obj // Arden ClientInfo object
|
||||
) := argument;
|
||||
|
||||
CallingEvent := this_communication.CallingEvent;
|
||||
CallingField :=this_communication.CallingFieldName;
|
||||
ClientGuid := this_communication.ClientGUID;
|
||||
ClientVisitGuid := this_communication.ClientVisitGUID;
|
||||
ChartGuid := this_communication.ChartGuid;
|
||||
Primary_object := this_communication.PrimaryObj;
|
||||
OrderSetName := Primary_Object.OrderSetName;
|
||||
|
||||
|
||||
// Assigns fields passed in the Form object to the Field object
|
||||
field_list:= this_form.fields;
|
||||
|
||||
// Define fields for MLM use
|
||||
|
||||
CR := 13 formatted with "%c";
|
||||
LF := 10 formatted with "%c";
|
||||
CRLF:= CR||LF;
|
||||
HaldolOrder := last of (field_list where field_list.DataItemName = "PRX_Generic_CB");
|
||||
HaldolOrder_value := HaldolOrder.value;
|
||||
OrderRoute := last of (field_list where field_list.DataItemName = "OrderRouteCode");
|
||||
OrderRoute_value := OrderRoute.value;
|
||||
Dose := last of (field_list where field_list.DataItemName = "DosageLow");
|
||||
Dose_value := Dose.value;
|
||||
Indication := last of (field_list where field_list.DataItemName = "NUR_Nonchemical Restraint Ind");
|
||||
Indication_value := Indication.value;
|
||||
AdminInst := last of (field_list where field_list.DataItemName = "PRX_NOTECOMMENT0");
|
||||
CardMonInst := last of (field_list where field_list.DataItemName = "PRX_CardiacMonitorInst");
|
||||
ReasonMessage := "";
|
||||
CardMonMsg := "Follow Cardiac Monitoring Requirements for IV Haloperidol";
|
||||
MonitoringMsg := "Cardiac Monitoring requirements for IV Haloperidol" || CRLF ||
|
||||
"1. If Baseline QTc < 450 msec and the cumulative dose is < or = 2mg/24 hours then cardiac monitoring is NOT required." || CRLF ||
|
||||
"2. If Baseline QTc < 450 msec and the cumulative dose exceeds 2 mg/24 hours then cardiac monitoring IS required." || CRLF ||
|
||||
"3. If Baseline QTc is 450-499 msec then cardiac monitoring IS required." || CRLF ||
|
||||
"4. If Baseline QTc is > = 500 msec then IV haloperidol should NOT be used." ;
|
||||
NoMsg := "";
|
||||
CreateMonitorOrder := MLM {{{SINGLE-QUOTE}}}SCH_FUNC_CREATE_GENERAL_ORDER_ON_WORKSHEET{{{SINGLE-QUOTE}}};
|
||||
|
||||
|
||||
If OrderSetName matches pattern "Anesthesia Post Op Orders%" then
|
||||
// Get Current worksheet info ***** START *****
|
||||
// Get the currently logged on user
|
||||
Active_ClientVisitGUID := this_communication.ClientVisitGUID;
|
||||
Active_OrderGUID:= PrimaryObjdetail.GUID;
|
||||
Active_SignificiantDtm:= Now;
|
||||
location_guid := read last {"select CurrentLocationGUID from CV3ClientVisit where GUID=" || SQL(Active_ClientVisitGUID)};
|
||||
|
||||
//TRY
|
||||
try
|
||||
//-----------------------------------------------------------
|
||||
// Retrieve current order entry batch.
|
||||
// The companion order can be added only if the parent order
|
||||
// belongs to the order entry batch
|
||||
// object owned by the OrderEntryWorksheet.
|
||||
//-----------------------------------------------------------
|
||||
worksheetInfo := call {{{SINGLE-QUOTE}}}OrderEntryBatch{{{SINGLE-QUOTE}}}.GetCurrent;
|
||||
|
||||
if worksheetInfo is NULL
|
||||
OR "OrderEntryWorksheet" <> (worksheetInfo.OrderBatchOwner as String) then
|
||||
z:=0;
|
||||
endif;
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Get the .NET version of the Client Visit object.
|
||||
// Needed to create new ObjectsPlus object
|
||||
//------------------------------------------------------------
|
||||
client_visit_obj := call {{{SINGLE-QUOTE}}}ClientVisit{{{SINGLE-QUOTE}}}.FindByPrimaryKey
|
||||
with ((Active_ClientVisitGUID as number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}}) ;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Check the order entry worksheet. If there are no entries
|
||||
// already on the worksheet set the initial values for
|
||||
// the worksheet.
|
||||
//-----------------------------------------------------------
|
||||
if worksheetInfo.UnsubmittedOrdersCount = 0 then
|
||||
|
||||
// If there are no orders on the worksheet set
|
||||
// defaults that will be used to create the orders
|
||||
WSSessionType := "Standard";
|
||||
WSSessionReason := "Orders created by MLM";
|
||||
WSRequestedBySource := "";
|
||||
|
||||
// Set the session type and reason on the worksheet
|
||||
void := call worksheetInfo.SetSessionType with (WSSessionType, WSSessionReason);
|
||||
|
||||
// Set the requesting source string
|
||||
worksheetInfo.RequestedBySource := WSRequestedBySource;
|
||||
|
||||
//Get the current user as the default care provider
|
||||
WSRequestedBy_obj := call {{{SINGLE-QUOTE}}}CareProvider{{{SINGLE-QUOTE}}}.FindById
|
||||
with ( user_IDType, user_IDCode );
|
||||
|
||||
//Set the requesting provider
|
||||
worksheetInfo.RequestedBy := WSRequestedBy_obj;
|
||||
|
||||
// Get the location that will be used for the orders.
|
||||
WSlocation_obj := call {{{SINGLE-QUOTE}}}Location{{{SINGLE-QUOTE}}}.FindByPrimaryKey
|
||||
with ((location_guid as number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}});
|
||||
|
||||
//Set the expected release location group
|
||||
worksheetInfo.ExpectedReleaseLocationGroup := WSlocation_obj;
|
||||
|
||||
//Dispose RequestedBy CareProvider
|
||||
if( WSRequestedBy_obj is NOT NULL ) then
|
||||
void := call WSRequestedBy_obj.Dispose;
|
||||
WSRequestedBy_obj:= null;
|
||||
endif;
|
||||
|
||||
//Dispose ExpectedReleaseLocationGroup
|
||||
if( WSlocation_obj is NOT NULL ) then
|
||||
void := call WSlocation_obj.Dispose;
|
||||
WSlocation_obj:= null;
|
||||
endif;
|
||||
|
||||
else
|
||||
//If there are orders on the worksheet retrieve the default values
|
||||
// on the worksheet.
|
||||
// These values are not required for this sample MLM however they
|
||||
// contain useful information that can be used in the logic of an
|
||||
// MLM.
|
||||
WSSessionType := worksheetInfo.SessionType;
|
||||
WSSessionReason := worksheetInfo.SessionReason;
|
||||
WSRequestedBySource := worksheetInfo.RequestedBySource;
|
||||
WSRequestedBy_obj := worksheetInfo.RequestedBy;
|
||||
WSlocation_obj := worksheetInfo.ExpectedReleaseLocationGroup;
|
||||
endif;
|
||||
|
||||
endtry;
|
||||
|
||||
catch Exception ex
|
||||
|
||||
error_occurred := true;
|
||||
error_message := "{{+R}}Common Data:{{-R}}\n" ||
|
||||
ex.Message || "\n\n";
|
||||
|
||||
if( worksheetInfo is NOT NULL ) then
|
||||
void := call worksheetInfo.Dispose;
|
||||
worksheetInfo:= null;
|
||||
endif;
|
||||
|
||||
if( client_visit_obj is NOT NULL ) then
|
||||
void := call client_visit_obj.Dispose;
|
||||
client_visit_obj:= null;
|
||||
endif;
|
||||
|
||||
if( WSRequestedBy_obj is NOT NULL ) then
|
||||
void := call WSRequestedBy_obj.Dispose;
|
||||
WSRequestedBy_obj:= null;
|
||||
endif;
|
||||
|
||||
if( WSlocation_obj is NOT NULL ) then
|
||||
void := call WSlocation_obj.Dispose;
|
||||
WSlocation_obj:= null;
|
||||
endif;
|
||||
|
||||
// If unable to initialize starting data, do not continue
|
||||
// with the creation of any orders.
|
||||
// Still conclude true as the error message needs to
|
||||
// be displayed as an error.
|
||||
//conclude true;
|
||||
endcatch;
|
||||
|
||||
Order_Creation_Reason := "Monitored Bed Required" ;
|
||||
order_type := "Other";
|
||||
Order_Catalog_Item := "Monitor: Cardiac";
|
||||
|
||||
endif;
|
||||
|
||||
If CallingEvent= "FieldChange" and CallingField = "DosageLow" and
|
||||
HaldolOrder_value = True and (OrderRoute_value = "IV Push" or OrderRoute_value = "IVPB") and
|
||||
OrderSetName matches pattern "Anesthesia Post Op Orders%" then
|
||||
If dose_value > 2 then
|
||||
dialogResult1 := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "\n Haloperidol doses > 2 mg require continuous ECG monitoring" ||
|
||||
"\n beyond the PACU, thus your patient will need to go to a " ||
|
||||
"\n monitored bed for 24 hours." ||
|
||||
" \n\n Do you wish to proceed with the haloperidol dose > 2 mg? ? ","Alert","YesNo" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
||||
if((dialogResult1 as string) = "Yes") then
|
||||
AdditionalInfo := "Haloperidol doses > 2 mg require continuous ECG monitoring " ||
|
||||
"beyond the PACU. Patient will need to go to a " ||
|
||||
"monitored bed for 24 hours." ;
|
||||
Obj_Error_occurred, Obj_error_message := Call CreateMonitorOrder with
|
||||
|
||||
|
||||
order_type,
|
||||
client_visit_obj, // ClientVisit ObjectsPlus object
|
||||
Order_catalog_item, // CatalogMasterItem ObjectsPlus object
|
||||
order_Creation_Reason, // string CreateReason
|
||||
worksheetInfo,
|
||||
AdditionalInfo,
|
||||
WSRequestedBy_obj, // RequestingProvider ObjectsPlus object
|
||||
WSRequestedBySource, // string requestingSource(must be in dict)
|
||||
WSSessionType, // string SessionType
|
||||
WSSessionReason, // string SessionReason
|
||||
WSLocation_obj;
|
||||
|
||||
else
|
||||
dose.value := "";
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
If HaldolOrder_value = True and (OrderRoute_value = "IV Push" or OrderRoute_value = "IVPB") and
|
||||
OrderSetName not in ("Anesthesia Post Op Orders", "Anesthesia Post Op Orders - Supplemental") then
|
||||
|
||||
If Indication_value <> "End of Life Agitation" then
|
||||
AdminInst.value := CardMonMsg;
|
||||
CardMonInst.value := MonitoringMsg;
|
||||
else
|
||||
AdminInst.value :=NoMsg;
|
||||
CardMonInst.value := NoMsg;
|
||||
endif;
|
||||
else;
|
||||
AdminInst.value :=NoMsg;
|
||||
CardMonInst.value := NoMsg;
|
||||
endif;
|
||||
|
||||
If HaldolOrder_value = True and (OrderRoute_value = "IV Push" or OrderRoute_value = "IVPB") and dose_value > 2 then
|
||||
|
||||
/*
|
||||
Monitored Bed Accomodation Codes:
|
||||
03 CCU
|
||||
06 SP/Monitored
|
||||
02 ICU
|
||||
14 CVSU
|
||||
04 IMC
|
||||
*/
|
||||
MonitoredBed := ("03 CCU","06 SP/Monitored","02 ICU","14 CVSU", "04 IMC");
|
||||
|
||||
|
||||
// Get patient current accomodation
|
||||
CurrentAccom := read last
|
||||
{"Select ac.Code "
|
||||
||" From CV3ClientVisitLocation cvl"
|
||||
||" Join SXAAMAccommodation ac on ac.AccommodationID = cvl.AccommodationID "
|
||||
||" Where ClientGuid = " || SQL(ClientGuid)
|
||||
||" and ClientVisitGuid = " || SQL(ClientVisitGuid)
|
||||
||" and cvl.Status = {{{SINGLE-QUOTE}}}CUR{{{SINGLE-QUOTE}}}" };
|
||||
|
||||
// Get patient current location
|
||||
CurrentLocation := read last
|
||||
{"Select CurrentLocation "
|
||||
||" From cv3Clientvisit "
|
||||
||" Where ClientGuid = " || SQL(ClientGuid)
|
||||
||" and Guid = " || SQL(ClientVisitGuid)
|
||||
||" and VisitStatus = {{{SINGLE-QUOTE}}}ADM{{{SINGLE-QUOTE}}}" };
|
||||
|
||||
If CurrentAccom in MonitoredBed or Indication_value = "End of Life Agitation" or CurrentLocation matches pattern "ER%" or dose_value <= 2 or OrderSetName matches pattern "Anesthesia Post Op Orders%" then
|
||||
continueorder := "true";
|
||||
|
||||
else
|
||||
reasonmessage := "Continuous ECG monitoring is required for Haloperidol greater than 2mg administered by IV Push, except for {{{SINGLE-QUOTE}}}End of Life{{{SINGLE-QUOTE}}} Care. You cannot proceed with this order.";
|
||||
alloworder := "no";
|
||||
continueorder := "false";
|
||||
endif;
|
||||
|
||||
|
||||
If continueorder = "true" and OrderRoute_value = "IV Push" then
|
||||
If dose_value <= 20 then
|
||||
If CurrentLocation matches pattern "ER-%" then
|
||||
alloworder := "warn";
|
||||
reasonmessage := "Continuous ECG monitoring is required for Haloperidol greater than 2mg administered by IV Push";
|
||||
else
|
||||
alloworder := "yes";
|
||||
endif;
|
||||
|
||||
else alloworder := "no";
|
||||
reasonmessage := "Doses of 20mg or greater should be diluted in 50 ml of D5W and given as an infusion. You cannot proceed with this order.";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
If alloworder = "no" then
|
||||
this_communication.DisplayForm := "yes";
|
||||
this_communication.Message := ReasonMessage;
|
||||
this_communication.MessageType := "Error";
|
||||
endif;
|
||||
|
||||
If alloworder = "warn" then
|
||||
this_communication.DisplayForm := "yes";
|
||||
this_communication.Message := ReasonMessage;
|
||||
this_communication.MessageType := "Informational";
|
||||
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:
|
||||
Reference in New Issue
Block a user