134 lines
4.5 KiB
Plaintext
134 lines
4.5 KiB
Plaintext
maintenance:
|
|
|
|
title: Sedative Orders with Dose Range;;
|
|
mlmname: FORM_Rx_Sedative_Dose_Check;;
|
|
arden: version 2.5;;
|
|
version: 5.50;;
|
|
institution: St Clair Hospital;;
|
|
author: Teresa Spicuzza, Allscripts ;;
|
|
specialist: Teresa Spicuzza, Allscripts;;
|
|
date: 2011-11-18;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose: Used for Dose Reduction of Sedative Orders in patients over 65 years of age
|
|
;;
|
|
|
|
explanation: This MLM is called from form PRX_PoTabBnDrPrDs.
|
|
|
|
Change history
|
|
11.30.2011 TMS Moved to production Ticket # 143461 (original CSR 26335)
|
|
|
|
|
|
;;
|
|
keywords: Called MLMs, Sedatives
|
|
;;
|
|
knowledge:
|
|
type: data-driven;;
|
|
data:
|
|
|
|
|
|
standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
|
include standard_libs;
|
|
|
|
using "ObjectsPlusXA.SCM.Forms";
|
|
using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
|
|
|
|
// 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;
|
|
ClientGuid := this_communication.ClientGUID;
|
|
Order_Name := this_communication.PrimaryObj.Name;
|
|
|
|
|
|
HiDose_fld := last of (field_list where field_list.DataItemName = "DosageHigh");
|
|
LoDose_fld := last of (field_list where field_list.DataItemName = "DosageLow");
|
|
Override_fld := last of (field_list where field_list.DataItemName = "PRX_DosageOverride");
|
|
//Substitute_fld := last of (field_list where field_list.DataItemName = "PRX_NoteComment2";
|
|
message65 := "Lower dose substituted by approval of Medical Executive Committee; patient is 65 years or older";
|
|
messageDNS := "\n\n You must have a {{{SINGLE-QUOTE}}}Do Not Substitute{{{SINGLE-QUOTE}}} physician order to override lower dose.";
|
|
nomessage := " ";
|
|
|
|
if exists (client_info_obj) then
|
|
(birthdate,dobM,dobD,dobY) := read last {ClientInfo: BirthDate, BirthMonthNum, BirthDayNum, BirthYearNum
|
|
REFERENCING client_info_obj};
|
|
endif;
|
|
|
|
patientAge := (NOW - birthdate) / (1 year);
|
|
|
|
if (patientAge > 64.99) then
|
|
if (Order_name = "Eszopiclone 2mg Tab") then
|
|
If Override_fld.value = false then
|
|
HiDose_fld.control_read_only := true;
|
|
HiDose_fld.value := " ";
|
|
endif;
|
|
If Override_fld.value = true then
|
|
HiDose_fld.control_read_only := false;
|
|
endif;
|
|
endif;
|
|
if (Order_name = "Eszopiclone 1mg Tab") then
|
|
HiDose_fld.control_read_only := false;
|
|
if HiDose_fld.value > 2 and Override_fld.value = false then
|
|
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with message65 || messageDNS ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
|
HiDose_fld.value := " ";
|
|
endif;
|
|
endif;
|
|
|
|
if (Order_name = "Zolpidem 10mg Tab") then
|
|
If Override_fld.value = false then
|
|
HiDose_fld.control_read_only := true;
|
|
HiDose_fld.value := " ";
|
|
endif;
|
|
If Override_fld.value = true then
|
|
HiDose_fld.control_read_only := false;
|
|
endif;
|
|
endif;
|
|
if (Order_name = "Zolpidem 5mg Tab") then
|
|
HiDose_fld.control_read_only := false;
|
|
if HiDose_fld.value > 5 and Override_fld.value = false then
|
|
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with message65 || messageDNS ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
|
HiDose_fld.value := " ";
|
|
endif;
|
|
if LoDose_fld.value > 5 and Override_fld.value = false then
|
|
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with message65 || messageDNS ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
|
LoDose_fld.value := "5";
|
|
endif;
|
|
endif;
|
|
|
|
|
|
|
|
endif; //patientAge > 64.99
|
|
;;
|
|
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:
|