78 lines
1.9 KiB
Plaintext
78 lines
1.9 KiB
Plaintext
maintenance:
|
|
|
|
title: Check for overdue requested time;;
|
|
mlmname: overdue_req_time;;
|
|
arden: version 2;;
|
|
version: 4.50;;
|
|
institution: St. Clair Hospital;;
|
|
author: Eclipsys Corporation;;
|
|
specialist: Eclipsys Corporation;;
|
|
date: 2006-10-17;;
|
|
validation: testing;;
|
|
|
|
library:
|
|
purpose:
|
|
Based on the time specified in a specified field (argument), this will compare it
|
|
to the present time to see if it is passed. If a coded time is requested, this
|
|
looks up the high limit on the coded time, before comparing it to the present time.
|
|
;;
|
|
explanation:
|
|
;;
|
|
keywords:
|
|
;;
|
|
knowledge:
|
|
type: data-driven;;
|
|
data:
|
|
( time_value,
|
|
time_type
|
|
) := ARGUMENT;
|
|
|
|
// initialize return var:
|
|
rtn_var := FALSE;
|
|
|
|
// Get current time and convert to HHMM:
|
|
curr_hr := extract hour now;
|
|
curr_mn := extract minute now;
|
|
curr_time := curr_hr || curr_mn;
|
|
|
|
if called_by_editor then
|
|
time_value := "11:22";
|
|
time_type := "scheduled";
|
|
endif;
|
|
|
|
if time_type = "coded" then
|
|
// lookup configured start and end times
|
|
(cfg_name, t_limit, cfg_priority, curr_time_2) := read last
|
|
{" select name, endtime, prioritycode, "
|
|
||" convert(varchar(2),datepart(hh,getdate())) "
|
|
||" + convert(varchar(2),datepart(mm,getdate())) "
|
|
||" from cv3codedtime "
|
|
||" where name = " || sql(time_value)
|
|
||" and active = 1 " };
|
|
|
|
elseif time_type = "scheduled" then
|
|
// remove the {{{SINGLE-QUOTE}}}:{{{SINGLE-QUOTE}}} from the hh:mm
|
|
(t_limit, curr_time_2) := read last
|
|
{" select stuff(" || sql (time_value) || ", patindex({{{SINGLE-QUOTE}}}%:%{{{SINGLE-QUOTE}}},"
|
|
|| sql (time_value) || " ),1,null), "
|
|
||" convert(varchar(2),datepart(hh,getdate())) "
|
|
||" + convert(varchar(2),datepart(mm,getdate())) "};
|
|
endif;
|
|
;;
|
|
evoke: /* Call MLM */
|
|
;;
|
|
logic:
|
|
|
|
if (curr_time as number) > (t_limit as number) then // delivery time has passed
|
|
rtn_val := TRUE;
|
|
endif;
|
|
|
|
conclude true;
|
|
;;
|
|
action:
|
|
|
|
return rtn_val ;
|
|
;;
|
|
Urgency: 50;;
|
|
end:
|