Initial Checking with all 820 MLMs
This commit is contained in:
532
MLMStripper/bin/Debug/FORM/FORM_SET_REPEAT_LAB_ORDERS.mlm
Normal file
532
MLMStripper/bin/Debug/FORM/FORM_SET_REPEAT_LAB_ORDERS.mlm
Normal file
@@ -0,0 +1,532 @@
|
||||
maintenance:
|
||||
|
||||
title: FORM_Set_Repeat_Lab_Orders;;
|
||||
mlmname: FORM_Set_Repeat_Lab_Orders;;
|
||||
arden: version 2.5;;
|
||||
version: 5.50;;
|
||||
institution: St Clair Hospital;;
|
||||
author: Teresa Spicuzza, Allscripts ;;
|
||||
specialist: Teresa Spicuzza, Allscripts;;
|
||||
date: 2011-04-01;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose: Used for Creating Repeating Lab Orders
|
||||
;;
|
||||
|
||||
explanation: This MLM is called from ___ Order Set
|
||||
|
||||
Change history
|
||||
06.12.2012 TMS Created in DEV
|
||||
11.26.2012 TMS Moved to Production CSR 26927
|
||||
02.25.2013 TMS Added logic to look for heparin orders for APTT heparin status
|
||||
Missing from first repeat order, identified during AM Rounds project. HD ticket 156616
|
||||
03.25.2015 JML CSR 32953 Modified logic to work for internal medicine order set as well as CCM Common Labs;
|
||||
retrieving orderset name so correct dataitem is pulled.
|
||||
06.17.2015 TMS Modified to add new dataitems used for Labs, Time and Frquency for
|
||||
Post Initiation Catheter Directed Thrombolytic Therapy CSR:32710
|
||||
08.03.2015 GOS Added new code to change format of Order information display on form CSR:32710
|
||||
11.30.2015 JML WO #1949479: Modified code to properly display user-friendly verbiage for AM Rounds and other frequencies
|
||||
in repeat lab orders text box.
|
||||
12.03.2015 JML Moved to Production.
|
||||
01.07.2016 STH CSR#: 33758 - Updated section for Post Initiation Thrombolytic to call the custom repeat lab scheduling MLM {go-live 3/7/2016}
|
||||
04.26.2016 TMS CSR 33465 Add call on form Close to Medication Order Management MLM
|
||||
03.11.2019 TMS CSR 37602 Added Hospitalist Orders to use data item "Repeat_Labs 2".
|
||||
07.02.2019 TMS CSR 38460 Added General Admission Orders to use data item "Repeat_Labs 2". This is going to be the new
|
||||
name for the Hospitalist Orders.
|
||||
09.05.2019 TMS CSR 38460 Added Admission Orders - General to use data item "Repeat_Labs 2". This is going to be the new
|
||||
name for the General Admission Orders .
|
||||
|
||||
;;
|
||||
keywords: Called MLMs, Repeat Lab Orders
|
||||
;;
|
||||
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;
|
||||
|
||||
ClientGuid := this_communication.ClientGUID;
|
||||
ChartGuid := this_communication.ChartGUID;
|
||||
ClientVisitGuid := this_communication.ClientVisitGUID;
|
||||
/*******************Make Changes To Spelling And Flags In This Section*******************/
|
||||
|
||||
/* Set to True if a decision.log is needed.*/
|
||||
log_execution_info := False;
|
||||
|
||||
CreateRepeatOrder := MLM {{{SINGLE-QUOTE}}}SCH_DIAG_WRITE_ORDER{{{SINGLE-QUOTE}}};
|
||||
str_parse := mlm {{{SINGLE-QUOTE}}}UTIL_STRING_PARSE{{{SINGLE-QUOTE}}};
|
||||
Post_Init_cath_dir_Thrombolytic := mlm {{{SINGLE-QUOTE}}}FORM_POST_INITIATION_CATHETER_DIR_THROMBOLYTIC{{{SINGLE-QUOTE}}};
|
||||
|
||||
|
||||
/***************************************************************************************/
|
||||
|
||||
// Initialize error message
|
||||
error_message:="";
|
||||
error_occurred := false;
|
||||
// Assigns fields passed in the Form object to the Field object
|
||||
field_list:= this_form.fields;
|
||||
CallingEvent := this_communication.CallingEvent;
|
||||
CallingField := this_communication.CallingFieldName;
|
||||
|
||||
PrimaryObjDetail := this_communication.PrimaryObj;
|
||||
OrderSetName := PrimaryObjDetail.OrderSetName;
|
||||
|
||||
// Define other fields
|
||||
|
||||
if ( OrderSetName = "CCM Common Lab Orders" ) then
|
||||
RepeatLabs := last of (field_list where field_list.DataItemName = "Repeat_Labs" and field_List.Control_MultiFieldOccNum = 1);
|
||||
RepeatFreq := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Frequency" and field_List.Control_MultiFieldOccNum = 1);
|
||||
StartTimeB := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Lab_Time" and field_List.Control_MultiFieldOccNum = 1);
|
||||
|
||||
elseif ( OrderSetName in ("Hospitalist Orders","Internal Medicine Order Set","General Admission Orders", "Admission Orders - General" )) then
|
||||
RepeatLabs := last of (field_list where field_list.DataItemName = "Repeat_Labs 2" and field_List.Control_MultiFieldOccNum = 1);
|
||||
RepeatFreq := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Frequency" and field_List.Control_MultiFieldOccNum = 1);
|
||||
StartTimeB := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Lab_Time" and field_List.Control_MultiFieldOccNum = 1);
|
||||
|
||||
elseif ( trim(OrderSetName) = "Post Initiation Catheter Directed Thrombolytic Therapy" ) then
|
||||
|
||||
RepeatLabs := last of (field_list where field_list.DataItemName = "Repeat_Labs 3" and field_List.Control_MultiFieldOccNum = 1);
|
||||
RepeatFreq := last of (field_list where field_list.DataItemName = "CPOE_Rpt_Freq_LyticTherapy" and field_List.Control_MultiFieldOccNum = 1);
|
||||
StartTimeB := last of (field_list where field_list.DataItemName = "CPOE_Rpt_Time_LyticTherapy" and field_List.Control_MultiFieldOccNum = 1);
|
||||
//Occurances := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Lab_Occur" and field_list.Control_MultiFieldOccNum = 1 );
|
||||
//if (Occurances.Value = "5 Times") then
|
||||
void := call Post_Init_cath_dir_Thrombolytic with (this_communication,this_form,client_info_obj);
|
||||
|
||||
//endif;
|
||||
else
|
||||
RepeatLabs := last of (field_list where field_list.DataItemName = "Repeat_Labs" and field_List.Control_MultiFieldOccNum = 1);
|
||||
RepeatFreq := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Frequency" and field_List.Control_MultiFieldOccNum = 1);
|
||||
StartTimeB := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Lab_Time" and field_List.Control_MultiFieldOccNum = 1);
|
||||
|
||||
endif;
|
||||
|
||||
StartOn := last of (field_list where field_list.DataItemName = "CPOE_Repeat Lab Start" and field_List.Control_MultiFieldOccNum = 1);
|
||||
StartDate := last of (field_list where field_list.DataItemName = "RequestedDate" and field_List.Control_MultiFieldOccNum = 1);
|
||||
StartTime := last of (field_list where field_list.DataItemName = "RequestedTime" and field_List.Control_MultiFieldOccNum = 1);
|
||||
RepeatOcc := last of (field_list where field_list.DataItemName = "CPOE_Repeat_Lab_Occur" and field_List.Control_MultiFieldOccNum = 1);
|
||||
SubmitButton := last of (field_list where field_list.DataItemName = "CPOE Repeat Lab Submit Button" and field_List.Control_MultiFieldOccNum = 1);
|
||||
OrderAccumBox := last of (field_list where field_list.DataItemName = "CPOE Repeat Lab Accumulator" and field_List.Control_MultiFieldOccNum = 1);
|
||||
SendButton := last of (field_list where field_list.DataItemName = "MLM Generic Checkbox" and field_List.Control_MultiFieldOccNum = 1);
|
||||
StartDate_val := StartDate.Value;
|
||||
StartOn_val := StartOn.Value;
|
||||
StartTime_val := StartTime.Value;
|
||||
StartTimeB_val := StartTimeB.Value;
|
||||
RepeatOcc_val := RepeatOcc.Value;
|
||||
RepeatFreq_val := RepeatFreq.Value;
|
||||
SendButton_val := SendButton.Value;
|
||||
SubmitButton_val := SubmitButton.Value;
|
||||
OrderAccumBox_val := OrderAccumBox;
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Define the ObjectsPlus destinations
|
||||
//------------------------------------------------------------
|
||||
|
||||
Parent_DiagnosticOrder_dest := destination { ObjectsPlus } with
|
||||
[ alert_type := "Warning",
|
||||
short_message := "Object created by MLM, placed on worksheet",
|
||||
priority := "low",
|
||||
scope := "chart",
|
||||
rule_group := "Order Object",
|
||||
rule_number := 2080 ];
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Error destination
|
||||
//---------------------------------------------------------------
|
||||
error_destination := destination { Alert } with [
|
||||
alert_type := "Warning",
|
||||
short_message := "ObjectsPlus Error from MLM",
|
||||
priority := "low",
|
||||
scope := "chart",
|
||||
Rule_group := "ObjectsPlus Error from MLM",
|
||||
Rule_number := 1004,
|
||||
Rule_subgroup := "",
|
||||
Send_with_order := "",
|
||||
Alert_dialog_settings := "",
|
||||
Display_alert := true ];
|
||||
|
||||
CurrentLocation := read last {"Select CurrentLocation "
|
||||
||" From cv3Clientvisit "
|
||||
||" Where Guid = " || SQL(ClientVisitGuid)
|
||||
||" and VisitStatus = {{{SINGLE-QUOTE}}}ADM{{{SINGLE-QUOTE}}}" };
|
||||
|
||||
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;
|
||||
|
||||
If (callingevent = "FormClose" or callingfield = "MLM Generic Checkbox|1" or callingfield = "CPOE Repeat Lab Submit Button|1") then
|
||||
|
||||
|
||||
// retrieve if patient on IV heparin for APTT order form
|
||||
heparin_order_iv := "%Heparin 25,000%";
|
||||
heparin_order_iv_found := read last {"select name from cv3order where name like " || SQL(heparin_order_iv)
|
||||
|| " and ClientGUID = " || SQL(clientguid)
|
||||
|| " and ChartGUID = " || SQL(chartguid)
|
||||
|| " and ClientVisitGUID= " || SQL(clientvisitguid)
|
||||
|| " and OrderStatusLevelNum > 15 "
|
||||
|| " and OrderStatusLevelNum not in (69, 70) " };
|
||||
|
||||
if heparin_order_IV_found is not null then
|
||||
heparin_iv_found := true;
|
||||
else
|
||||
heparin_iv_found := false;
|
||||
endif;
|
||||
|
||||
|
||||
If RepeatFreq.value is Null then
|
||||
orderfreq := "NONE";
|
||||
else
|
||||
orderfreq := RepeatFreq.value;
|
||||
endif;
|
||||
|
||||
If RepeatOcc.value = "2 Times" then
|
||||
ordertimes := "x 2";
|
||||
OccTime := (2 as number); // Added By Shivprasad for CSR #32710
|
||||
elseif RepeatOcc.value = "3 Times" then
|
||||
ordertimes := "x 3";
|
||||
OccTime := (3 as number); // Added By Shivprasad for CSR #32710
|
||||
elseif RepeatOcc.value= "4 Times" then
|
||||
ordertimes := "x 4";
|
||||
OccTime := (4 as number); // Added By Shivprasad for CSR #32710
|
||||
elseif RepeatOcc.value = "5 Times" then
|
||||
ordertimes := "x 5";
|
||||
OccTime := ( 5 as number); // Added By Shivprasad for CSR #32710
|
||||
else
|
||||
ordertimes := "NONE";
|
||||
endif;
|
||||
|
||||
If StartOn.value = "Today" then
|
||||
StartVerName := "Today";
|
||||
SDate := Read First { " Select GetDate() " } ; // Added By Shivprasad
|
||||
elseif StartOn.value = "Tomorrow" then
|
||||
StartVerName := "Tomorrow";
|
||||
SDate := Read First { " Select DateAdd(Day, 1, GetDate()) "} ; // Added By Shivprasad
|
||||
else
|
||||
VerName := "NONE";
|
||||
endif;
|
||||
|
||||
stimeb2:= StartTimeb.value;
|
||||
|
||||
If StartTimeb.value = "AM Rounds" then
|
||||
If repeatfreq.value <> "Daily" and repeatfreq.value <> "NONE" then
|
||||
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "You cannot choose " || StartTimeb.value ||" with a frequency of " || repeatfreq.value
|
||||
||". Please change your frequency to Daily, or select a valid start time to continue. " ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
||||
goodtime := "no";
|
||||
else
|
||||
stimeb1 := StartTimeb.value;
|
||||
orderfreq := "AM Rounds";
|
||||
stimeb2 := Null;
|
||||
goodtime := "yes";
|
||||
endif;
|
||||
else
|
||||
hourmin := call str_parse with ((stimeb2 as string),":");
|
||||
stimeb1 := "Scheduled Time";
|
||||
stimebhr := hourmin [1];
|
||||
stimebmin := hourmin [2];
|
||||
goodtime := "yes";
|
||||
If StartOn.value = "Today" then
|
||||
getcurrenthour := extract hour now;
|
||||
starthour := stimebhr as number;
|
||||
currenthour := getcurrenthour as number;
|
||||
|
||||
If currenthour >= starthour then
|
||||
goodtime := "no";
|
||||
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "The start time of " || stimeb2 ||" " || starton.value
|
||||
||" has already passed, please choose another start date or time to continue. " ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
||||
else
|
||||
goodtime := "yes";
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if (RepeatLabs.value is not null or RepeatLabs.value = "") then
|
||||
StartTimeb.Control_Mandatory := true;
|
||||
StartOn.Control_Mandatory := true;
|
||||
RepeatOcc.Control_Mandatory := true;
|
||||
RepeatFreq.Control_Mandatory := true;
|
||||
else
|
||||
StartTimeb.Control_Mandatory := false;
|
||||
StartOn.Control_Mandatory := false;
|
||||
RepeatOcc.Control_Mandatory := false;
|
||||
RepeatFreq.Control_Mandatory := false;
|
||||
endif;
|
||||
|
||||
If ordertimes <> "NONE" and orderfreq <> "NONE" and StartVerName <> "NONE" and goodtime = "yes" then
|
||||
If RepeatLabs is not null then
|
||||
SendButton.value := false;
|
||||
|
||||
If OrderAccumBox.value is null then
|
||||
OrderAccumBox.value := "Ordered: ";
|
||||
endif;
|
||||
|
||||
Placeorder := "yes";
|
||||
modname := orderfreq || " " || ordertimes;
|
||||
vername := StartVerName;
|
||||
sdate := StartDate.Value;
|
||||
stime1 := StartTime_val.ReqTimeCode;
|
||||
else
|
||||
placeorder := "No";
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// WITH WORKSHEET
|
||||
try
|
||||
//-----------------------------------------------------------
|
||||
// Retrieve current order entry batch.
|
||||
// The companion order can be added only if the parent order
|
||||
// belongs to the order entry batch
|
||||
// object owned by the OrderEntryWorksheet.
|
||||
//-----------------------------------------------------------
|
||||
worksheetInfo := call {{{SINGLE-QUOTE}}}OrderEntryBatch{{{SINGLE-QUOTE}}}.GetCurrent;
|
||||
|
||||
if worksheetInfo is NULL OR "OrderEntryWorksheet" <> (worksheetInfo.OrderBatchOwner as String) then
|
||||
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "\n Unable to retrieve the Worksheet Info for this Order Batch" ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
||||
endif;
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Get the .NET version of the Client Visit object.
|
||||
// Needed to create new ObjectsPlus object
|
||||
//------------------------------------------------------------
|
||||
client_visit_obj := call {{{SINGLE-QUOTE}}}ClientVisit{{{SINGLE-QUOTE}}}.FindByPrimaryKey
|
||||
with ((Active_ClientVisitGUID as number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}}) ;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Check the order entry worksheet. If there are no entries
|
||||
// already on the worksheet set the initial values for
|
||||
// the worksheet.
|
||||
//-----------------------------------------------------------
|
||||
if worksheetInfo.UnsubmittedOrdersCount = 0 then
|
||||
// If there are no orders on the worksheet set
|
||||
// defaults that will be used to create the orders
|
||||
|
||||
WSSessionType := "Standard";
|
||||
WSSessionReason := " ";
|
||||
WSRequestedBySource := "";
|
||||
|
||||
// Set the session type and reason on the worksheet
|
||||
void := call worksheetInfo.SetSessionType with (WSSessionType, WSSessionReason);
|
||||
|
||||
// Set the requesting source string
|
||||
worksheetInfo.RequestedBySource := WSRequestedBySource;
|
||||
|
||||
//Get the current user as the default care provider
|
||||
WSRequestedBy_obj := call {{{SINGLE-QUOTE}}}CareProvider{{{SINGLE-QUOTE}}}.FindById
|
||||
with ( user_IDType, user_IDCode );
|
||||
|
||||
//Set the requesting provider
|
||||
worksheetInfo.RequestedBy := WSRequestedBy_obj;
|
||||
|
||||
// Get the location that will be used for the orders.
|
||||
WSlocation_obj := call {{{SINGLE-QUOTE}}}Location{{{SINGLE-QUOTE}}}.FindByPrimaryKey
|
||||
with ((LocationGuid as number) as {{{SINGLE-QUOTE}}}Int64{{{SINGLE-QUOTE}}});
|
||||
|
||||
//Set the expected release location group
|
||||
worksheetInfo.ExpectedReleaseLocationGroup := WSlocation_obj;
|
||||
|
||||
//Dispose RequestedBy CareProvider
|
||||
if( WSRequestedBy_obj is NOT NULL ) then
|
||||
void := call WSRequestedBy_obj.Dispose;
|
||||
WSRequestedBy_obj:= null;
|
||||
endif;
|
||||
|
||||
//Dispose ExpectedReleaseLocationGroup
|
||||
if( WSlocation_obj is NOT NULL ) then
|
||||
void := call WSlocation_obj.Dispose;
|
||||
WSlocation_obj:= null;
|
||||
endif;
|
||||
|
||||
else
|
||||
//If there are orders on the worksheet retrieve the default values
|
||||
// on the worksheet.
|
||||
// These values are not required for this sample MLM however they
|
||||
// contain useful information that can be used in the logic of an
|
||||
// MLM.
|
||||
WSSessionType := worksheetInfo.SessionType;
|
||||
WSSessionReason := worksheetInfo.SessionReason;
|
||||
WSRequestedBySource := worksheetInfo.RequestedBySource;
|
||||
WSRequestedBy_obj := worksheetInfo.RequestedBy;
|
||||
WSlocation_obj := worksheetInfo.ExpectedReleaseLocationGroup;
|
||||
endif;
|
||||
endtry;
|
||||
|
||||
catch Exception ex
|
||||
error_occurred := true;
|
||||
error_message := "{{+R}}Common Data:{{-R}}\n" || ex.Message || "\n\n";
|
||||
|
||||
if( worksheetInfo is NOT NULL ) then
|
||||
void := call worksheetInfo.Dispose;
|
||||
worksheetInfo:= null;
|
||||
endif;
|
||||
|
||||
if( client_visit_obj is NOT NULL ) then
|
||||
void := call client_visit_obj.Dispose;
|
||||
client_visit_obj:= null;
|
||||
endif;
|
||||
|
||||
if( WSRequestedBy_obj is NOT NULL ) then
|
||||
void := call WSRequestedBy_obj.Dispose;
|
||||
WSRequestedBy_obj:= null;
|
||||
endif;
|
||||
|
||||
if( WSlocation_obj is NOT NULL ) then
|
||||
void := call WSlocation_obj.Dispose;
|
||||
WSlocation_obj:= null;
|
||||
endif;
|
||||
|
||||
// If unable to initialize starting data, do not continue
|
||||
// with the creation of any orders.
|
||||
// Still conclude true as the error message needs to
|
||||
// be displayed as an error.
|
||||
|
||||
endcatch;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Create a new Diagnostic order from a PreFilled item
|
||||
// Place the order onto the order entry worksheet
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
// Added By Shivprasad for CSR# 32710 - Post Throbolytic OS
|
||||
|
||||
|
||||
If (RepeatLabs.value is not null) and ( repeatfreq.value is Not Null ) and (OccTime is not Null) and (starttimeb.value is not Null) then
|
||||
|
||||
if ( StartTimeb.value <> "AM Rounds" ) then
|
||||
|
||||
if repeatfreq.value = "Daily" Then
|
||||
Freq := (24 as number);
|
||||
Elseif repeatfreq.value = "Q2H" Then
|
||||
Freq := (2 as number);
|
||||
Elseif repeatfreq.value = "Q4H" Then
|
||||
Freq := (4 as number);
|
||||
Elseif repeatfreq.value = "Q6H" Then
|
||||
Freq := (6 as number);
|
||||
Elseif repeatfreq.value = "Q8H" Then
|
||||
Freq := (8 as number);
|
||||
Elseif repeatfreq.value = "Q12H" Then
|
||||
Freq := (12 as number);
|
||||
Else
|
||||
Freq := (0 as number);
|
||||
Endif;
|
||||
|
||||
if ( StartOn.Value = "Today" ) then
|
||||
Dat := read first { "SELECT FORMAT(GetDate(), {{{SINGLE-QUOTE}}}yyyy-MM-dd{{{SINGLE-QUOTE}}}) "};
|
||||
elseif ( StartOn.Value = "Tomorrow" ) then
|
||||
Dat := Read First { "Select FORMAT(DateAdd(Day, 1, GetDate()), {{{SINGLE-QUOTE}}}yyyy-MM-dd{{{SINGLE-QUOTE}}}) "} ;
|
||||
endif;
|
||||
|
||||
StartDate1 := Dat ||" " || starttimeb.value ;
|
||||
StartDateNew := Read first {" Select CONVERT(Datetime, {{{SINGLE-QUOTE}}}"|| StartDate1 || "{{{SINGLE-QUOTE}}}, 101)"} ;
|
||||
FinalDate := StartDateNew + ( (( OccTime as Number ) - 1 ) * (Freq As Number ) * (60 as Number ) ) Minutes ;
|
||||
FinalDate:= Read First { " Select FORMAT( Convert(Datetime, {{{SINGLE-QUOTE}}}" || FinalDate || "{{{SINGLE-QUOTE}}}),{{{SINGLE-QUOTE}}}yyyy-MM-dd HH:mm{{{SINGLE-QUOTE}}})"};
|
||||
else
|
||||
//Handling AM Rounds
|
||||
//We force user to select Daily as frequency above; preset variable to 24
|
||||
Freq := (24 as number);
|
||||
|
||||
//Need to check patient{{{SINGLE-QUOTE}}}s current location to determine AM Rounds start time
|
||||
if ( currentLocation matches pattern "ICU%" OR currentLocation matches pattern "CVSU%" ) then
|
||||
startTime := "04:00";
|
||||
startHour := (4 as number);
|
||||
stimebhr := "04";
|
||||
stimebmin := "00";
|
||||
else
|
||||
startTime := "06:00";
|
||||
startHour := (6 as number);
|
||||
stimebhr := "06";
|
||||
stimebmin := "00";
|
||||
endif;
|
||||
|
||||
if ( StartOn.Value = "Today" ) then
|
||||
if ( currentHour >= startHour ) then
|
||||
Dat := read first { " SELECT FORMAT(DateAdd(Day, 1, GetDate()), {{{SINGLE-QUOTE}}}yyyy-MM-dd{{{SINGLE-QUOTE}}}) " };
|
||||
else
|
||||
Dat := read first { " SELECT FORMAT(GETDATE(), {{{SINGLE-QUOTE}}}yyyy-MM-dd{{{SINGLE-QUOTE}}}) " };
|
||||
endif;
|
||||
elseif ( StartOn.Value = "Tomorrow" ) then
|
||||
Dat := read first { " SELECT FORMAT(DateAdd(Day, 1, GetDate()), {{{SINGLE-QUOTE}}}yyyy-MM-dd{{{SINGLE-QUOTE}}}) " };
|
||||
endif;
|
||||
|
||||
StartDate1 := Dat || " " || startTime;
|
||||
StartDateNew := read first { "SELECT CONVERT(DateTime, {{{SINGLE-QUOTE}}}" || StartDate1 || "{{{SINGLE-QUOTE}}}, 101)" };
|
||||
FinalDate := StartDateNew + ( ( (OccTime as number) - 1 ) * ( Freq as number ) * ( 60 as number ) ) Minutes;
|
||||
FinalDate := read first { "SELECT FORMAT(Convert(DateTime, {{{SINGLE-QUOTE}}}" || FinalDate || "{{{SINGLE-QUOTE}}}), {{{SINGLE-QUOTE}}}yyyy-MM-dd HH:mm{{{SINGLE-QUOTE}}})" };
|
||||
|
||||
endif;
|
||||
|
||||
Endif;
|
||||
|
||||
// end Shivprasad
|
||||
|
||||
If placeorder = "yes" then
|
||||
|
||||
linebreakme:= read last {" SELECT {{{SINGLE-QUOTE}}} {{{SINGLE-QUOTE}}} + char(13) + char(10) " };
|
||||
|
||||
lablist := call str_parse with ((repeatlabs.value),";");
|
||||
|
||||
If RepeatLabs.value is not null then
|
||||
// Added By Shivprasad for CSR# 32710 - Post Throbolytic OS
|
||||
OrderAccumBox.value := OrderAccumBox.value || linebreakme || " " || repeatlabs.value || ", Repeat From: " || StartDate1 || " To: " || FinalDate || ", Every " || Freq || " hr(s) " ;
|
||||
|
||||
Numords := count lablist;
|
||||
for k in (1 seqto NumOrds) do
|
||||
ordernamex := lablist [k];
|
||||
ordername := ordernamex;
|
||||
|
||||
ws_call := call CreateRepeatOrder with
|
||||
ordername,
|
||||
modname,
|
||||
vername,
|
||||
worksheetInfo,
|
||||
stimeb1,
|
||||
stimebhr,
|
||||
stimebmin,
|
||||
heparin_iv_found,
|
||||
//Active_OrderGUID,
|
||||
//Active_SignificiantDtm,
|
||||
client_visit_obj;
|
||||
|
||||
enddo;
|
||||
|
||||
RepeatLabs.value := "";
|
||||
StartTimeb.value := Null;
|
||||
StartOn.value := "";
|
||||
RepeatOcc.value := "";
|
||||
RepeatFreq.value := "";
|
||||
StartTimeb.Control_Mandatory := false;
|
||||
StartOn.Control_Mandatory := false;
|
||||
RepeatOcc.Control_Mandatory := false;
|
||||
RepeatFreq.Control_Mandatory := false;
|
||||
|
||||
else
|
||||
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "\n Please choose the test(s) you wish to order and choose submit . " ,"Alert","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}};
|
||||
endif;
|
||||
endif; // End of Place Order = Yes 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;
|
||||
;;
|
||||
Urgency: 50;;
|
||||
end:
|
||||
Reference in New Issue
Block a user