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

128 lines
4.4 KiB
Plaintext

maintenance:
title: Lidoderm_Patch Order Set;;
mlmname: FORM_Set_Lidoderm_Patch;;
arden: version 2.5;;
version: 5.50;;
institution: St Clair Hospital;;
author: Peggy Karish, Allscripts ;;
specialist: Don Warnick, Allscripts;;
date: 2012-12-05;;
validation: testing;;
library:
purpose: Patch removal time will be calculated based upon the time of patch application
;;
explanation: This MLM is called from the TPN Parental Nutrition Order Set (TPN Parent Nut Ord)
Change history
12.05.2012 DJW CSR# 31205 copied from FORM_Set_TPN
04.26.2016 TMS CSR 33465 Add call on form Close to Medication Order Management MLM
;;
keywords: Called MLMs, Lidoderm Lidocaine Patch
;;
knowledge:
type: data-driven;;
data:
// Communication object Form object Arden ClientInfo object
(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:="";
// Assigns fields passed in the Form object to the Field object
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;
FrequencyCode := first of (field_list where field_list.DataItemName = "FrequencyCode" and field_List.Control_MultiFieldOccNum = 1);
ApplyStartDate := first of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 2);
ApplyStartTime := first of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 3);
RemovalStartDate:= first of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 1);
RemovalStartTime:= first of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 1);
FrequencyCodeValue := FrequencyCode.value;
ApplyStartDateValue := ApplyStartDate.value;
ApplyStartTimeValue := ApplyStartTime.value;
RemovalStartTimeValue := RemovalStartTime.value;
// FORM OPEN EVENT SECTION - Set fields to the standard values
If CallingEvent = "FormOpen" Then
FrequencyCodeValue.FrequencySummary:= "Q24H";
ApplyStartTimeValue.ReqTimeCode := "Scheduled/Start Time";
ApplyStartDate.value := NOW;
endif;
// FORM CLOSE EVENT SECTION
If CallingEvent = "FormClose" Then
PatchSchedule:= ApplyStartTimeValue.ReqTimeCode;
ScheduledApplyTimeHour:= substring 2 characters from ApplyStartTimeValue.ReqTimeValue as number;
ScheduledApplyTimeMin := substring 2 characters starting at 4 from ApplyStartTimeValue.ReqTimeValue;
If (PatchSchedule = "Routine" or PatchSchedule = "STAT") and Extract Minute NOW <> 00
then HR := Extract Hour NOW +1;
MN := "00";
elseif (PatchSchedule = "Routine" or PatchSchedule = "STAT") and Extract Minute NOW = 00
then HR := Extract Hour NOW;
MN := "00";
else HR := ScheduledApplyTimeHour;
MN := ScheduledApplyTimeMin;
endif;
If HR < 12 then // 00:00 - 11:59
RemovalDay:= ApplyStartDate.value;
HRRemove := HR + 12;
elseif HR > 21 then // 22:00 - 23:59
RemovalDay:= ApplyStartDate.value +1 day;
HRRemove := HR - 12;
else // 12:00 - 21:59
RemovalDay:= ApplyStartDate.value +1 day;
HRRemove := HR - 12;
HRRemove := "0" || HRRemove;
endif;
PatchRemovalTime:= HRRemove ||":" || MN;
RemovalStartDate.Value :=RemovalDay;
RemovalStartTimeValue.ReqTimeCode := "Scheduled/Start Time";
RemovalStartTimeValue.ReqTimeValue := PatchRemovalTime;
Med_Order_Mgt := mlm {{{SINGLE-QUOTE}}}FORM_SET_Rx_Medication_Order_Mgt{{{SINGLE-QUOTE}}};
(this_communication, this_form) := call Med_Order_Mgt with this_communication, this_form, client_info_obj;
endif; // Close Section
;;
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: