Initial Checking with all 820 MLMs
This commit is contained in:
412
MLMStripper/bin/Debug/FORM/FORM_RX_PCA_FIELD_EDITS.mlm
Normal file
412
MLMStripper/bin/Debug/FORM/FORM_RX_PCA_FIELD_EDITS.mlm
Normal file
@@ -0,0 +1,412 @@
|
||||
maintenance:
|
||||
|
||||
title: Ordering: PCA ordering ;;
|
||||
mlmname: FORM_Rx_PCA_Field_Edits;;
|
||||
arden: version 2;;
|
||||
version: 4.50;;
|
||||
institution: St Clair Isolation Set MLM;;
|
||||
author: Don Warnick, Eclipsys Corp;;
|
||||
specialist: ;;
|
||||
date: 2006-04-06;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose: Change the status of fields based upon the infusion selected
|
||||
|
||||
;;
|
||||
|
||||
explanation: This MLM is called from the PRX_ljPCA form. It ensures that the correct fields are populated and the correct
|
||||
frequency is attached to PCA orders based upon the method of delivery.
|
||||
|
||||
change history
|
||||
12.13.2007 DJW Added additional code for new "No Lockout" and "Standard Lockout" check boxes.
|
||||
02.15.2013 TMS Added logic to allow a "No Lockout" or "Other Lockout" to the hydromorphone 6mg/30ml concentration
|
||||
when ordered by or on behalf of Dr. Rivero for pain management orders. If Dr. Rivero is not the
|
||||
ordering care provider the user cannot see the checkboxes for no lockout or other lockout. CSR 31172
|
||||
12.03.2015 GOS CSR :33435 & 33436 - on selection other PCA Alone, Cont Insulation, Cont Infusion we display, Hide and Make Madatory PCA reason 1 and PCA Reason 2
|
||||
11.14.2018 TMS CSR 37423 Add logic to auto select Standard Lockout when switching between continuous and patient controlled. Physician no longer at St. Clair
|
||||
leaving logic in case new pain med doctors ever want to choose between other and no lockout.
|
||||
|
||||
|
||||
;;
|
||||
keywords: Called MLMs, Form fields, PCA
|
||||
;;
|
||||
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;
|
||||
/***************************************************************************************/
|
||||
comm_obj := this_communication.primaryobj;
|
||||
// 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;
|
||||
OrderingPhysician := this_communication.CareProviderDisplayName;
|
||||
|
||||
|
||||
pca := last of (field_list where field_list.DataItemName = "PRX_Pca" );
|
||||
pcacontinuous:= last of (field_list where field_list.DataItemName = "PRX_PcaContinuous" );
|
||||
pcaplus := last of (field_list where field_list.DataItemName = "PRX_PcaPlus" );
|
||||
stdlockout := last of (field_list where field_list.DataItemName = "PRX_SP08" );
|
||||
nolockout := last of (field_list where field_list.DataItemName = "PRX_SP09" );
|
||||
otherlockout := last of (field_list where field_list.DataItemName = "PRX_SP10" );
|
||||
stdlockoutval:= last of (field_list where field_list.DataItemName = "PRX_PcaLockoutStdValue" );
|
||||
rnadmdose := last of (field_list where field_list.DataItemName = "PRX_ZXO01" );
|
||||
rnadmunits := last of (field_list where field_list.DataItemName = "PRX_ZXO02" );
|
||||
maxdose := last of (field_list where field_list.DataItemName = "PRX_ZXO03" );
|
||||
unitsmg2 := last of (field_list where field_list.DataItemName = "PRX_ZXO04" );
|
||||
patadmindose := last of (field_list where field_list.DataItemName = "PRX_ZXO05" );
|
||||
unitsmg1 := last of (field_list where field_list.DataItemName = "PRX_ZXO06" );
|
||||
everyfreq := last of (field_list where field_list.DataItemName = "PRX_ZXO07" );
|
||||
unitsminutes := last of (field_list where field_list.DataItemName = "PRX_ZXO08" );
|
||||
continrate := last of (field_list where field_list.DataItemName = "PRX_ZXO09" );
|
||||
unitsmghr := last of (field_list where field_list.DataItemName = "PRX_ZXO10" );
|
||||
bolusprn := last of (field_list where field_list.DataItemName = "PRX_ZXO11" );
|
||||
bolusprnunits:= last of (field_list where field_list.DataItemName = "PRX_ZXO12" );
|
||||
bolusint := last of (field_list where field_list.DataItemName = "PRX_ZXO15" );
|
||||
bolusintunits:= last of (field_list where field_list.DataItemName = "PRX_ZXO16" );
|
||||
|
||||
frequency := last of (field_list where field_list.DataItemName = "FrequencyCode" );
|
||||
freq_Val := frequency.Value;
|
||||
prn := last of (field_list where field_list.DataItemName = "IsPRN" );
|
||||
perminfo := last of (field_list where field_list.DataItemName = "PRX_PermOrderInfo" );
|
||||
tempinfo := last of (field_list where field_list.DataItemName = "PRX_TempOrderInfo" );
|
||||
// Added By Shivprasad
|
||||
PCA_Reason1 := last of ( field_list WHERE field_list.DataItemName = "PRX_PCA Reason1" );
|
||||
PCA_Reason2 := last of ( field_list WHERE field_list.DataItemName = "PRX_PCA Reason2" );
|
||||
PCA_Condition := last of ( field_list WHERE field_list.DataItemName = "PRX_PRNCONDITION" ) ;
|
||||
|
||||
If CallingEvent = "FormOpen" and (this_communication.CareProviderDisplayName = "Spicuzza, Teresa" or
|
||||
this_communication.CareProviderDisplayName = "Rivero-Becerra, Jorge R") then
|
||||
painmgtorder := true;
|
||||
nolockout.control_read_only := False;
|
||||
nolockout.control_visible := True;
|
||||
otherlockout.control_read_only := False;
|
||||
otherlockout.control_visible := True;
|
||||
else
|
||||
painmgtorder := false;
|
||||
endif;
|
||||
|
||||
If CallingEvent = "FormOpen" and (this_communication.CareProviderDisplayName = "Spicuzzatest, Teresa" or
|
||||
this_communication.CareProviderDisplayName = "Rivero-Becerra, Jorge R") then
|
||||
painmgtorder := true;
|
||||
nolockout.control_read_only := False;
|
||||
nolockout.control_visible := True;
|
||||
otherlockout.control_read_only := False;
|
||||
otherlockout.control_visible := True;
|
||||
else
|
||||
painmgtorder := false;
|
||||
endif;
|
||||
|
||||
|
||||
// Start : Added By Shivprasad Jadhav for CSR #
|
||||
If comm_obj.Name ="Hydromorphone PCA (30mg/30ml)" Then
|
||||
pcaconcentrated := "True" ;
|
||||
Elseif comm_obj.Name ="Hydromorphone PCA (6mg/30ml)" Then
|
||||
pcaconcentrated := "False" ;
|
||||
stdlockout.Value := true ;
|
||||
Elseif comm_obj.Name ="Morphine PCA" Then
|
||||
pcaconcentrated := "False" ;
|
||||
Endif;
|
||||
|
||||
If CallingEvent="FormClose"
|
||||
then
|
||||
|
||||
tempinfo.value := "";
|
||||
|
||||
If (pca.value = False) and
|
||||
(pcacontinuous.value = False) and
|
||||
(pcaplus .value = False)
|
||||
then
|
||||
this_communication.DisplayForm := "Yes";
|
||||
this_communication.Message := "No PCA mode of delivery was selected" || "\n" || "\n" || "Please check at least one of the boxes";
|
||||
this_communication.MessageType := "Error";
|
||||
|
||||
elseif (stdlockout.value = False) and
|
||||
(nolockout.value = False) and
|
||||
(otherlockout .value = False) and
|
||||
(pcacontinuous.value = False)
|
||||
then
|
||||
this_communication.DisplayForm := "Yes";
|
||||
this_communication.Message := "No lockout value was selected" || "\n" || "\n" || "Please check at least one of the boxes";
|
||||
this_communication.MessageType := "Error";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
If (CallingField = "Prx_PCA" and pca.value = True) or (CallingEvent = "FormOpen" and pca.value = True)
|
||||
then
|
||||
pcacontinuous.value := False;
|
||||
pcaplus.value := False;
|
||||
patadmindose.control_mandatory := True;
|
||||
patadmindose.control_read_only := False;
|
||||
unitsmg1.value := "mg";
|
||||
unitsmg1.control_mandatory := True;
|
||||
unitsmg1.control_read_only := True;
|
||||
everyfreq.control_mandatory := True;
|
||||
everyfreq.control_read_only := False;
|
||||
unitsminutes.value := "minutes";
|
||||
unitsminutes.control_mandatory := True;
|
||||
unitsminutes.control_read_only := True;
|
||||
freq_Val.FrequencySummary := "As Ordered";
|
||||
frequency.Value := freq_Val;
|
||||
prn.value := True;
|
||||
prn.control_read_only := True;
|
||||
continrate.value := "";
|
||||
continrate.control_mandatory := False;
|
||||
continrate.control_read_only := True;
|
||||
unitsmghr.value := "";
|
||||
unitsmghr.control_mandatory := False;
|
||||
unitsmghr.control_read_only := True;
|
||||
|
||||
nolockout.control_read_only := False;
|
||||
stdlockout.control_read_only := False;
|
||||
otherlockout.control_read_only := False;
|
||||
|
||||
If pcaconcentrated = "True" Then
|
||||
PCA_Reason1.Control_Visible := False ;
|
||||
PCA_Reason2.Control_Visible := True ;
|
||||
PCA_Reason2.Control_Read_Only:=False ;
|
||||
PCA_Reason2.Control_Mandatory := True ;
|
||||
Elseif pcaconcentrated = "False" Then
|
||||
PCA_Reason1.Control_Visible := True ;
|
||||
PCA_Reason2.Control_Visible := False ;
|
||||
PCA_Reason1.Control_Read_Only:= True ;
|
||||
PCA_Reason1.Control_Mandatory := False ;
|
||||
Endif;
|
||||
|
||||
If stdlockout.Value = true then
|
||||
maxdose.value := stdlockoutval.value;
|
||||
unitsmg2.value := "mg";
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
elseif (CallingField = "Prx_PcaPlus" and pcaplus.value = True) or (CallingEvent = "FormOpen" and pcaplus.value = True)
|
||||
then
|
||||
pca.value := False;
|
||||
pcacontinuous.value := False;
|
||||
patadmindose.control_mandatory := True;
|
||||
patadmindose.control_read_only := False;
|
||||
unitsmg1.value := "mg";
|
||||
unitsmg1.control_mandatory := True;
|
||||
unitsmg1.control_read_only := True;
|
||||
everyfreq.control_mandatory := True;
|
||||
everyfreq.control_read_only := False;
|
||||
unitsminutes.value := "minutes";
|
||||
unitsminutes.control_mandatory := True;
|
||||
unitsminutes.control_read_only := True;
|
||||
freq_Val.FrequencySummary := "<Continuous>";
|
||||
frequency.Value := freq_Val;
|
||||
prn.value := False;
|
||||
prn.control_read_only := True;
|
||||
continrate.control_mandatory := True;
|
||||
continrate.control_read_only := False;
|
||||
unitsmghr.value := "mg/hr";
|
||||
|
||||
nolockout.control_read_only := False;
|
||||
stdlockout.control_read_only := False;
|
||||
otherlockout.control_read_only := False;
|
||||
|
||||
If pcaconcentrated = "True" Then
|
||||
PCA_Reason1.Control_Visible := False ;
|
||||
PCA_Reason2.Control_Visible := True ;
|
||||
PCA_Reason2.Control_Read_Only:=False ;
|
||||
PCA_Reason2.Control_Mandatory := True ;
|
||||
Elseif pcaconcentrated = "False" Then
|
||||
PCA_Reason1.Control_Visible := True ;
|
||||
PCA_Reason2.Control_Visible := False ;
|
||||
PCA_Reason1.Control_Read_Only:= False ;
|
||||
PCA_Reason1.Control_Mandatory := True ;
|
||||
Endif;
|
||||
|
||||
If stdlockout.value = true then
|
||||
maxdose.value := stdlockoutval.value;
|
||||
unitsmg2.value := "mg";
|
||||
endif;
|
||||
|
||||
|
||||
elseif (CallingField = "PRX_PcaContinuous" and pcacontinuous.value = True) or (CallingEvent = "FormOpen" and pcacontinuous.value = True)
|
||||
then
|
||||
pca.value := False;
|
||||
pcaplus.value := False;
|
||||
patadmindose.value := "";
|
||||
patadmindose.control_mandatory := False;
|
||||
patadmindose.control_read_only := True;
|
||||
unitsmg1.value := "";
|
||||
unitsmg1.control_mandatory := False;
|
||||
unitsmg1.control_read_only := True;
|
||||
everyfreq.value := "";
|
||||
everyfreq.control_mandatory := False;
|
||||
everyfreq.control_read_only := True;
|
||||
unitsminutes.value := "";
|
||||
unitsminutes.control_mandatory := False;
|
||||
unitsminutes.control_read_only := True;
|
||||
maxdose.value := "";
|
||||
maxdose.control_mandatory := False;
|
||||
maxdose.control_read_only := True;
|
||||
unitsmg2.value := "";
|
||||
unitsmg2.control_mandatory := False;
|
||||
unitsmg2.control_read_only := True;
|
||||
freq_Val.FrequencySummary := "<Continuous>";
|
||||
frequency.Value := freq_Val;
|
||||
prn.value := False;
|
||||
prn.control_read_only := True;
|
||||
continrate.control_mandatory := True;
|
||||
continrate.control_read_only := False;
|
||||
unitsmghr.value := "mg/hr";
|
||||
|
||||
nolockout.value := False;
|
||||
nolockout.control_read_only := True;
|
||||
stdlockout.value := False;
|
||||
stdlockout.control_read_only := True;
|
||||
otherlockout.value := False;
|
||||
otherlockout.control_read_only := True;
|
||||
|
||||
If pcaconcentrated = "True" Then
|
||||
PCA_Reason1.Control_Visible := False ;
|
||||
|
||||
PCA_Reason2.Control_Visible := True ;
|
||||
PCA_Reason2.Control_Read_Only:=False ;
|
||||
PCA_Reason2.Control_Mandatory := True ;
|
||||
Elseif pcaconcentrated = "False" Then
|
||||
PCA_Reason1.Control_Visible := True ;
|
||||
PCA_Reason2.Control_Visible := False ;
|
||||
PCA_Reason1.Control_Read_Only:= False ;
|
||||
PCA_Reason1.Control_Mandatory := True ;
|
||||
Endif;
|
||||
endif;
|
||||
|
||||
If (CallingField = "PRX_SP08" and stdlockout.value = True) or (CallingEvent = "FormOpen" and stdlockout.value = True)
|
||||
then
|
||||
maxdose.control_mandatory := False;
|
||||
maxdose.control_read_only := True;
|
||||
maxdose.value := stdlockoutval.value;
|
||||
unitsmg2.value := "mg";
|
||||
unitsmg2.control_mandatory := True;
|
||||
unitsmg2.control_read_only := True;
|
||||
nolockout.value := False;
|
||||
otherlockout.value := False;
|
||||
|
||||
|
||||
elseif (CallingField = "PRX_SP09" and nolockout.value = True) or (CallingEvent = "FormOpen" and nolockout.value = True)
|
||||
then
|
||||
maxdose.control_mandatory := False;
|
||||
maxdose.control_read_only := True;
|
||||
maxdose.value := " ";
|
||||
unitsmg2.value := " ";
|
||||
unitsmg2.control_mandatory := False;
|
||||
unitsmg2.control_read_only := True;
|
||||
stdlockout.value := False;
|
||||
otherlockout.value := False;
|
||||
|
||||
elseif (CallingField = "PRX_SP10" and otherlockout.value = True) or (CallingEvent = "FormOpen" and otherlockout.value = True)
|
||||
then
|
||||
maxdose.control_mandatory := True;
|
||||
maxdose.control_read_only := False;
|
||||
maxdose.value := " ";
|
||||
unitsmg2.value := "mg";
|
||||
unitsmg2.control_mandatory := False;
|
||||
unitsmg2.control_read_only := True;
|
||||
stdlockout.value := False;
|
||||
nolockout.value := False;
|
||||
|
||||
|
||||
endif;
|
||||
|
||||
If CallingField = "PRX_ZXO01" then
|
||||
If rnadmdose.value <> " " then rnadmunits.value := "mg";
|
||||
elseif rnadmdose.value is null then rnadmunits.value := " ";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
If CallingField = "PRX_ZXO11" then
|
||||
If bolusprn.value <> " " then bolusprnunits.value := "mg";
|
||||
elseif bolusprn.value is null then bolusprnunits.value := " ";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
|
||||
If CallingField = "PRX_ZXO15" then
|
||||
If bolusint.value <> " " then bolusintunits.value := "hours";
|
||||
elseif bolusint.value is null then bolusintunits.value := " ";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Added By Shivprasad Jadhav
|
||||
If (CallingField = "PRX_PCA Reason1" and PCA_Reason1.Value Is Not Null ) or (CallingEvent = "FormOpen" And PCA_Reason1.Value Is Not Null )
|
||||
or (CallingField = "PRX_PCA Reason2" and PCA_Reason2.Value Is Not Null ) or (CallingEvent = "FormOpen" And PCA_Reason2.Value Is Not Null )
|
||||
Then
|
||||
|
||||
If PCA_Reason1.Value Is Not Null Then
|
||||
If PCA_Reason1.Value ="Recommended by Pain Management Consultant" Then
|
||||
SelectionVal1 := "Pain Mgt Consult" ;
|
||||
Elseif PCA_Reason1.Value ="End of Life" Then
|
||||
SelectionVal1 := "End of Life" ;
|
||||
Elseif PCA_Reason1.Value ="Inadequate Pain Response to IV Narcotics over a 24 hour period" Then
|
||||
SelectionVal1 := "Inadequate pain response over 24hrs" ;
|
||||
Elseif PCA_Reason1.Value ="Chronic narcotic use prior to admission" Then
|
||||
SelectionVal1 := "Chronic narcotic use" ;
|
||||
Else
|
||||
SelectionVal1 := "" ;
|
||||
Endif;
|
||||
|
||||
ElseIf PCA_Reason2.Value Is Not Null Then
|
||||
If PCA_Reason2.Value ="Recommended by Pain Management Consultant" Then
|
||||
SelectionVal1 := "Pain Mgt Consult" ;
|
||||
Elseif PCA_Reason2.Value ="End of Life" Then
|
||||
SelectionVal1 := "End of Life" ;
|
||||
Elseif PCA_Reason2.Value ="Oncology patient receiving escalating doses of IV hydromorphone with inadequate pain relief" Then
|
||||
SelectionVal1 := "Onc. Pt with inadequate pain relief" ;
|
||||
Else
|
||||
SelectionVal1 := "" ;
|
||||
Endif;
|
||||
Elseif ((PCA_Reason1.Value = Null) And (PCA_Reason2.Value = Null) ) Then
|
||||
SelectionVal1 := "" ;
|
||||
Endif;
|
||||
|
||||
PCA_Condition.Value := SelectionVal1 ;
|
||||
PCA_Condition.Control_Visible := True;
|
||||
|
||||
Endif;
|
||||
|
||||
|
||||
|
||||
|
||||
/* this_communication.DisplayForm := "Yes";
|
||||
this_communication.Message := "MLM Field :" || CallingField || "\n" ||
|
||||
"MLM Event :" || CallingEvent || "\n" ||
|
||||
"Freq Val:" || freq_Val || "\n" ||
|
||||
"Freq Summary: " || freq_Val.FrequencySummary;
|
||||
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