471 lines
18 KiB
Plaintext
471 lines
18 KiB
Plaintext
maintenance:
|
|
|
|
title: FORM_SET_HYPOGLYCEMIA;;
|
|
mlmname: FORM_SET_HYPOGLYCEMIA;;
|
|
arden: version 2.5;;
|
|
version: 5.50;;
|
|
institution: St Clair Hospital;;
|
|
author: Dean Miklavic;;
|
|
specialist: Don Warnick;;
|
|
date: 2016-04-27;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: Select orders from the Hypoglycemic Standing Order OS based upon the combiniation of selections in 3 drop down boxes
|
|
;;
|
|
|
|
explanation: This MLM is called from the Hypoglycemic Standing Order Set
|
|
|
|
|
|
Change history
|
|
|
|
04.27.2016 - DJW CSR# 34322 - Created
|
|
05.11.2017 - TMS CSR# 35673 - Adjust MLM to support adding of Glutose as a selectable option for scenario 1, 6, 2 and 9.
|
|
03.19.2018 - TMS CSR# 38042 - Modify MLM to support order set having two options for BGM 50 - 69 MG/DL and BGM 40 - 59 MG/DL.
|
|
Default selection to Dextrose 50% Inj, but allow user to change to D10W Infusion. Dextrose 50% Inj
|
|
was replaced by D10W during shortage of Dextrose. Both options are to remain onthe order set with only
|
|
one option selected for entry.
|
|
|
|
|
|
;;
|
|
keywords: Called MLMs,
|
|
;;
|
|
knowledge:
|
|
type: data-driven;;
|
|
data:
|
|
|
|
(this_communication, this_form, client_info_obj) := argument;
|
|
|
|
standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
|
include standard_libs;
|
|
|
|
using "ObjectsPlusXA.SCM.Forms";
|
|
using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
|
|
|
|
log_execution_info := FALSE;
|
|
error_message:="";
|
|
|
|
field_list:= this_form.fields;
|
|
|
|
client_guid := this_communication.ClientGUID;
|
|
visit_guid := this_communication.ClientVisitGUID;
|
|
chart_guid := this_communication.ChartGuid;
|
|
CallingEvent := this_communication.CallingEvent;
|
|
CallingField := this_communication.CallingFieldName;
|
|
|
|
BGM := first of (field_list where field_list.DataItemName = "NUR_Hypoglycemic_BGM");
|
|
Condition:= first of (field_list where field_list.DataItemName = "NUR_Hypoglycemic_Condition");
|
|
IVAccess := first of (field_list where field_list.DataItemName = "NUR_Hypoglycemic_IVAccess");
|
|
|
|
Preview := first of (field_list where field_list.DataItemName = "NUR_Hypoglycemic_Preview" and field_List.Control_MultiFieldOccNum = 1);
|
|
|
|
NurseInstructions5069Grid := first of (field_list where field_list.DataItemName = "MultiOrderInline" and field_List.Control_MultiFieldOccNum = 2);
|
|
NurseInstructions4049Grid := first of (field_list where field_list.DataItemName = "MultiOrderInline" and field_List.Control_MultiFieldOccNum = 3);
|
|
NurseInstructions0039Grid := first of (field_list where field_list.DataItemName = "MultiOrderInline" and field_List.Control_MultiFieldOccNum = 4);
|
|
|
|
IVGrid := first of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 50);
|
|
MedicationGrid := first of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 56);
|
|
OralMedicationGrid := first of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 62);
|
|
|
|
Instructions5069Grid := first of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 59);
|
|
Instructions4049Grid := first of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 60);
|
|
Instructions0039Grid := first of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 61);
|
|
|
|
|
|
// Determine the scenario
|
|
|
|
Scenario := "0";
|
|
|
|
if BGM.Value is not null and Condition.value is not null and IVAccess.value is not null
|
|
|
|
then // All fields are addressed
|
|
|
|
if BGM.Value = "50 - 69 MG/DL"
|
|
|
|
then // BGM 50-60
|
|
|
|
if Condition.value = "Patient is alert and eating"
|
|
|
|
then // Able to Swallow
|
|
|
|
If IVAccess.value = "Patient has IV Access"
|
|
then
|
|
Scenario := "1";
|
|
else
|
|
Scenario := "6";
|
|
endif;
|
|
|
|
else // Unable to Swallow
|
|
|
|
If IVAccess.value = "Patient has IV Access"
|
|
then
|
|
Scenario := "4";
|
|
else
|
|
Scenario := "5";
|
|
endif;
|
|
|
|
endif;
|
|
|
|
|
|
elseif BGM.Value = "40 - 49 MG/DL"
|
|
|
|
|
|
then // BGM 40 - 49
|
|
|
|
if Condition.value = "Patient is alert and eating"
|
|
|
|
then // Able to Swallow
|
|
|
|
If IVAccess.value = "Patient has IV Access"
|
|
then
|
|
Scenario := "2";
|
|
else
|
|
Scenario := "9";
|
|
endif;
|
|
|
|
else // Unable to Swallow
|
|
|
|
If IVAccess.value = "Patient has IV Access"
|
|
then
|
|
Scenario := "7";
|
|
else
|
|
Scenario := "8";
|
|
endif;
|
|
|
|
endif;
|
|
|
|
else // BGM.Value = "<40"
|
|
|
|
if Condition.value = "Patient is alert and eating"
|
|
|
|
then // Able to Swallow
|
|
|
|
If IVAccess.value = "Patient has IV Access"
|
|
then
|
|
Scenario := "3";
|
|
else
|
|
Scenario := "12";
|
|
endif;
|
|
|
|
else // Unable to Swallow
|
|
|
|
If IVAccess.value = "Patient has IV Access"
|
|
then
|
|
Scenario := "10";
|
|
else
|
|
Scenario := "11";
|
|
endif;
|
|
|
|
endif;
|
|
|
|
|
|
endif; // BGM Question
|
|
|
|
|
|
endif; // All fields are filled
|
|
|
|
|
|
|
|
// Select the appropriate orders for the scenario
|
|
|
|
|
|
|
|
If Scenario <> "0"
|
|
|
|
then
|
|
// All fields are addressed
|
|
If callingfield <> "MultiOrderGrid|56" then
|
|
|
|
// Initialize all order fields
|
|
NurseInstructions5069Grid.Value.IsSelected := False;
|
|
NurseInstructions5069Grid.Value.IsReadonly := True;
|
|
NurseInstructions4049Grid.Value.IsSelected := False;
|
|
NurseInstructions4049Grid.Value.IsReadonly := True;
|
|
NurseInstructions0039Grid.Value.IsSelected := False;
|
|
NurseInstructions0039Grid.Value.IsReadonly := True;
|
|
IVGrid.Value[1].IsSelected := False;
|
|
IVGrid.Value[1].IsReadonly := True;
|
|
|
|
index_list := 1 seqto (count MedicationGrid.Value);
|
|
for I in index_list do
|
|
MedicationGrid.Value[I].IsSelected := False;
|
|
MedicationGrid.value[I].IsReadonly := True;
|
|
enddo;
|
|
index_list := 1 seqto (count OralMedicationGrid.Value);
|
|
for I in index_list do
|
|
// OralMedicationGrid.Value[I].IsSelected := False;
|
|
OralMedicationGrid.value[I].IsReadonly := True;
|
|
enddo;
|
|
index_list := 1 seqto (count Instructions5069Grid.Value);
|
|
for I in index_list do
|
|
Instructions5069Grid.Value[I].IsSelected := False;
|
|
Instructions5069Grid.value[I].IsReadonly := True;
|
|
enddo;
|
|
index_list := 1 seqto (count Instructions4049Grid.Value);
|
|
for I in index_list do
|
|
Instructions4049Grid.Value[I].IsSelected := False;
|
|
Instructions4049Grid.Value[I].IsReadonly := True;
|
|
enddo;
|
|
index_list := 1 seqto (count Instructions0039Grid.Value);
|
|
for I in index_list do
|
|
Instructions0039Grid.Value[I].IsSelected := False;
|
|
Instructions0039Grid.Value[I].IsReadonly := True;
|
|
enddo;
|
|
endif;
|
|
|
|
// If user switches between D10W infusion and Dextrose 50% syringe mark other option as not selected and read only
|
|
|
|
If CallingEvent = "Fieldchange" and callingfield = "MultiOrderGrid|56" then
|
|
|
|
If (MedicationGrid.Value[2].IsSelected = True and MedicationGrid.Value[1].IsSelected = True and MedicationGrid.Value[1].IsReadOnly = True) then
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := True;
|
|
MedicationGrid.Value[1].IsReadOnly := False;
|
|
MedicationGrid.Value[2].IsReadOnly := True;
|
|
endif;
|
|
If (MedicationGrid.Value[2].IsSelected = True and MedicationGrid.Value[1].IsSelected = True and MedicationGrid.Value[2].IsReadOnly = True) then
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := True;
|
|
MedicationGrid.Value[2].IsReadOnly := False;
|
|
MedicationGrid.Value[1].IsReadOnly := True;
|
|
endif;
|
|
If (MedicationGrid.Value[5].IsSelected = True and MedicationGrid.Value[4].IsSelected = True and MedicationGrid.Value[4].IsReadOnly = True) then
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := True;
|
|
MedicationGrid.Value[4].IsReadOnly := False;
|
|
MedicationGrid.Value[5].IsReadOnly := True;
|
|
endif;
|
|
If (MedicationGrid.Value[5].IsSelected = True and MedicationGrid.Value[4].IsSelected = True and MedicationGrid.Value[5].IsReadOnly = True) then
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := True;
|
|
MedicationGrid.Value[5].IsReadOnly := False;
|
|
MedicationGrid.Value[4].IsReadOnly := True;
|
|
endif;
|
|
If (MedicationGrid.Value[8].IsSelected = True and MedicationGrid.Value[7].IsSelected = True and MedicationGrid.Value[7].IsReadOnly = True) then
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := True;
|
|
MedicationGrid.Value[7].IsReadOnly := False;
|
|
MedicationGrid.Value[8].IsReadOnly := True;
|
|
endif;
|
|
If (MedicationGrid.Value[8].IsSelected = True and MedicationGrid.Value[7].IsSelected = True and MedicationGrid.Value[8].IsReadOnly = True) then
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := True;
|
|
MedicationGrid.Value[8].IsReadOnly := False;
|
|
MedicationGrid.Value[7].IsReadOnly := True;
|
|
endif;
|
|
|
|
endif;
|
|
|
|
If (callingevent = "Fieldchange" and CallingField = "NUR_Hypoglycemic_Preview|1") or CallingEvent = "FormClose" then
|
|
// Populate new fields based upon the selected scenarios
|
|
|
|
if Scenario = "1"
|
|
then
|
|
NurseInstructions5069Grid.Value.IsSelected := True;
|
|
Instructions5069Grid.Value[1].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsReadOnly := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "2"
|
|
then
|
|
NurseInstructions4049Grid.Value.IsSelected := True;
|
|
Instructions4049Grid.Value[1].IsSelected := True;
|
|
OralMedicationGrid.Value[2].IsReadOnly := False;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "3"
|
|
then
|
|
NurseInstructions0039Grid.Value.IsSelected := True;
|
|
Instructions0039Grid.Value[1].IsSelected := True;
|
|
MedicationGrid.Value[7].IsSelected := True;
|
|
MedicationGrid.Value[8].IsReadOnly := False;
|
|
IVGrid.Value.IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "4"
|
|
then
|
|
NurseInstructions5069Grid.Value.IsSelected := True;
|
|
Instructions5069Grid.Value[2].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
If (MedicationGrid.Value[1].IsSelected = False and MedicationGrid.Value[2].IsSelected = False) then
|
|
MedicationGrid.Value[1].IsSelected := True;
|
|
MedicationGrid.Value[1].IsReadOnly := True;
|
|
MedicationGrid.Value[2].IsReadOnly := False;
|
|
endif;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
|
|
elseif Scenario = "5"
|
|
then
|
|
NurseInstructions5069Grid.Value.IsSelected := True;
|
|
Instructions5069Grid.Value[3].IsSelected := True;
|
|
MedicationGrid.Value[3].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "6"
|
|
then
|
|
NurseInstructions5069Grid.Value.IsSelected := True;
|
|
Instructions5069Grid.Value[1].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsReadOnly := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "7"
|
|
then
|
|
NurseInstructions4049Grid.Value.IsSelected := True;
|
|
Instructions4049Grid.Value[2].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
If (MedicationGrid.Value[4].IsSelected = False and MedicationGrid.Value[5].IsSelected = False) then
|
|
MedicationGrid.Value[4].IsSelected := True;
|
|
MedicationGrid.Value[4].IsReadOnly := True;
|
|
MedicationGrid.Value[5].IsReadOnly := False;
|
|
endif;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "8"
|
|
then
|
|
NurseInstructions4049Grid.Value.IsSelected := True;
|
|
Instructions4049Grid.Value[3].IsSelected := True;
|
|
MedicationGrid.Value[6].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "9"
|
|
then
|
|
NurseInstructions4049Grid.Value.IsSelected := True;
|
|
Instructions4049Grid.Value[1].IsSelected := True;
|
|
OralMedicationGrid.Value[2].IsReadOnly := False;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "10"
|
|
then
|
|
NurseInstructions0039Grid.Value.IsSelected := True;
|
|
Instructions0039Grid.Value[1].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
IVGrid.Value.IsSelected := True;
|
|
If (MedicationGrid.Value[7].IsSelected = False and MedicationGrid.Value[8].IsSelected = False) then
|
|
MedicationGrid.Value[7].IsSelected := True;
|
|
MedicationGrid.Value[7].IsReadOnly := True;
|
|
MedicationGrid.Value[8].IsReadOnly := False;
|
|
endif;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[9].IsSelected := False;
|
|
elseif Scenario = "11"
|
|
then
|
|
NurseInstructions0039Grid.Value.IsSelected := True;
|
|
Instructions0039Grid.Value[2].IsSelected := True;
|
|
MedicationGrid.Value[9].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
IVGrid.Value.IsSelected := True;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
elseif Scenario = "12"
|
|
then
|
|
NurseInstructions0039Grid.Value.IsSelected := True;
|
|
Instructions0039Grid.Value[2].IsSelected := True;
|
|
MedicationGrid.Value[9].IsSelected := True;
|
|
OralMedicationGrid.Value[1].IsSelected := False;
|
|
OralMedicationGrid.Value[2].IsSelected := False;
|
|
IVGrid.Value.IsSelected := True;
|
|
MedicationGrid.Value[1].IsSelected := False;
|
|
MedicationGrid.Value[2].IsSelected := False;
|
|
MedicationGrid.Value[3].IsSelected := False;
|
|
MedicationGrid.Value[4].IsSelected := False;
|
|
MedicationGrid.Value[5].IsSelected := False;
|
|
MedicationGrid.Value[6].IsSelected := False;
|
|
MedicationGrid.Value[7].IsSelected := False;
|
|
MedicationGrid.Value[8].IsSelected := False;
|
|
endif;
|
|
endif;
|
|
endif;
|
|
|
|
|
|
;;
|
|
evoke:
|
|
;;
|
|
logic:
|
|
conclude true;
|
|
;;
|
|
action:
|
|
return this_communication, this_form;
|
|
;;
|
|
end:
|