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/XUTMQ.m@ 701

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1XUTMQ ;SEA/RDS - TaskMan: Option, XUTMINQ, Show task lists ;07/24/2000 13:23
2 ;;8.0;KERNEL;**20,136,169**;Jul 10, 1995
3 ;
4ENV ;Establish Routine Environment
5 N %,%ZTF,%ZTI,%ZTJ,%ZTL,%ZTR,DDH,DIR,DIRUT,DTOUT,DUOUT,X,Y,ZT,ZT1,ZTENV,ZTKEY,ZTNAME,XUTMUCI
6 D ENV^XUTMUTL Q:'$D(ZTENV)
7 I '+$O(^%ZTSK(0))&'$D(^%ZTSCH("TASK")) W !!,"The Task File is empty, and there are no tasks currently running." S DIR(0)="E" D ^DIR Q
8 ;
9SELECT ;Select listing (main loop)
10 F ZT=0:0 D FLAGS,SET,PROMPT,^DIR Q:$D(DIRUT) K DIR,DIRUT,DTOUT,DUOUT D BRANCH
11 I $D(DTOUT) W "*TIMEOUT*",$C(7)
12 K DIR,DIRUT,DTOUT,DUOUT,X,Y
13 Q
14 ;
15FLAGS ;Reset Taskman Files Status Flags
16 N X,Y
17 W @IOF S ZT1="",%ZTL=0 F S ZT1=$O(^%ZTSCH("LINK",ZT1)) Q:ZT1="" I $O(^%ZTSCH("LINK",ZT1,""))]"" S %ZTL=1 Q
18 S ZT1="",%ZTJ=0 F S ZT1=$O(^%ZTSCH("JOB",ZT1)) Q:ZT1="" I $O(^%ZTSCH("JOB",ZT1,0))]"" S %ZTJ=1 Q
19 S X="",%ZTI=0
20 F S X=$O(^%ZTSCH("IO",X)) Q:X="" I $D(^%ZTSCH("IO",X))>9 S %ZTI=1 Q
21 S %ZTF=+$O(^%ZTSCH(""))!%ZTI!%ZTL!%ZTJ,%ZTR=$D(^%ZTSCH("TASK"))
22 Q
23 ;
24SET ;Create set of choices for user
25 I ZTKEY S DIR(0)="A:All of one user's tasks.;O:One user's future tasks.;"
26 E S DIR(0)="A:All of your tasks.;Y:Your future tasks.;"
27 S DIR(0)="SAOM^"_DIR(0)_"E:Every task.;L:List of tasks.;U:Unsuccessful tasks." S:%ZTF DIR(0)=DIR(0)_";F:Future tasks."
28 S:%ZTI DIR(0)=DIR(0)_";T:Tasks waiting for devices.;W:Waiting list for a device." S:%ZTR DIR(0)=DIR(0)_";R:Running tasks."
29 S:%ZTL DIR(0)=DIR(0)_";C:Cross-cpu waiting lists."
30 Q
31 ;
32PROMPT ;Create prompt and help text
33 S DIR("A",1)=" List Tasks Option"
34 S DIR("A",2)=""
35 S DIR("A",3)=" All of one user's tasks."
36 S DIR("A",4)=" One user's future tasks."
37 S:'ZTKEY DIR("A",3)=" All your tasks."
38 S:'ZTKEY DIR("A",4)=" Your future tasks."
39 S DIR("A",5)=" Every task."
40 S DIR("A",6)=" List of tasks."
41 S DIR("A",7)=" Unsuccessful tasks."
42 S:%ZTF DIR("A",8)=" Future tasks."
43 S:%ZTI DIR("A",9)=" Tasks waiting for devices."
44 S:%ZTI DIR("A",10)=" Waiting list for a device."
45 S X=$S(%ZTI:11,%ZTF:9,1:8)
46 S:%ZTR DIR("A",X)=" Running tasks.",X=X+1
47 S:%ZTL DIR("A",X)=" Cross-cpu waiting lists.",X=X+1
48 S DIR("A",X)="",DIR("A")=" Select Type Of Listing: "
49 S DIR("?")="^D HELP^XUTMQH"
50 Q
51 ;
52BRANCH ;DO selected listing
53 N ZT
54 D @$S(Y="A":"ALL^XUTMQ0",Y="O"!(Y="Y"):"FUT^XUTMQ0",Y="E":"EVERY^XUTMQ1",Y="L":"LIST^XUTMQ1",Y="U":"NOT^XUTMQ1",Y="C":"LINK^XUTMQ2",Y="R":"RUN^XUTMQ2",Y="F":"FUT^XUTMQ2",Y="T":"IOQ^XUTMQ3",1:"IO1^XUTMQ3")
55 Q
56LIST ;Print a list of tasks in ^TMP($J,n,m).
57 N XUTMT,XU1,XU2,IOCRT,XUDD,XUTSK,PG
58 D LSTPRE,HDR S XU1=0
59 F S XU1=$O(^TMP($J,XU1)),XU2=0 Q:XU1'>0 F S XU2=$O(^TMP($J,XU1,XU2)) Q:XU2'>0 D I $D(DIRUT) S (XU1,XU2)="A"
60 . I $Y+5'<IOSL D HDR Q:$D(DIRUT)
61 . W !,"-------------------------------------------------------------------------------"
62 . D EN^XUTMTP(XU2)
63 . Q
64 D:'$D(DIRUT)&IOCRT WAIT
65 Q
66LSTPRE ;
67 S IOCRT=$E(IOST,1,2)["C-",XUDD=$$HTE^XLFDT($H,"1MP"),PG=0
68 Q
69HDR I PG>0,IOCRT D WAIT Q:$D(DIRUT)
70 I (PG>0)!(IOCRT) W @IOF
71 S PG=PG+1
72 W "Task list ",XUDD,?70,"Page ",PG
73 Q
74WAIT S DIR(0)="E" D ^DIR
75 Q
Note: See TracBrowser for help on using the repository browser.