source: FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUTMUSE.m@ 628

Last change on this file since 628 was 628, checked in by George Lilly, 14 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1XUTMUSE ;SEA/RDS - TaskMan: Option, XUTMUSER, Part 1 (Driver) ;11/30/94 11:43
2 ;;8.0;KERNEL;;Jul 10, 1995
3 ;
4ENV ;Establish Routine Environment
5 N DIR,XUTMT,ZTKEY,ZTNAME,ZTENV,ZTF,ZTUCI,ZTSK K DTOUT,DIRUT
6 D ENV^XUTMUTL Q:'$D(ZTENV)
7 S XUTMT(0)="A"_$E("U",'ZTKEY),XUTMT("?")="^D HELP1^XUTMUSE",XUTMT("??")="^D HELP2^XUTMUSE" D ^XUTMT Q:ZTSK=""
8 ;
9SELECT ;Prompt User For Action
10 S DIR(0)="SAOM^D:Display status.;ST:Stop task.;E:Edit task.;P:Print task.;L:List own tasks.;SE:Select another task.",DIR("?")="^D HELP1^XUTMUSE3",DIR("??")="^D HELP2^XUTMUSE3"
11 S DIR("A",1)="",DIR("A",2)=" Taskman User Option",DIR("A",3)="",DIR("A",4)=" Display status.",DIR("A",5)=" Stop task.",DIR("A",6)=" Edit task."
12 S DIR("A",7)=" Print task.",DIR("A",8)=" List own tasks.",DIR("A",9)=" Select another task.",DIR("A",10)="",DIR("A")=" Select Action (Task # "_ZTSK_"): "
13 D ^DIR Q:$D(DIRUT) D ACT I ZTSK="" K ^TMP($J) Q
14 G SELECT
15 ;
16ACT ;SELECT Subroutine--Act On User's Selection
17 N DIR,DIRUT,DTOUT,DUOUT,XUTMT
18 I Y="D" W ! D EN^XUTMTP(ZTSK,"",1) Q
19 I Y="ST" W ! S XUTMT=ZTSK,XUTMT(0)="R2" D ^XUTMT Q
20 I Y="E" S XUTMT=ZTSK D ^XUTMUSE2 Q
21 I Y="P" D ^XUTMUSE1 Q
22 I Y="L" D HELP2 Q
23 W ! S XUTMT(0)="A"_$E("U",'ZTKEY),XUTMT("B")=ZTSK,XUTMT("?")="^D HELP3^XUTMUSE",XUTMT("??")="^D HELP2^XUTMUSE" D ^XUTMT Q
24 Q
25 ;
26HELP1 ;ENV Subroutine--Help Message For Initial Task Selection For "?"
27 W !!,"This option will allow you to look at and manipulate your queued jobs, and is",!?5,"only useful for you when you have such jobs to work with."
28 W !!,"You must begin this option by entering the task number of the queued job that",!?5,"you want to work with first."
29 W !!,"If you don't know the task number of any of your queued jobs then enter",!?5,"two question marks ('??') and you will be shown all of your queued jobs",!?5,"on this computer."
30 W " The task number of each task is the number listed on the",!?5,"first line of the display, before the colon (':')."
31 W !!,"After you pick a task to work with, you will be shown a list of the things",!?5,"you can do with that task, and will be asked to pick one.",!
32 Q
33 ;
34HELP2 ;Subroutine--Help Message For Initial Task Selection For "??"
35 N %ZTI,DTOUT,DUOUT,X,Y,ZT,ZTD1,ZTD2,ZTDTH,XUTMT,ZTOUT,ZTREC,ZTS,ZTSK
36 K ^TMP($J)
37 W @IOF,"Please wait while I find your tasks...searching..."
38 S %ZTI=0,ZTOUT=0
39H1 S ZTS=0 F S ZTS=$O(^%ZTSK(ZTS)) Q:'ZTS D
40 . S ZTREC=$G(^%ZTSK(ZTS,0)) Q:ZTREC=""
41 . I $P(ZTREC,U,3)'=DUZ Q
42 . I $P(ZTREC,U,10)]"",$P(ZTREC,U,10)'=ZTNAME Q
43 . S ZTDTH=$$H3^%ZTM($P(ZTREC,U,6))
44 . D SORT
45 . Q
46H2 S ZTS=0,ZTDTH=$$H3^%ZTM($H)
47 F S ZTS=$O(^%ZTSCH("TASK",ZTS)) Q:'ZTS D
48 . I $D(^%ZTSK(ZTS,0))#2 Q
49 . S ZTREC=$G(^%ZTSCH("TASK",ZTS)) Q:ZTREC=""
50 . I $P(ZTREC,U,9)'=DUZ,$P(ZTREC,U,9)'=ZTNAME Q
51 . D SORT
52 . Q
53H3 W "finished!",!
54 I '%ZTI W !,"There are no tasks listed that were queued by you.",!
55 E S ZTD1="0",%ZTI=0 F S ZTD1=$O(^TMP($J,ZTD1)) Q:ZTD1'>0 D I ZTOUT Q
56 . S ZTS=0
57 . F S ZTS=$O(^TMP($J,ZTD1,ZTS)) Q:'ZTS D HPRINT I ZTOUT Q
58 I 'ZTOUT D EOL W !
59 ;K ^TMP($J)
60 Q
61 ;
62HPRINT ;HELP2 Subroutine--Print A Task
63 N XUTMT,ZTSK
64 S %ZTI=%ZTI+1,^TMP($J,0,%ZTI)=ZTS
65 S ZTF=0 D EN^XUTMTP(ZTS,%ZTI)
66 W !,"-------------------------------------------------------------------------------"
67 I $Y>18 S ZTF=1 D EOP S ZTOUT=$D(DTOUT)!$D(DUOUT) Q:ZTOUT W @IOF
68 Q
69 ;
70SORT ;HELP2--sort tasks by start time, in reverse order
71 ;input: start time, task number
72 ;output: new cross reference in ^TMP($J)
73 S %ZTI=%ZTI+1
74 S ^TMP($J,ZTDTH,ZTS)=%ZTI
75 Q
76 ;
77HELP3 ;ACT Subroutine--Help Message For Task Reselection For "?"
78 W !!,"Enter the task number of the queued job you want to work with."
79 W !!,"Enter '??' to see the list of tasks you can choose from.",! Q
80 ;
81EOP ;Simulate DIR(0)="E" Call To DIR (For Use Within DIR calls)
82 S Y="" F ZT=0:0 R !,"Press RETURN to continue or '^' to exit: ",Y:$S($D(DTIME)#2:DTIME,1:60) S:'$T DTOUT="" S:Y="^" DUOUT="" Q:Y=""!(Y="^") W !!,"Enter either RETURN or '^'",! W:Y'["?" $C(7)
83 Q
84 ;
85EOL ;Simulate DIR(0)="E" call to DIR for end of listings
86 S Y="" F ZT=0:0 R !,"End of listing. Press RETURN to continue: ",Y:$S($D(DTIME)#2:DTIME,1:60) S:'$T DTOUT="" S:Y="^" DUOUT="" Q:Y=""!(Y="^") W !!,"Enter either RETURN or '^'",! W:Y'["?" $C(7)
87 Q
88 ;
Note: See TracBrowser for help on using the repository browser.