328 lines
13 KiB
Plaintext
328 lines
13 KiB
Plaintext
maintenance:
|
|
|
|
title: Adult Profile Admission Order Set;;
|
|
mlmname: FORM_Set_Adult_Profile_Admission;;
|
|
arden: version 2;;
|
|
version: 4.50;;
|
|
institution: St Clair Admissions;;
|
|
author: Robert Spence, Eclipsys Corp Ext 7461;;
|
|
specialist: Peggy Karish, Eclipsys Corp ext 7441;;
|
|
date: 2008-04-10;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: Used for grids that perform all true or no risk
|
|
|
|
;;
|
|
|
|
explanation: This MLM is called from the Patient Profile- Adult Admission Orders
|
|
|
|
Change history
|
|
|
|
10.29.2008 DW Adjust for Catheter selection changes
|
|
09.04.2009 DM Change "No Pediatric Smoking Risk" to "No Pharmacy Risk Criteria" for Grid 10
|
|
|
|
;;
|
|
keywords: Called MLMs, Respiratory ORder Set, Adult Admission
|
|
;;
|
|
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;
|
|
|
|
|
|
/***************************************************************************************/
|
|
|
|
// Initialize error message
|
|
error_message:="";
|
|
|
|
// Assigns fields passed in the Form object to the Field object
|
|
field_list:= this_form.fields;
|
|
CallingEvent := this_communication.CallingEvent;
|
|
CallingField := this_communication.CallingFieldName;
|
|
|
|
If CallingField = "MultiOrderCheckBox|1" then
|
|
NoRisk := "No Diagnosis Risk Criteria";
|
|
OccNumber := 1;
|
|
Elseif CallingField = "MultiOrderCheckBox|2" then
|
|
NoRisk := "No Discharge Risk Criteria";
|
|
OccNumber := 2;
|
|
Elseif CallingField = "MultiOrderCheckBox|3" then
|
|
NoRisk := "No Functional Risk Criteria";
|
|
OccNumber :=3;
|
|
Elseif CallingField = "MultiOrderCheckBox|4" then
|
|
NoRisk := "No Nutritional Risk Criteria";
|
|
OccNumber := 4;
|
|
Elseif CallingField = "MultiOrderCheckBox|7" then
|
|
NoRisk := "No Smoking Risk";
|
|
OccNumber := 7;
|
|
// Elseif CallingField = "MultiOrderCheckBox|9" then
|
|
// NoRisk := "No Pediatric Nutritional Risk";
|
|
// OccNumber := 9;
|
|
Elseif CallingField = "MultiOrderCheckBox|9" then
|
|
NoRisk := "No Devices Present";
|
|
OccNumber := 9;
|
|
Elseif CallingField = "MultiOrderCheckBox|10" then
|
|
NoRisk := "No Pharmacy Risk Criteria";
|
|
OccNumber := 10;
|
|
endif;
|
|
|
|
// Now do True and false logic for EVERY grid on this form
|
|
|
|
//Get the multi order grid check box value
|
|
Grid_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox"
|
|
and field_List.Control_MultiFieldOccNum = OccNumber);
|
|
Grid_list :=Grid_fld.Value;
|
|
Grid_SelList := Grid_List.IsSelected;
|
|
|
|
Found_NoRisk:= First of (Grid_list where Grid_list.Name = NoRisk );
|
|
|
|
ListMembs:= count Grid_SelList;
|
|
AllButNo:= ();
|
|
FalseList := ();
|
|
TrueList := ();
|
|
for k in (1 seqto (ListMembs-1)) do
|
|
AllButNo:= AllButNo, Grid_SelList[k];
|
|
FalseList := FalseList,False;
|
|
TrueList := TrueList ,True;
|
|
enddo;
|
|
|
|
OneOfRest := true in AllButNo;
|
|
|
|
If Found_NoRisk.IsSelected = True then
|
|
Grid_List.IsSelected:= FalseList , True;
|
|
Grid_List.IsReadOnly:= TrueList , False;
|
|
endif;
|
|
|
|
If (Found_NoRisk.IsSelected = False) and (OneOfRest = False) then // deselected No Risk
|
|
Grid_List.IsSelected := FalseList , False;
|
|
Grid_List.IsReadOnly := FalseList , False;
|
|
Endif;
|
|
|
|
If (OneOfRest = True) and (Found_NoRisk.IsSelected = False) then
|
|
Found_NoRisk.IsSelected := False;
|
|
Found_NoRisk.IsReadOnly := True;
|
|
endif;
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Now for the extras per grid //
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
If CallingField = "MultiOrderCheckBox|1" then
|
|
// Set the Order Set fields, comment and mapped to Dietitian Consult Reason
|
|
Set_Comment := last of (field_list where field_list.DataItemName = "NUR_ Comment 1 line");
|
|
Set_ConReason := last of (field_list where field_list.DataItemName = "NUTR_Consult Reasons");
|
|
|
|
If Found_NoRisk.IsSelected = True then
|
|
Set_Comment.Value := "";
|
|
Endif;
|
|
|
|
//Get the order set value
|
|
PrevCon_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox");
|
|
PrevCon_Value := PrevCon_Fld.Value;
|
|
|
|
Grid_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox"
|
|
and field_List.Control_MultiFieldOccNum = OccNumber);
|
|
Grid_list :=Grid_fld.Value;
|
|
Found_NODOrder:= first of (Grid_list where Grid_list.Name = "New Onset Diabetes");
|
|
NOD_Selected:= Found_NODOrder.IsSelected;
|
|
|
|
//If they are the same, this grid check box did not change, hence do nothing
|
|
If PrevCon_Value = NOD_Selected
|
|
then
|
|
Tester:="Dont Do anything";
|
|
else
|
|
// Set the fields we are about to change as the New Onset Diabeters Box Changed
|
|
// First get the entire field components for the MultiOrdercheckBox
|
|
Consult_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox"
|
|
and field_List.Control_MultiFieldOccNum = 5);
|
|
Consult_list :=Consult_fld.Value;
|
|
|
|
// Pull out the Dietitian Data from the MultiOrder
|
|
Found_DietConOrder:= first of (Consult_list where Consult_list.Name = "Dietitian Consult");
|
|
|
|
// Peform logic based on the value of the New Order Diabetes
|
|
If NOD_Selected = True then
|
|
Found_DietConOrder.IsSelected := True;
|
|
Found_DietConOrder.IsReadOnly := True;
|
|
Set_Comment.Value := "By selecting New Onset Diabetes- an order for a Dietitian Consult (New Onset Diabetes) has automatically been created";
|
|
Set_ConReason.Value := "New Onset Diabetes";
|
|
else
|
|
Found_DietConOrder.IsSelected := False;
|
|
Found_DietConOrder.IsReadOnly := False;
|
|
Set_Comment.Value := "By deselecting New Onset Diabetes- the order for Dietitian Consult (New Onset Diabetes) has automatically been removed";
|
|
Set_ConReason.Value := "";
|
|
endif;
|
|
|
|
// Set set from field to record the new value of New Order Diabetes (can tell if it changes again)
|
|
PrevCon_Fld.Value:= NOD_Selected;
|
|
endif;
|
|
|
|
ElseIf CallingField = "MultiOrderCheckBox|4" then
|
|
Labs_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox"
|
|
and field_List.Control_MultiFieldOccNum = 8);
|
|
Labs_list :=Labs_fld.Value;
|
|
Found_LabPreal:= first of (Labs_list where Labs_list.Name = "Prealbumin");
|
|
Found_LabDaily:= first of (Labs_list where Labs_list.Name = "Daily Orders:");
|
|
Nutrit_Comment := last of (field_list where field_list.DataItemName = "NUR_Comment 4");
|
|
|
|
|
|
Consult_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = 5);
|
|
Consult_list :=Consult_fld.Value;
|
|
|
|
|
|
If Found_NoRisk.IsSelected = True then
|
|
Nutrit_Comment.Value := "";
|
|
endif;
|
|
|
|
If (OneOfRest = True) then
|
|
Found_LabPreal.IsReadOnly := True;
|
|
Found_LabPreal.IsSelected := True;
|
|
Found_LabDaily.IsReadonly := True;
|
|
Found_LabDaily.IsSelected := True;
|
|
Nutrit_Comment.Value := "By selecting a Nutritional Risk, the Prealbumin labs have automatically been created";
|
|
endif;
|
|
|
|
If (OneOfRest = False) And (Found_LabPreal.IsReadOnly = True) And (Found_NoRisk.IsSelected = False) then
|
|
Found_LabPreal.IsReadOnly := False;
|
|
Found_LabPreal.IsSelected := False;
|
|
Found_LabDaily.IsReadonly := False;
|
|
Found_LabDaily.IsSelected := False;
|
|
Nutrit_Comment.Value := "By deselecting all Nutritional Risks, the Prealbumin labs have automatically been removed";
|
|
endif;
|
|
ElseIf CallingField = "MultiOrderCheckBox|7" then
|
|
SmokeCon_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox"
|
|
and field_List.Control_MultiFieldOccNum = 5);
|
|
SmokeCon_list :=SmokeCon_fld.Value;
|
|
Found_SmokeConOrder:= first of (SmokeCon_list where SmokeCon_list.Name = "Pulmonary Health Education Consult");
|
|
Smoke_Comment := last of (field_list where field_list.DataItemName = "NUR_Comment 3");
|
|
Smoke_ConReason := last of (field_list where field_list.DataItemName = "RESP Pulmonary Health Education");
|
|
|
|
PrevUseToB_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox 2");
|
|
PrevUseToB_Value := PrevUseToB_Fld.Value;
|
|
|
|
PrevLess12_Fld := last of (field_list where field_list.DataItemName = "NUR_CheckBox 3");
|
|
PrevLess12_Value:= PrevLess12_Fld.Value;
|
|
|
|
|
|
If Found_NoRisk.IsSelected = True then
|
|
Smoke_Comment.Value := "";
|
|
Smoke_ConReason := " ";
|
|
Smoke_ConReason := "";
|
|
endif;
|
|
|
|
Found_UTBOrder:= first of (Grid_list where Grid_list .Name = "Patient Uses Tobacco");
|
|
UTB_Selected:= Found_UTBOrder.IsSelected;
|
|
Found_Less12Order := first of (Grid_list where Grid_list .Name = "Quit tobacco use in the last 12 months");
|
|
Less12_Selected := Found_Less12Order.IsSelected;
|
|
|
|
If Less12_Selected = PrevLess12_Value then
|
|
Robert:="KEWL";
|
|
Else
|
|
If Less12_Selected = True then
|
|
Found_UTBOrder.IsReadOnly := True;
|
|
Found_SmokeConOrder.IsSelected := True;
|
|
Found_SmokeConOrder.IsReadOnly := True;
|
|
Smoke_Comment.Value := "By selecting Smoking Risk Order- an order for a Pulmonary Health Education Consult (Quit Smoking in Last 12 Months) has automatically been created";
|
|
Smoke_ConReason.Value := "Quit Smoking in Last 12 Months";
|
|
Else
|
|
Found_UTBOrder.IsReadOnly := False;
|
|
Found_SmokeConOrder.IsSelected := False;
|
|
Found_SmokeConOrder.IsReadOnly := False;
|
|
Smoke_Comment.Value := "By deselecting Smoking Risk Order- an order for a Pulmonary Health Education Consult (Quit Smoking in Last 12 Months) has automatically been removed";
|
|
Smoke_ConReason.Value := "";
|
|
Endif;
|
|
PrevLess12_Fld.Value:= Less12_Selected;
|
|
endif;
|
|
|
|
If UTB_Selected = PrevUseToB_Value then
|
|
Robert := "Still KEWL";
|
|
Else
|
|
If UTB_Selected = True then
|
|
Found_Less12Order.IsReadOnly := True;
|
|
Found_SmokeConOrder.IsSelected := True;
|
|
Found_SmokeConOrder.IsReadOnly := True;
|
|
Smoke_Comment.Value := "By selecting Smoking Risk Order- an order for a Pulmonary Health Education Consult (Smoking Cessation) has automatically been created";
|
|
Smoke_ConReason.Value := "Smoking Cessation";
|
|
Else
|
|
Found_Less12Order.IsReadonly := False;
|
|
Found_SmokeConOrder.IsSelected := False;
|
|
Found_SmokeConOrder.IsReadOnly := False;
|
|
Smoke_Comment.Value := "By deselecting Smoking Risk Order- an order for a Pulmonary Health Education Consult (Smoking Cessation) has automatically been removed";
|
|
Smoke_ConReason.Value := "";
|
|
Endif;
|
|
PrevUseToB_Fld.Value := UTB_Selected;
|
|
endif;
|
|
|
|
ElseIf CallingField = "MultiOrderCheckBox|9" then
|
|
Infection_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox" and field_List.Control_MultiFieldOccNum = 9);
|
|
Infection_list :=Infection_fld.Value;
|
|
Found_CentralLine:= first of (Infection_list where Infection_list.Name = "Catheter: Central Line");
|
|
Found_PICCLine:= first of (Infection_list where Infection_list.Name = "Catheter: PICC Line");
|
|
Found_PortLine:= first of (Infection_list where Infection_list.Name = "Catheter: Port");
|
|
InfusCons_fld := last of (field_list where field_list.DataItemName = "MultiOrderCheckBox"and field_List.Control_MultiFieldOccNum = 5);
|
|
InfusCons_list :=InfusCons_fld.Value;
|
|
Found_InfusConsOrder:= first of (InfusCons_list where InfusCons_list.Name = "Infusion Center Consult");
|
|
|
|
Inf_ConReason := last of (field_list where field_list.DataItemName = "INF_Consult Reason");
|
|
DevicesOnAdmission_Comment := last of (field_list where field_list.DataItemName = "NUR_Comment 6");
|
|
Catheter_Flag := last of (field_list where field_list.DataItemName = "NUR_Catheter");
|
|
|
|
If (Found_CentralLine.IsSelected = True) or (Found_PICCLine.IsSelected = True) or (Found_PortLine.IsSelected = True) and Catheter_Flag.value = False then
|
|
Found_InfusConsOrder.IsSelected := True;
|
|
Found_InfusConsOrder.IsReadOnly := True;
|
|
DevicesOnAdmission_Comment.Value := "By selecting a Port, Central Line or PICC Line, an Infusion Center Consult has been automatically been created";
|
|
Inf_ConReason.Value := "Device(s) present on admission, ED, OR";
|
|
Catheter_Flag.Value := True;
|
|
endif;
|
|
|
|
If (Found_CentralLine.IsSelected = False) and (Found_PICCLine.IsSelected = False) and (Found_PortLine.IsSelected = False) and Catheter_Flag.value = True then
|
|
Found_InfusConsOrder.IsSelected := False;
|
|
Found_InfusConsOrder.IsReadOnly := False;
|
|
DevicesOnAdmission_Comment.Value := "By deselecting a Port, Central Line or PICC Line, an Infusion Center Consult has been automatically been created ";
|
|
Inf_ConReason.Value := "";
|
|
Catheter_Flag.Value := False;
|
|
endif;
|
|
|
|
If Found_NoRisk.IsSelected = True then
|
|
DevicesOnAdmission_Comment.Value := " ";
|
|
Inf_ConReason := " ";
|
|
endif;
|
|
|
|
endif;
|
|
|
|
|
|
/* this_communication.DisplayForm := "Yes";
|
|
this_communication.Message := "One Of Rest Selection is " || OneOfRest|| "\n\n" ||
|
|
"NoRisk Select" || Found_NoRisk.IsSelected || "\n\n" ||
|
|
"NoRisk Value " || Found_NoRisk.Value;
|
|
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:
|