Initial Checking with all 820 MLMs
This commit is contained in:
236
MLMStripper/bin/Debug/FORM/FORM_SET_PARKINSONS_MED_ORDERS.mlm
Normal file
236
MLMStripper/bin/Debug/FORM/FORM_SET_PARKINSONS_MED_ORDERS.mlm
Normal file
@@ -0,0 +1,236 @@
|
||||
maintenance:
|
||||
|
||||
title: Parkinson{{{SINGLE-QUOTE}}}s Medication Orders;;
|
||||
mlmname: FORM_Set_Parkinsons_Med_Orders;;
|
||||
arden: version 2;;
|
||||
version: 15.10;;
|
||||
institution: St Clair Hospital;;
|
||||
author: Teresa Spicuzza, Eclipsys Corp ext 7448;;
|
||||
specialist: Teresa Spicuzza, Eclipsys Corp ext 7448;;
|
||||
date: 2016-01-06;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose: Used for medications orders for parkinson{{{SINGLE-QUOTE}}}s disease to allow user to easily enter non standard schedules
|
||||
and creating a <User Schedule> from their selections.
|
||||
;;
|
||||
|
||||
explanation: This MLM is called from the order set form PRX_OSParkinsonMed
|
||||
|
||||
|
||||
Change history
|
||||
|
||||
10.04.2016 TMS Initial build CSR 34278
|
||||
04.26.2016 TMS Add call on form Close to Medication Order Management MLM CSR 33465
|
||||
|
||||
|
||||
;;
|
||||
keywords: Called MLMs, parkinson{{{SINGLE-QUOTE}}}s
|
||||
;;
|
||||
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;
|
||||
standard_libs := MLM {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
||||
include standard_libs;
|
||||
//using "ObjectsPlusXA.SCM.Forms";
|
||||
//using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms";
|
||||
/***************************************************************************************/
|
||||
|
||||
// Use String parse
|
||||
str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}};
|
||||
|
||||
// Initialize error message
|
||||
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;
|
||||
|
||||
//Find the baseline order checkbox that may need to be ordered with this protocol
|
||||
|
||||
DoseA := last of (field_list where field_list.DataItemName = "MethotrexateDose" and field_List.Control_MultiFieldOccNum = 1);
|
||||
DoseA_value := DoseA.value;
|
||||
Dosage := first of (field_list where field_list.DataItemName = "DosageLow" and field_List.Control_MultiFieldOccNum = 1);
|
||||
Dosage_val := dosage.value;
|
||||
DosageUOM := first of (field_list where field_list.DataItemName = "UOM" and field_List.Control_MultiFieldOccNum = 1);
|
||||
AltDaysDoseA := last of (field_list where field_list.DataItemName = "PRX_AltSchedule1" and field_List.Control_MultiFieldOccNum = 1);
|
||||
AltDaysDoseA_list := AltDaysDoseA.value;
|
||||
AdminTimesDoseA := last of (field_list where field_list.DataItemName = "PRX_TimeofDay" and field_List.Control_MultiFieldOccNum = 1);
|
||||
AdminTimesDoseA_list := AdminTimesDoseA.value;
|
||||
NonWeeklyFreqDoseA := last of (field_list where field_list.DataItemName = "PRX_NonWeeklySchedule" and field_List.Control_MultiFieldOccNum = 1);
|
||||
NonWeeklyFreqDoseA_list := NonWeeklyFreqDoseA.value;
|
||||
DoseADays := last of (field_list where field_list.DataItemName = "PRX_Scheddays1" and field_List.Control_MultiFieldOccNum = 1);
|
||||
DoseATimes := last of (field_list where field_list.DataItemName = "PRX_SchedTimes" and field_List.Control_MultiFieldOccNum = 1);
|
||||
UserSchedCB := last of (field_list where field_list.DataItemName = "PRX_Generic_CB" and field_List.Control_MultiFieldOccNum = 1);
|
||||
UserSchedCB_value := UserSchedCB.value;
|
||||
Frequency := last of (field_list where field_list.DataItemName = "FrequencyCode" and field_List.Control_MultiFieldOccNum = 1);
|
||||
Frequency_val := Frequency.value;
|
||||
MedOrders := first of (field_list where field_list.DataItemName = "MultiOrderGrid" and field_List.Control_MultiFieldOccNum = 1);
|
||||
|
||||
// if CallingEvent = "FormOpen" then
|
||||
|
||||
|
||||
|
||||
gridval := MedOrders.value;
|
||||
index_list := 1 seqto (count gridval) ;
|
||||
|
||||
if exist MedOrders then
|
||||
for S in index_list do
|
||||
selorders1 := gridval.IsSelected [S];
|
||||
if selorders1 = true then
|
||||
medordername := Gridval.Name [S] ;
|
||||
medorderguid := gridval.OrderCatalogMasterItemGUID [S];
|
||||
endif;
|
||||
enddo;
|
||||
endif;
|
||||
|
||||
|
||||
If callingevent = "FormOpen" then
|
||||
AltDaysDoseA.control_read_only := True;
|
||||
AdminTimesDoseA.control_read_only := True;
|
||||
|
||||
(defaultdose, defaultuom) := read last
|
||||
{ " select me.dosagelow, me.uom from CV3OrderCatalogItem oci "
|
||||
|| " join CV3MedicationExtension me on me.guid = oci.OrderGUID "
|
||||
|| " where oci.Modifier = {{{SINGLE-QUOTE}}}-{{{SINGLE-QUOTE}}} and oci.OrderMasterItemGUID = " || medorderguid
|
||||
};
|
||||
|
||||
ordertemplateguid := read last { "select OrderGUID from CV3OrderCatalogItem where OrderMasterItemGUID = " || medorderguid || " and Modifier = {{{SINGLE-QUOTE}}}-{{{SINGLE-QUOTE}}} " };
|
||||
|
||||
If ordertemplateguid is not null then
|
||||
|
||||
(defaultdose_uddi) := read last
|
||||
{ "select oud.Value from CV3order o "
|
||||
|| "join CV3OrderUserData oud on oud.OrderGUID = o.guid "
|
||||
|| "where o.TypeCode = {{{SINGLE-QUOTE}}}Medication{{{SINGLE-QUOTE}}} and o.GUID = " ||ordertemplateguid
|
||||
|| " and o.OrderCatalogMasterItemGUID = " || medorderguid
|
||||
|| "and oud.UserDataCode = {{{SINGLE-QUOTE}}}PRX_Default_Dose{{{SINGLE-QUOTE}}} "
|
||||
|| "and oud.value is not null "};
|
||||
|
||||
(defaultuom_uddi) := read last
|
||||
{ " select oud.Value from CV3order o "
|
||||
|| " join CV3OrderUserData oud on oud.OrderGUID = o.guid "
|
||||
|| " where o.TypeCode = {{{SINGLE-QUOTE}}}Medication{{{SINGLE-QUOTE}}} and o.GUID = " ||ordertemplateguid
|
||||
|| " and o.OrderCatalogMasterItemGUID = " || medorderguid
|
||||
|| " and oud.UserDataCode = {{{SINGLE-QUOTE}}}PRX_Default_UOM{{{SINGLE-QUOTE}}} "
|
||||
|| " and oud.value is not null "};
|
||||
|
||||
endif;
|
||||
|
||||
If defaultdose is not null then
|
||||
dosage.value := defaultdose;
|
||||
elseif defaultdose_uddi is not null then
|
||||
dosage.value := defaultdose_uddi;
|
||||
endif;
|
||||
|
||||
If defaultuom is not null then
|
||||
dosageuom.value := defaultuom;
|
||||
elseif defaultuom_uddi is not null then
|
||||
dosageuom.value := defaultuom_uddi;
|
||||
endif;
|
||||
|
||||
endif; //CallingEvent = "FormOpen"
|
||||
|
||||
If CallingEvent = "FieldChange" or CallingEvent = "FormClose" Then
|
||||
|
||||
//Make appropriate fields available on the form for weekly and one time frequencies
|
||||
|
||||
If CallingField = "PRX_Generic_CB|1" then
|
||||
|
||||
If UserSchedCB.Value = true then
|
||||
AltDaysDoseA.control_read_only := False;
|
||||
AdminTimesDoseA.control_read_only := False;
|
||||
Frequency_val.frequencysummary := Null;
|
||||
Frequency.control_read_only := True;
|
||||
Frequency.control_mandatory := false;
|
||||
NonWeeklyFreqDoseA.control_read_only := true;
|
||||
NonWeeklyFreqDoseA.value:= Null;
|
||||
|
||||
|
||||
|
||||
elseif UserSchedCB_Value = false then
|
||||
AltDaysDoseA.value := Null;
|
||||
AltDaysDoseA.control_read_only := True;
|
||||
AdminTimesDoseA.control_read_only := True;
|
||||
AdminTimesDoseA.value := Null;
|
||||
DoseADays.value := "None";
|
||||
DoseATimes.value := "None";
|
||||
NonWeeklyFreqDoseA.control_read_only := false;
|
||||
Frequency.control_read_only := False;
|
||||
Frequency.control_mandatory := True;
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
// Determine the day of the week for today and the following 6 days
|
||||
|
||||
ThisTime := (now as time) ;
|
||||
FormatDate := extract month ThisTime ||"-" || extract day ThisTime ||"-" ||extract year ThisTime;
|
||||
ThisDay := extract year ThisTime || "-" || extract month ThisTime ||"-" || extract day ThisTime;
|
||||
DayofWeek1 := read last {"SELECT DATENAME(dw, GETDATE ())"};
|
||||
DayofWeek2 := read last {"SELECT DATENAME(dw, dateadd (WEEKDAY,1,{{{SINGLE-QUOTE}}}" || ThisTime || "{{{SINGLE-QUOTE}}}))"};
|
||||
DayofWeek3 := read last {"SELECT DATENAME(dw, dateadd (WEEKDAY,2,{{{SINGLE-QUOTE}}}" || ThisTime || "{{{SINGLE-QUOTE}}}))"};
|
||||
DayofWeek4 := read last {"SELECT DATENAME(dw, dateadd (WEEKDAY,3,{{{SINGLE-QUOTE}}}" || ThisTime || "{{{SINGLE-QUOTE}}}))"};
|
||||
DayofWeek5 := read last {"SELECT DATENAME(dw, dateadd (WEEKDAY,4,{{{SINGLE-QUOTE}}}" || ThisTime || "{{{SINGLE-QUOTE}}}))"};
|
||||
DayofWeek6 := read last {"SELECT DATENAME(dw, dateadd (WEEKDAY,5,{{{SINGLE-QUOTE}}}" || ThisTime || "{{{SINGLE-QUOTE}}}))"};
|
||||
DayofWeek7 := read last {"SELECT DATENAME(dw, dateadd (WEEKDAY,6,{{{SINGLE-QUOTE}}}" || ThisTime || "{{{SINGLE-QUOTE}}}))"};
|
||||
|
||||
|
||||
|
||||
If CallingField = "PRX_TimeofDay|1" then
|
||||
|
||||
if AdminTimesDoseA.value is not null then
|
||||
DoseATimes.value := AdminTimesDoseA_list;
|
||||
(adminlist) := call str_parse with AdminTimesDoseA_list,",";
|
||||
admin_count := count adminlist;
|
||||
DoseADays.value := "AllDays";
|
||||
|
||||
endif;
|
||||
endif;
|
||||
endif; //CallingEvent = "FieldChange" or CallingEvent = "FormClose"
|
||||
|
||||
If CallingEvent = "FormClose" then
|
||||
|
||||
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;
|
||||
|
||||
|
||||
|
||||
;;
|
||||
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