Files
St.Clair/MLMStripper/bin/Debug/FORM/FORM_RESP_MEDICATIONS.mlm

178 lines
9.3 KiB
Plaintext

maintenance:
title: St.Clair: Respiratory Medications;;
mlmname: FORM_Resp_Medications;;
arden: version 2;;
version: 3.50;;
institution: St Clair;;
author: Don Warnick, Eclipsys Corp;;
specialist: ;;
date: 2006-09-11;;
validation: testing;;
library:
purpose: To add selected meds to the Comments field
;;
explanation: This MLM is called from form, RESP SA IPPB
1. Add selected meds to the Special Instructions field
2. If PRN box is checked, make the PRN Reason field available
3. Depending upon the value of Xopenex, make other fields visible or read/write
Change History
AnkitM 07.26.2017 - Change word from Xopenex to Levalbuterol except data items
;;
keywords: Called MLMs, Form fields, Respiratory Meds
;;
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;
// 1. Add selected meds to the Special Instructions field
// 2. If PRN box is checked, make the PRN Reason field available
// 3. Depending upon the value of Xopenex, make other fields visible or read/write
comment:= last of (field_list where field_list.DataItemName = "PRX_NOTECOMMENT0" );
nss_lbl:= last of (field_list where field_list.DataItemName = "RESP Normal Saline Label" );
nss_amt:= last of (field_list where field_list.DataItemName = "RESP NSS amount" );
albuterol_125:= last of (field_list where field_list.DataItemName = "RESP_Albuterol 1.25mg/3ml NSS" );
albuterol_25:= last of (field_list where field_list.DataItemName = "RESP_Albuterol 2.5mg/3ml NSS" );
albuterol_dose:= last of (field_list where field_list.DataItemName = "RESP_Albuterol Dose" );
alupent_02:= last of (field_list where field_list.DataItemName = "RESP_Alupent 0.2mg/2.5ml NSS" );
alupent_03:= last of (field_list where field_list.DataItemName = "RESP_Alupent 0.3mg/2.5ml NSS" );
atrovent_05:= last of (field_list where field_list.DataItemName = "RESP_Atrovent 0.5mg/3ml NSS" );
atrovent_dose:= last of (field_list where field_list.DataItemName = "RESP_Atrovent Dose" );
lidocaine_vol:= last of (field_list where field_list.DataItemName = "RESP_Lidocaine Volume" );
mucomyst_vol:= last of (field_list where field_list.DataItemName = "RESP_Mucomyst volume" );
nss_25:= last of (field_list where field_list.DataItemName = "RESP_NSS 2.5cc" );
nss_3:= last of (field_list where field_list.DataItemName = "RESP_NSS 3cc" );
pentamidine_600:= last of (field_list where field_list.DataItemName = "RESP_Pentamidine 600mg" );
pentamidine_dose:= last of (field_list where field_list.DataItemName = "RESP_Pentamidine Dose" );
prn:= last of (field_list where field_list.DataItemName = "IsPRN" );
prn_reason:= last of (field_list where field_list.DataItemName = "RESP_PRN Reasons" );
pulmicort_025:= last of (field_list where field_list.DataItemName = "RESP_Pulmicort 0.25mg" );
pulmicort_05:= last of (field_list where field_list.DataItemName = "RESP_Pulmicort 0.5mg" );
racepinephrine_05:= last of (field_list where field_list.DataItemName = "RESP_Racepinephrine 0.5ml (Vaponephrine)" );
Levalbuterol:= last of (field_list where field_list.DataItemName = "RESP_Xopenex" );
Levalbuterol_063:= last of (field_list where field_list.DataItemName = "RESP_Xopenex 0.63mg/3ml NSS" );
Levalbuterol_125:= last of (field_list where field_list.DataItemName = "RESP_Xopenex 1.25mg/3ml NSS" );
Levalbuterol_sub_lbl2:= last of (field_list where field_list.DataItemName = "RESP_Xopenex Substitute Label 2" );
Levalbuterol_sub_lbl:= last of (field_list where field_list.DataItemName = "RESP_Xopenex Substitutes Label" );
waking:= last of (field_list where field_list.DataItemName = "UseWakingHourOnly" );
If CallingEvent="FormOpen"
then
prn_reason.control_read_only := true;
Levalbuterol_sub_lbl.control_visible := false;
Levalbuterol_sub_lbl2.control_visible := false;
Levalbuterol_063.control_read_only := true;
Levalbuterol_125.control_read_only := true;
endif;
If CallingEvent = "FieldChange"
then
If CallingField = "IsPRN"
then
If prn.value = true
then
prn_reason.control_read_only := false;
else
prn_reason.control_read_only := true;
prn_reason.value := "";
endif;
endif;
If CallingField = "RESP_Xopenex"
then
if Levalbuterol.value = "Use Therapeutic Substitute"
then
Levalbuterol_sub_lbl.control_visible := true;
Levalbuterol_sub_lbl2.control_visible := true;
else
Levalbuterol_sub_lbl.control_visible := false;
Levalbuterol_sub_lbl2.control_visible := false;
endif;
if Levalbuterol.value = "Per Physician Order: Do NOT Substitute"
then
Levalbuterol_063.control_read_only := false;
Levalbuterol_125.control_read_only := false;
else
Levalbuterol_063.control_read_only := true;
Levalbuterol_125.control_read_only := true;
Levalbuterol_063.value := "";
Levalbuterol_125.value := "";
endif;
endif;
endif;
If CallingEvent="FormClose"
then
comment.value:= " ";
If albuterol_25.value = true then comment.value:= comment.value || albuterol_25.label || " : "; endif;
If albuterol_125.value = true then comment.value:= comment.value || albuterol_125.label || " : "; endif;
If nss_amt.value <> "" then comment.value:= comment.value || nss_amt.label || " " || nss_amt.value || " : "; endif;
If albuterol_dose.value <> "" then comment.value:= comment.value || albuterol_dose.label || " " || albuterol_dose.value || " : "; endif;
If alupent_02.value = true then comment.value:= comment.value || alupent_02.label || " : "; endif;
If alupent_03.value = true then comment.value:= comment.value || alupent_03.label || " : "; endif;
If atrovent_05.value = true then comment.value:= comment.value || atrovent_05.label || " : "; endif;
If atrovent_dose.value <> "" then comment.value:= comment.value || atrovent_dose.label || " " || atrovent_dose.value || " : "; endif;
If lidocaine_vol.value <> "" then comment.value:= comment.value || lidocaine_vol.label || " " || lidocaine_vol.value || " : "; endif;
If mucomyst_vol.value <> "" then comment.value:= comment.value || mucomyst_vol.label || " " || mucomyst_vol.value || " : "; endif;
If nss_25.value = true then comment.value:= comment.value || nss_25.label || " : "; endif;
If nss_3.value = true then comment.value:= comment.value || nss_3.label || " : "; endif;
If pentamidine_600.value = true then comment.value:= comment.value || pentamidine_600.label || " : "; endif;
If pentamidine_dose.value <> "" then comment.value:= comment.value || pentamidine_dose.label || " " || pentamidine_dose.value || " : "; endif;
If pulmicort_025.value = true then comment.value:= comment.value || pulmicort_025.label || " : "; endif;
If pulmicort_05.value = true then comment.value:= comment.value || pulmicort_05.label || " : "; endif;
If racepinephrine_05.value = true then comment.value:= comment.value || racepinephrine_05.label || " : "; endif;
If Levalbuterol.value <> "" then comment.value:= comment.value || Levalbuterol.label || " " || Levalbuterol.value || " : "; endif;
If Levalbuterol_063.value = true then comment.value:= comment.value || Levalbuterol_063.label || " : "; endif;
If Levalbuterol_125.value = true then comment.value:= comment.value || Levalbuterol_125.label || " : "; endif;
If prn.value = true then comment.value:= comment.value || prn.label || " : "; endif;
If prn_reason.value <> "" then comment.value:= comment.value || prn_reason.label || " - " || prn_reason.value || " : "; endif;
If waking.value = true then comment.value:= comment.value || waking.label || " : "; endif;
endif;
;;
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: