- XUTMTD ;SEA/RDS - TaskMan: ToolKit, Delete ;12/30/94 11:17 [ 04/02/2003 8:29 AM ]
- ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
- ;;8.0;KERNEL;;Jul 10, 1995
- ;Call with XUTMT as task number
- L +^%ZTSK(XUTMT)
- N ZTSK S ZTSK=XUTMT D UNSCH^%ZTLOAD6
- D DELETE
- L -^%ZTSK(XUTMT)
- Q
- ;
- DELETE ;Delete Task
- K:'$D(^%ZTSCH("TASK",XUTMT)) ^%ZTSK(XUTMT)
- Q
- ;
- UNSCHED ;Replased by call to UNSCH^%ZTLOAD6
- N ZT,ZT1,ZT2,ZT3
- S ZT1=0 F S ZT1=$O(^%ZTSCH(ZT1)) Q:'ZT1 I $D(^(ZT1,XUTMT))#2 D
- . L +^%ZTSCH(ZT1,XUTMT) K ^(XUTMT) L -^%ZTSCH(ZT1,XUTMT)
- L +^%ZTSCH("IO")
- S ZT1="" F S ZT1=$O(^%ZTSCH("IO",ZT1)),ZT2="" Q:ZT1="" F S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)) Q:ZT2="" D DQIO:$D(^(ZT2,XUTMT))#2
- L -^%ZTSCH("IO"),+^%ZTSCH("JOB")
- S ZT1="" F S ZT1=$O(^%ZTSCH("JOB",ZT1)) Q:ZT1="" I $D(^(ZT1,XUTMT))#2 K ^(XUTMT)
- L -^%ZTSCH("JOB"),+^%ZTSCH("LINK")
- S ZT1="" F S ZT1=$O(^%ZTSCH("LINK",ZT1)),ZT2="" Q:ZT1="" F S ZT2=$O(^%ZTSCH("LINK",ZT1,ZT2)) Q:ZT2="" I $D(^(ZT2,XUTMT))#2 K ^(XUTMT)
- L -^%ZTSCH("LINK"),+^%ZTSCH("C")
- S ZT1="" F S ZT1=$O(^%ZTSCH("C",ZT1)),ZT2="" Q:ZT1="" F S ZT2=$O(^%ZTSCH("C",ZT1,ZT2)) Q:ZT2="" I $D(^(ZT2,XUTMT))#2 K ^(XUTMT)
- L -^%ZTSCH("C")
- Q
- ;
- DQIO ;Remove A Device Waiting List Entry
- N %ZTIO,ZTDTH,ZTSK S %ZTIO=ZT1,ZTDTH=ZT2,ZTSK=XUTMT
- D DQ^%ZTM4 Q
- ;
- XUTMTD ;SEA/RDS - TaskMan: ToolKit, Delete ;12/30/94 11:17 [ 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 ;Call with XUTMT as task number
- +4 LOCK +^%ZTSK(XUTMT)
- +5 NEW ZTSK
- SET ZTSK=XUTMT
- DO UNSCH^%ZTLOAD6
- +6 DO DELETE
- +7 LOCK -^%ZTSK(XUTMT)
- +8 QUIT
- +9 ;
- DELETE ;Delete Task
- +1 IF '$DATA(^%ZTSCH("TASK",XUTMT))
- KILL ^%ZTSK(XUTMT)
- +2 QUIT
- +3 ;
- UNSCHED ;Replased by call to UNSCH^%ZTLOAD6
- +1 NEW ZT,ZT1,ZT2,ZT3
- +2 SET ZT1=0
- FOR
- SET ZT1=$ORDER(^%ZTSCH(ZT1))
- IF 'ZT1
- QUIT
- IF $DATA(^(ZT1,XUTMT))#2
- Begin DoDot:1
- +3 LOCK +^%ZTSCH(ZT1,XUTMT)
- KILL ^(XUTMT)
- LOCK -^%ZTSCH(ZT1,XUTMT)
- End DoDot:1
- +4 LOCK +^%ZTSCH("IO")
- +5 SET ZT1=""
- FOR
- SET ZT1=$ORDER(^%ZTSCH("IO",ZT1))
- SET ZT2=""
- IF ZT1=""
- QUIT
- FOR
- SET ZT2=$ORDER(^%ZTSCH("IO",ZT1,ZT2))
- IF ZT2=""
- QUIT
- IF $DATA(^(ZT2,XUTMT))#2
- DO DQIO
- +6 LOCK -^%ZTSCH("IO"),+^%ZTSCH("JOB")
- +7 SET ZT1=""
- FOR
- SET ZT1=$ORDER(^%ZTSCH("JOB",ZT1))
- IF ZT1=""
- QUIT
- IF $DATA(^(ZT1,XUTMT))#2
- KILL ^(XUTMT)
- +8 LOCK -^%ZTSCH("JOB"),+^%ZTSCH("LINK")
- +9 SET ZT1=""
- FOR
- SET ZT1=$ORDER(^%ZTSCH("LINK",ZT1))
- SET ZT2=""
- IF ZT1=""
- QUIT
- FOR
- SET ZT2=$ORDER(^%ZTSCH("LINK",ZT1,ZT2))
- IF ZT2=""
- QUIT
- IF $DATA(^(ZT2,XUTMT))#2
- KILL ^(XUTMT)
- +10 LOCK -^%ZTSCH("LINK"),+^%ZTSCH("C")
- +11 SET ZT1=""
- FOR
- SET ZT1=$ORDER(^%ZTSCH("C",ZT1))
- SET ZT2=""
- IF ZT1=""
- QUIT
- FOR
- SET ZT2=$ORDER(^%ZTSCH("C",ZT1,ZT2))
- IF ZT2=""
- QUIT
- IF $DATA(^(ZT2,XUTMT))#2
- KILL ^(XUTMT)
- +12 LOCK -^%ZTSCH("C")
- +13 QUIT
- +14 ;
- DQIO ;Remove A Device Waiting List Entry
- +1 NEW %ZTIO,ZTDTH,ZTSK
- SET %ZTIO=ZT1
- SET ZTDTH=ZT2
- SET ZTSK=XUTMT
- +2 DO DQ^%ZTM4
- QUIT
- +3 ;