source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUTMTDL.m@ 1800

Last change on this file since 1800 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1XUTMTDL ;SEA/RDS - TaskMan: ToolKit, Delete List ;7/21/95 08:38
2 ;;8.0;KERNEL;**1**;Jul 05, 1995
3 ;
4SCHED ;Lookup Tasks In Schedule File
5 N ZT,ZT1,ZT2,ZT3,ZT4,ZT5,ZT6,ZTF,ZTS S ZTSK=0 K ^TMP($J,"XUTMTDL")
6 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 SCREEN I ZTF D DQSCHED,DELETE
7 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 SCREEN I ZTF D DQIO,DELETE
8 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 SCREEN I ZTF D DQJOB,DELETE
9 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 SCREEN I ZTF D DQLINK,DELETE
10 ;
11TASK ;delete unscheduled tasks in Task file
12 S ZT1="" F ZT=0:0 S ZT1=$O(^TMP($J,"XUTMT",ZT1)) Q:ZT1="" D RANGE:$D(^(ZT1))=10 I $D(^TMP($J,"XUTMT",ZT1))=1,$D(^%ZTSK(ZT1)) S ZTS=ZT1 D SCREEN I ZTF D DELETE
13 K ^TMP($J,"XUTMTDL") Q
14 ;
15RANGE ;TASK--process a range
16 S ZT3=ZT1,(ZT2,ZTS)=$O(^TMP($J,"XUTMT",ZT1,""))
17 I $D(^%ZTSK(ZTS)) D SCREEN I ZTF D DELETE
18 F ZT=0:0 S ZTS=$O(^%ZTSK(ZTS)) Q:ZTS>ZT3!'ZTS D SCREEN I ZTF D DELETE
19 Q
20 ;
21SCREEN ;Screen Tasks For Selection & User Authority To Select
22 L +^%ZTSK(ZTS)
23 S ZTF=0 I '$D(^TMP($J,"XUTMT",ZTS)) S ZT5=$O(^TMP($J,"XUTMT",ZTS)) G SCRX:ZT5="" S ZT6=$O(^(ZT5,"")) G SCRX:ZT6>ZTS!'ZT6
24 I 'ZTKEY I $S($D(^%ZTSK(ZTS,0))[0:1,$P(^%ZTSK(ZTS,0),U,11)_","_$P(^(0),U,12)=XUTMUCI:DUZ'=$P(^(0),U,3),1:ZTNAME'=$P(^(0),U,10)) G SCRX
25 S ZTF=1
26SCRX L -^%ZTSK(ZTS) Q
27 ;
28DQSCHED ;Dequeue A Schedule List Entry
29 L +^%ZTSCH(ZT1,ZT2) K ^%ZTSCH(ZT1,ZT2) L -^%ZTSCH(ZT1,ZT2) Q
30 ;
31DQIO ;Dequeue A Device Waiting List
32 N %ZTIO,ZTDTH,ZTSK S %ZTIO=ZT1,ZTDTH=ZT2,ZTSK=ZT3 L +^%ZTSK(ZTSK),+^%ZTSCH("IO") D DQ^%ZTM4 L -^%ZTSCH("IO"),-^%ZTSK(ZTSK) Q
33 ;
34DQJOB ;Dequeue A Submanager Waiting List Entry
35 L +^%ZTSK(ZT2),+^%ZTSCH("JOB",ZT1,ZT2) K ^%ZTSCH("JOB",ZT1,ZT2) L -^%ZTSCH("JOB"),-^%ZTSK(ZT2) Q
36 ;
37DQLINK ;Dequeue A Link Waiting List Entry
38 L +^%ZTSCH("LINK") K ^%ZTSCH("LINK",ZT1,ZT2,ZT3) L -^%ZTSCH("LINK") Q
39 ;
40DELETE ;Delete Unscreened Tasks That Are Not Currently Running
41 L +^%ZTSK(ZTS) I '$D(^%ZTSCH("TASK",ZTS)) K ^%ZTSK(ZTS) I '$D(^TMP($J,"XUTMTDL",ZTS)) S ^(ZTS)="",ZTSK=ZTSK+1
42 L -^%ZTSK(ZTS) Q
43 ;
Note: See TracBrowser for help on using the repository browser.