XUTMTL ;SEA/RDS - TaskMan: ToolKit, Lookup ;11/18/94 10:27
;;8.0;KERNEL;;Jul 10, 1995
;
TASK ;Lookup Task File Data
S ZTSK=XUTMT L +^%ZTSK(ZTSK) I '$D(^%ZTSK(ZTSK)) K XUTMT L -^%ZTSK(ZTSK) S ZTSK="" Q
S ZTSK(0)=$S($D(^%ZTSK(ZTSK,0))#2:^(0),1:""),ZTSK(.1)=$S($D(^(.1))#2:^(.1),1:""),ZTSK(.2)=$S($D(^(.2))#2:^(.2),1:"")
N ZT,ZT1,ZT2,ZT3
;
SCHED ;Lookup Task In Schedule File
S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH(ZT1)) Q:'ZT1 I $D(^%ZTSCH(ZT1,ZTSK))#2 S ZTSK("A",ZT1,ZTSK)="",ZT2=^(ZTSK) I ZT2]"" S $P(ZTSK(.2),U)=ZT2
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)) Q:ZT2="" S:$D(^(ZT2,ZTSK))#2 ZTSK("IO",ZT1,ZT2,ZTSK)=""
S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH("JOB",ZT1)) Q:ZT1="" S:$D(^(ZT1,ZTSK))#2 ZTSK("JOB",ZT1,ZTSK)=""
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)) Q:ZT2="" S:$D(^(ZT2,ZTSK))#2 ZTSK("LINK",ZT1,ZT2,ZTSK)=""
S:$D(^%ZTSCH("TASK",ZTSK))#2 ZTSK("TASK",ZTSK)=^(ZTSK) K XUTMT
;
EXIT L -^%ZTSK(ZTSK)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXUTMTL 1062 printed Dec 13, 2024@02:13:48 Page 2
XUTMTL ;SEA/RDS - TaskMan: ToolKit, Lookup ;11/18/94 10:27
+1 ;;8.0;KERNEL;;Jul 10, 1995
+2 ;
TASK ;Lookup Task File Data
+1 SET ZTSK=XUTMT
LOCK +^%ZTSK(ZTSK)
IF '$DATA(^%ZTSK(ZTSK))
KILL XUTMT
LOCK -^%ZTSK(ZTSK)
SET ZTSK=""
QUIT
+2 SET ZTSK(0)=$SELECT($DATA(^%ZTSK(ZTSK,0))#2:^(0),1:"")
SET ZTSK(.1)=$SELECT($DATA(^(.1))#2:^(.1),1:"")
SET ZTSK(.2)=$SELECT($DATA(^(.2))#2:^(.2),1:"")
+3 NEW ZT,ZT1,ZT2,ZT3
+4 ;
SCHED ;Lookup Task In Schedule File
+1 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^%ZTSCH(ZT1))
if 'ZT1
QUIT
IF $DATA(^%ZTSCH(ZT1,ZTSK))#2
SET ZTSK("A",ZT1,ZTSK)=""
SET ZT2=^(ZTSK)
IF ZT2]""
SET $PIECE(ZTSK(.2),U)=ZT2
+2 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))
if ZT2=""
QUIT
if $DATA(^(ZT2,ZTSK))#2
SET ZTSK("IO",ZT1,ZT2,ZTSK)=""
+3 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^%ZTSCH("JOB",ZT1))
if ZT1=""
QUIT
if $DATA(^(ZT1,ZTSK))#2
SET ZTSK("JOB",ZT1,ZTSK)=""
+4 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))
if ZT2=""
QUIT
if $DATA(^(ZT2,ZTSK))#2
SET ZTSK("LINK",ZT1,ZT2,ZTSK)=""
+5 if $DATA(^%ZTSCH("TASK",ZTSK))#2
SET ZTSK("TASK",ZTSK)=^(ZTSK)
KILL XUTMT
+6 ;
EXIT LOCK -^%ZTSK(ZTSK)
+1 QUIT