Initial Checking with all 820 MLMs
This commit is contained in:
427
MLMStripper/bin/Debug/FORM/FORM_SET_HEPARIN_ACS_ORDERS.mlm
Normal file
427
MLMStripper/bin/Debug/FORM/FORM_SET_HEPARIN_ACS_ORDERS.mlm
Normal file
@@ -0,0 +1,427 @@
|
||||
maintenance:
|
||||
|
||||
title: Set Heparin NurseOrders;;
|
||||
mlmname: FORM_Set_Heparin_ACS_Orders;;
|
||||
arden: version 2;;
|
||||
version: 4.50;;
|
||||
institution: St Clair Admissions;;
|
||||
author: Robert Spence, Eclipsys Corp Ext 7461;;
|
||||
specialist: Teresa Spicuzza, Eclipsys Corp ext 7448;;
|
||||
date: 2008-05-20;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose: Used for medication grids that holds heparin in ACS order set
|
||||
;;
|
||||
|
||||
explanation: This MLM is called from the ACS With heparin order set
|
||||
Change History
|
||||
09.27.2010 TMS Added routine for Hold session date handling
|
||||
07.20.2011 TMS Added handling for additional instruction in orderset
|
||||
04.26.2016 TMS Add call on form Close to Medication Order Management MLM CSR 33465
|
||||
|
||||
;;
|
||||
keywords: Called MLMs, ACS, ED
|
||||
;;
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
data:
|
||||
|
||||
// This MLM is passed three arguments, of types
|
||||
// communication_type, form_type and client info object respectively.
|
||||
|
||||
(this_communication, // Communication object
|
||||
this_form, // Form object
|
||||
client_info_obj //Arden ClientInfo object
|
||||
) := argument;
|
||||
|
||||
|
||||
/*******************Make Changes To Spelling And Flags In This Section*******************/
|
||||
|
||||
/* Set to true if a decision.log is needed.*/
|
||||
log_execution_info := FALSE;
|
||||
|
||||
// Use String parse
|
||||
str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}};
|
||||
|
||||
/***************************************************************************************/
|
||||
|
||||
// Initialize error message
|
||||
error_message:="";
|
||||
|
||||
// Assigns fields passed in the Form object to the Field object
|
||||
field_list:= this_form.fields;
|
||||
|
||||
//-----------BEGIN COPY SECTION-------------------added By shivprasad
|
||||
DisplayNewScheduled := first of (field_list.Value
|
||||
where field_list.DataItemName = "LAB_CB_Alternate Priorities");
|
||||
|
||||
if (DisplayNewScheduled) then
|
||||
Call_UserFriendly_Lab_Priorities := mlm {{{SINGLE-QUOTE}}}SCH_LAB_PRIORITY_OPTIONS_CALLED{{{SINGLE-QUOTE}}};
|
||||
(this_communication,this_form) := call Call_UserFriendly_Lab_Priorities with (this_communication,this_form,client_info_obj);
|
||||
endif;
|
||||
//-----------END COPY SECTION-------------------
|
||||
|
||||
|
||||
client_guid := this_communication.ClientGUID;
|
||||
visit_guid := this_communication.ClientVisitGUID;
|
||||
chart_guid := this_communication.ChartGuid;
|
||||
|
||||
CallingEvent := this_communication.CallingEvent;
|
||||
CallingField := this_communication.CallingFieldName;
|
||||
|
||||
|
||||
|
||||
comb_ht_wt_fld := first of (field_list
|
||||
where field_list.DataItemName = "CombinedMeasurements");
|
||||
|
||||
|
||||
Labs_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox"
|
||||
and field_List.Control_MultiFieldOccNum = 1);
|
||||
Labs_List := Labs_fld.Value;
|
||||
|
||||
//Find the three checkboxes that may need to be ordered with this protocol
|
||||
Found_CBC:= first of (Labs_list where Labs_list.Name = "CBC (Includes Diff)");
|
||||
Found_INR:= first of (Labs_list where Labs_list.Name = "Prothrombin/INR");
|
||||
Found_APTT:= first of (Labs_list where Labs_list.Name = "APTT");
|
||||
|
||||
|
||||
/*
|
||||
// Peform logic based on the value of the New Order Diabetes
|
||||
If NOD_Selected = True then
|
||||
Found_DietConOrder.IsSelected := True;
|
||||
Found_DietConOrder.IsReadOnly := True;
|
||||
*/
|
||||
|
||||
CheckAPTT:=False;
|
||||
CheckCBC:=False;
|
||||
CheckINR:=False;
|
||||
|
||||
Mlt_Order_Line:= first of (field_list where field_list.DataItemName = "MultiOrderInline"
|
||||
and field_List.Control_MultiFieldOccNum = 1);
|
||||
Mlt_List := Mlt_Order_Line.Value;
|
||||
|
||||
Meds_fld7 := last of (field_list where field_list.DataItemName = "MultiOrderGrid"
|
||||
and field_List.Control_MultiFieldOccNum = 7);
|
||||
Meds_list7 :=Meds_fld7.Value;
|
||||
|
||||
|
||||
Meds_fld8 := last of (field_list where field_list.DataItemName = "MultiOrderGrid"
|
||||
and field_List.Control_MultiFieldOccNum = 8);
|
||||
Meds_list8 :=Meds_fld8.Value;
|
||||
|
||||
/////////////////////////
|
||||
Lab_Daily := last of (field_list where field_list.DataItemName = "MultiOrderGrid"
|
||||
and field_List.Control_MultiFieldOccNum = 9);
|
||||
Lab_Daily_List := Lab_Daily.Value;
|
||||
|
||||
Fnd_APTT := first of (Lab_Daily_List where Lab_Daily_List.Name = "APTT");
|
||||
|
||||
primreqdate:= last of (field_list where field_list.DataItemName = "RequestedDate"
|
||||
and field_List.Control_MultiFieldOccNum = 1);
|
||||
|
||||
secreqdate:= last of (field_list where field_list.DataItemName = "RequestedDate"
|
||||
and field_List.Control_MultiFieldOccNum = 2);
|
||||
thirdreqdate:= last of (field_list where field_list.DataItemName = "RequestedDate"
|
||||
and field_List.Control_MultiFieldOccNum = 3);
|
||||
fourthreqdate:= last of (field_list where field_list.DataItemName = "RequestedDate"
|
||||
and field_List.Control_MultiFieldOccNum = 4);
|
||||
fifthreqdate:= last of (field_list where field_list.DataItemName = "RequestedDate"
|
||||
and field_List.Control_MultiFieldOccNum = 5);
|
||||
|
||||
ED_Loc:= last of (field_list where field_list.DataItemName = "ED Location");
|
||||
|
||||
//////////////
|
||||
Lab_Rem := last of (field_list where field_list.DataItemName = "MultiOrderGrid"
|
||||
and field_List.Control_MultiFieldOccNum = 10);
|
||||
|
||||
Lab_Rem_List := Lab_Rem.Value;
|
||||
|
||||
Fnd_Daily := first of (Lab_Rem_List where Lab_Rem_List.Name = "Daily Orders:");
|
||||
|
||||
|
||||
///////////////////////
|
||||
|
||||
|
||||
prx_comment := last of (field_list where field_list.DataItemName = "PRX_NOTECOMMENT0");
|
||||
////////////
|
||||
Order_From := last of (field_list where field_list.DataItemName = "NUR_DateField");
|
||||
Order_To := last of (field_list where field_list.DataItemName = "NUR_ToDate");
|
||||
|
||||
|
||||
|
||||
|
||||
If CallingEvent = "FormOpen" then
|
||||
Mlt_List.IsReadOnly := (True,True,True,True,True,True,True,True);
|
||||
// Mlt_List.IsSelected := (True,True,True,True,True,True,True,True);
|
||||
|
||||
// Hold Session - Date handling. Instead of date (T is found) or(T+(#) is found)
|
||||
PlusLocation := FIND "+" IN STRING primreqdate.value;
|
||||
TLocation := FIND "T" IN STRING primreqdate.value;
|
||||
If TLocation = 1 and PlusLocation = 0 then primreqdate.value := (now as time); endif;
|
||||
If PlusLocation > 0 then
|
||||
PlusDays := SUBSTRING 1 CHARACTERS STARTING AT LENGTH OF primreqdate.value FROM primreqdate.value ;
|
||||
primreqdate.value := (now as time) +(PlusDays as number) day;
|
||||
endif;
|
||||
|
||||
startdate:= primreqdate.value;
|
||||
Order_From.value := primreqdate.value;
|
||||
secreqdate.value := startdate + 2 days;
|
||||
thirdreqdate.value := startdate + 4 days;
|
||||
fourthreqdate.value := startdate + 6 days;
|
||||
fifthreqdate.value := startdate + 8 days;
|
||||
Order_To.value := fifthreqdate.value;
|
||||
|
||||
prx_comment.value:= primreqdate.value || "," || secreqdate.value || "," || thirdreqdate.value || "," ||
|
||||
fourthreqdate.value || "," || fifthreqdate.value;
|
||||
|
||||
|
||||
Lab_Daily_List.IsReadOnly:= (False,True,True,True,True,True);
|
||||
|
||||
Fnd_Daily.IsReadOnly := True;
|
||||
|
||||
|
||||
elseif CallingEvent = "FieldChange" then
|
||||
If (CallingField = "MultiOrderGrid|7") or (CallingField= "MultiOrderGrid|8") then
|
||||
|
||||
If (first(Meds_list7.IsSelected) = True) or (first(Meds_list8.IsSelected) = True) then
|
||||
|
||||
Lab_Daily_List.IsSelected := (Fnd_APTT.IsSelected,True,True,True,True,True);
|
||||
Fnd_Daily.IsSelected := True;
|
||||
Mlt_List.IsSelected := (True,True,True,True,True,True,True,True);
|
||||
|
||||
else
|
||||
|
||||
|
||||
Lab_Daily_List.IsSelected := (Fnd_APTT.IsSelected,False,False,False,False,False);
|
||||
Fnd_Daily.IsSelected := False;
|
||||
Mlt_List.IsSelected := (False,False,False,False,False,False,False,False);
|
||||
endif;
|
||||
|
||||
elseif callingfield = "RequestedDate|1" then
|
||||
|
||||
//Set the four remaining order set date fields based on the starting date
|
||||
|
||||
|
||||
yr := extract year now;
|
||||
mn := extract month now; if mn < 10 then mn := "0" || mn; endif;
|
||||
dd := extract day now; if dd < 10 then dd := "0" || dd; endif;
|
||||
today:= yr || "-" || mn || "-" || dd || "T00:00:00";
|
||||
|
||||
tomorrow := (today as time) +1 day;
|
||||
tom_list := call str_parse with tomorrow, " ";
|
||||
tom_dte := first(tom_list);
|
||||
lesstomorrow := primreqdate.value < tomorrow;
|
||||
|
||||
If lesstomorrow = true then
|
||||
|
||||
this_communication.DisplayForm := "Yes";
|
||||
this_communication.Message := "You may not enter a date earlier than tomorrow (" || tom_dte || ")"
|
||||
;
|
||||
this_communication.MessageType := "Error";
|
||||
|
||||
primreqdate.value := tomorrow;
|
||||
endif;
|
||||
|
||||
startdate:= primreqdate.value;
|
||||
Order_From.value := primreqdate.value;
|
||||
secreqdate.value := startdate + 2 days;
|
||||
thirdreqdate.value := startdate + 4 days;
|
||||
fourthreqdate.value := startdate + 6 days;
|
||||
fifthreqdate.value := startdate + 8 days;
|
||||
Order_To.value := fifthreqdate.value;
|
||||
|
||||
prx_comment.value:= primreqdate.value || "," || secreqdate.value || "," || thirdreqdate.value || "," ||
|
||||
fourthreqdate.value || "," || fifthreqdate.value;
|
||||
|
||||
endif; // fieldchange calling field
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
elseif CallingEvent = "FormClose" then
|
||||
If (first(Meds_list7.IsSelected) = True) or (first(Meds_list8.IsSelected) = True) then
|
||||
|
||||
comb_ht_wt_val := comb_ht_wt_fld.Value;
|
||||
|
||||
wt := comb_ht_wt_val.weight;
|
||||
|
||||
|
||||
if (wt is null) then
|
||||
|
||||
|
||||
this_communication.DisplayForm := "Yes";
|
||||
this_communication.Message := "To Complete The Heparin Protocol:\n\n Please Enter A Weight For This Patient";
|
||||
this_communication.MessageType := "Error";
|
||||
else
|
||||
|
||||
If (Found_CBC.IsSelected =false) or (Found_INR.IsSelected = false) or (Found_APTT.IsSelected= false) then
|
||||
|
||||
If Found_CBC.ISSelected = False then
|
||||
|
||||
CBC_Val := read last
|
||||
{"Select top 1 o.Name"
|
||||
|| " From cv3order as o with (nolock) "
|
||||
|| " join cv3ordercatalogmasteritem as ocmi with (nolock) "
|
||||
|| " on ocmi.guid = o.ordercatalogmasteritemguid "
|
||||
|| " and ocmi.active = 1 "
|
||||
|| " and ocmi.name in ({{{SINGLE-QUOTE}}}CBC (Includes Diff){{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}CBC No Diff (Hemogram Only){{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}CBC with Manual Diff{{{SINGLE-QUOTE}}}) "
|
||||
|| " where o.clientguid = " || SQL(client_guid)
|
||||
|| " and o.chartguid = " || SQL(chart_guid)
|
||||
|| " and o.requesteddtm >= (DATEADD(hour, -24, getdate())) "
|
||||
|| " and o.requesteddtm <= getdate() "
|
||||
|| " and o.OrderStatusLevelNum > 15 "
|
||||
|| " and o.OrderStatusLevelNum not in (69, 70) "
|
||||
|| " order by o.requesteddtm desc "
|
||||
};
|
||||
|
||||
If exists CBC_Val then
|
||||
CheckCBC:=False;
|
||||
else
|
||||
CheckCBC:=True;
|
||||
Found_CBC.ISSelected :=True;
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
// Now for INR
|
||||
|
||||
If Found_INR.ISSelected = False then
|
||||
|
||||
INR_Val := read last
|
||||
{"Select top 1 o.Name"
|
||||
|| " From cv3order as o with (nolock) "
|
||||
|| " join cv3ordercatalogmasteritem as ocmi with (nolock) "
|
||||
|| " on ocmi.guid = o.ordercatalogmasteritemguid "
|
||||
|| " and ocmi.active = 1 "
|
||||
|| " and ocmi.name in ({{{SINGLE-QUOTE}}}Prothrombin/INR{{{SINGLE-QUOTE}}}) "
|
||||
|| " where o.clientguid = " || SQL(client_guid)
|
||||
|| " and o.chartguid = " || SQL(chart_guid)
|
||||
|| " and o.requesteddtm >= (DATEADD(hour, -24, getdate())) "
|
||||
|| " and o.requesteddtm <= getdate() "
|
||||
|| " and o.OrderStatusLevelNum > 15 "
|
||||
|| " and o.OrderStatusLevelNum not in (69, 70) "
|
||||
|| " order by o.requesteddtm desc "
|
||||
};
|
||||
|
||||
If exists INR_Val then
|
||||
CheckINR:=False;
|
||||
else
|
||||
Found_INR.ISSelected :=True;
|
||||
CheckINR:=True;
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
// Now for APTT
|
||||
|
||||
If Found_APTT.ISSelected = False then
|
||||
|
||||
APTT_Val := read last
|
||||
{"Select top 1 o.Name"
|
||||
|| " From cv3order as o with (nolock) "
|
||||
|| " join cv3ordercatalogmasteritem as ocmi with (nolock) "
|
||||
|| " on ocmi.guid = o.ordercatalogmasteritemguid "
|
||||
|| " and ocmi.active = 1 "
|
||||
|| " and ocmi.name in ({{{SINGLE-QUOTE}}}APTT{{{SINGLE-QUOTE}}}) "
|
||||
|| " where o.clientguid = " || SQL(client_guid)
|
||||
|| " and o.chartguid = " || SQL(chart_guid)
|
||||
|| " and o.requesteddtm >= (DATEADD(hour, -24, getdate())) "
|
||||
|| " and o.requesteddtm <= getdate() "
|
||||
|| " and o.OrderStatusLevelNum > 15 "
|
||||
|| " and o.OrderStatusLevelNum not in (69, 70) "
|
||||
|| " order by o.requesteddtm desc "
|
||||
};
|
||||
|
||||
If exists APTT_Val then
|
||||
CheckAPTT:=False;
|
||||
else
|
||||
Found_APTT.ISSelected :=True;
|
||||
CheckAPTT:=True;
|
||||
endif;
|
||||
|
||||
endif; // found APTT
|
||||
|
||||
endif; // checkbox checked or not
|
||||
|
||||
// here for CBC Deselected
|
||||
|
||||
|
||||
//////////////////////
|
||||
// Now find if there are already CBC{{{SINGLE-QUOTE}}}s ordered in the future...
|
||||
// Reset the check boxes if they are.
|
||||
|
||||
formlist := call str_parse with prx_comment.value, ",";
|
||||
|
||||
end_date := fifthreqdate.value + 1 day;
|
||||
|
||||
CBC_daily_dates :=();
|
||||
CBC_daily_dates := read
|
||||
|
||||
{"Select distinct top 20 convert(char(6),o.requesteddtm,110) +convert(char(4), o.requesteddtm,20) + {{{SINGLE-QUOTE}}} 00:00:00{{{SINGLE-QUOTE}}}"
|
||||
|| " From cv3order as o with (nolock) "
|
||||
|| " join cv3ordercatalogmasteritem as ocmi with (nolock) "
|
||||
|| " on ocmi.guid = o.ordercatalogmasteritemguid "
|
||||
|| " and ocmi.active = 1 "
|
||||
|| " and ocmi.name in ({{{SINGLE-QUOTE}}}CBC (Includes Diff){{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}CBC No Diff (Hemogram Only){{{SINGLE-QUOTE}}},{{{SINGLE-QUOTE}}}CBC with Manual Diff{{{SINGLE-QUOTE}}}) "
|
||||
|| " where o.clientguid = " || SQL(client_guid)
|
||||
|| " and o.chartguid = " || SQL(chart_guid)
|
||||
|| " and o.requesteddtm >= " || SQL(primreqdate.value)
|
||||
|| " and o.requesteddtm < " || SQL(end_date)
|
||||
|| " and o.OrderStatusLevelNum > 15 "
|
||||
|| " and o.OrderStatusLevelNum not in (69, 70) "
|
||||
|| " and o.orderstatuscode <> {{{SINGLE-QUOTE}}}MASTR{{{SINGLE-QUOTE}}} "};
|
||||
|
||||
If exist(CBC_daily_dates) then
|
||||
Reset_CBC_Grid:= ();
|
||||
singledate := "";
|
||||
index_list := 1 seqto (count formlist) ;
|
||||
for J in index_list do
|
||||
|
||||
singledate := formlist[J];
|
||||
|
||||
Reset_CBC_Grid:= Reset_CBC_Grid, singledate not in CBC_daily_dates;
|
||||
|
||||
|
||||
enddo;
|
||||
|
||||
Lab_Daily_List.IsSelected := (Fnd_APTT.IsSelected,Reset_CBC_Grid);
|
||||
|
||||
|
||||
|
||||
|
||||
endif; //If exist
|
||||
|
||||
|
||||
endif; // wt is null
|
||||
endif; // either heparin checked
|
||||
|
||||
Med_Order_Mgt := mlm {{{SINGLE-QUOTE}}}FORM_SET_Rx_Medication_Order_Mgt{{{SINGLE-QUOTE}}};
|
||||
(this_communication, this_form) := call Med_Order_Mgt with this_communication, this_form, client_info_obj;
|
||||
|
||||
endif; // calling event
|
||||
|
||||
|
||||
/* this_communication.DisplayForm := "Yes";
|
||||
this_communication.Message := "Creating CBC :" || CheckCBC || "\n" ||
|
||||
"Creating INR :" || CheckINR || "\n" ||
|
||||
"Creating APTT:" || CheckAPTT ;
|
||||
this_communication.MessageType := "Informational";
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
;;
|
||||
evoke: // No evoke statement
|
||||
;;
|
||||
logic:
|
||||
|
||||
conclude true;
|
||||
;;
|
||||
action:
|
||||
// This MLM returns two parameters, of types communication_type and form_type respectively.
|
||||
return this_communication, this_form;
|
||||
;;
|
||||
end:
|
||||
Reference in New Issue
Block a user