XUTMTLU ;SEA/RDS - TaskMan: ToolKit, Lookup For Unschedule ;11/18/94 10:38 [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
;;8.0;KERNEL;;Jul 10, 1995
;
SCHED ;Lookup Tasks In Schedule File
N ZT,ZT1,ZT2,ZT3,ZT4,ZT5,ZT6,ZTS K ^TMP($J,"XUTMTLU"),ZTSK S ZTSK=0
S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH(ZT1)),ZT2="" Q:'ZT1 F ZT=0:0 S ZT2=$O(^%ZTSCH(ZT1,ZT2)) Q:ZT2="" S ZTS=ZT2 D COUNT
S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH("IO",ZT1)),ZT2="" Q:ZT1="" F ZT=0:0 S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)),ZT3="" Q:ZT2="" F ZT=0:0 S ZT3=$O(^%ZTSCH("IO",ZT1,ZT2,ZT3)) Q:ZT3="" S ZTS=ZT3 D COUNT
S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH("JOB",ZT1)),ZT2="" Q:ZT1="" F ZT=0:0 S ZT2=$O(^%ZTSCH("JOB",ZT1,ZT2)) Q:ZT2="" S ZTS=ZT2 D COUNT
S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH("LINK",ZT1)),ZT2="" Q:ZT1="" F ZT=0:0 S ZT2=$O(^%ZTSCH("LINK",ZT1,ZT2)),ZT3="" Q:ZT2="" F ZT=0:0 S ZT3=$O(^%ZTSCH("LINK",ZT1,ZT2,ZT3)) Q:ZT3="" S ZTS=ZT3 D COUNT
K ^TMP($J,"XUTMTLU") Q
;
COUNT ;Add Either One Or Zero To The Count Of Scheduled Tasks In List
;
C2 ;First Screen By Whether Task Has Already Been Counted
I $D(^TMP($J,"XUTMTLU",ZTS))#2 Q
;
C5 ;Then Screen by Whether Task Is Within Range
I '$D(^TMP($J,"XUTMT",ZTS)) S ZT5=$O(^TMP($J,"XUTMT",ZTS)) Q:ZT5="" S ZT6=$O(^(ZT5,"")) Q:ZT6>ZTS!'ZT6
;
C8 ;Finally Screen By Whether User Has Authority To Select Task
N X
I 'ZTKEY S X=$G(^%ZTSK(ZTS)) I $S(X="":1,$P(X,U,11)_","_$P(X,U,12)=XUTMUCI:DUZ'=$P(X,U,3),1:ZTNAME'=$P(X,U,10)) Q
;
C12 ;Count Tasks Not Screened Out
S ^TMP($J,"XUTMTLU",ZTS)="",ZTSK=ZTSK+1 Q
;
XUTMTLU ;SEA/RDS - TaskMan: ToolKit, Lookup For Unschedule ;11/18/94 10:38 [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
+2 ;;8.0;KERNEL;;Jul 10, 1995
+3 ;
SCHED ;Lookup Tasks In Schedule File
+1 NEW ZT,ZT1,ZT2,ZT3,ZT4,ZT5,ZT6,ZTS
KILL ^TMP($JOB,"XUTMTLU"),ZTSK
SET ZTSK=0
+2 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^%ZTSCH(ZT1))
SET ZT2=""
IF 'ZT1
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^%ZTSCH(ZT1,ZT2))
IF ZT2=""
QUIT
SET ZTS=ZT2
DO COUNT
+3 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^%ZTSCH("IO",ZT1))
SET ZT2=""
IF ZT1=""
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^%ZTSCH("IO",ZT1,ZT2))
SET ZT3=""
IF ZT2=""
QUIT
FOR ZT=0:0
SET ZT3=$ORDER(^%ZTSCH("IO",ZT1,ZT2,ZT3))
IF ZT3=""
QUIT
SET ZTS=ZT3
DO COUNT
+4 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^%ZTSCH("JOB",ZT1))
SET ZT2=""
IF ZT1=""
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^%ZTSCH("JOB",ZT1,ZT2))
IF ZT2=""
QUIT
SET ZTS=ZT2
DO COUNT
+5 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^%ZTSCH("LINK",ZT1))
SET ZT2=""
IF ZT1=""
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^%ZTSCH("LINK",ZT1,ZT2))
SET ZT3=""
IF ZT2=""
QUIT
FOR ZT=0:0
SET ZT3=$ORDER(^%ZTSCH("LINK",ZT1,ZT2,ZT3))
IF ZT3=""
QUIT
SET ZTS=ZT3
DO COUNT
+6 KILL ^TMP($JOB,"XUTMTLU")
QUIT
+7 ;
COUNT ;Add Either One Or Zero To The Count Of Scheduled Tasks In List
+1 ;
C2 ;First Screen By Whether Task Has Already Been Counted
+1 IF $DATA(^TMP($JOB,"XUTMTLU",ZTS))#2
QUIT
+2 ;
C5 ;Then Screen by Whether Task Is Within Range
+1 IF '$DATA(^TMP($JOB,"XUTMT",ZTS))
SET ZT5=$ORDER(^TMP($JOB,"XUTMT",ZTS))
IF ZT5=""
QUIT
SET ZT6=$ORDER(^(ZT5,""))
IF ZT6>ZTS!'ZT6
QUIT
+2 ;
C8 ;Finally Screen By Whether User Has Authority To Select Task
+1 NEW X
+2 IF 'ZTKEY
SET X=$GET(^%ZTSK(ZTS))
IF $SELECT(X="":1,$PIECE(X,U,11)_","_$PIECE(X,U,12)=XUTMUCI:DUZ'=$PIECE(X,U,3),1:ZTNAME'=$PIECE(X,U,10))
QUIT
+3 ;
C12 ;Count Tasks Not Screened Out
+1 SET ^TMP($JOB,"XUTMTLU",ZTS)=""
SET ZTSK=ZTSK+1
QUIT
+2 ;