XUTMR ;SEA/RDS - Taskman: Requeue Interface, Part One ;9/8/95 15:49 [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
;;8.0;KERNEL;**2**;Jul 10, 1995
;
INIT ;Setup
D ENV^XUTMUTL
W @IOF
LKUP ;Lookup Task
F %ZTI=0:0 R !!,"Task Number: ",ZTSK:DTIME G Q^XUTMR1:"^"[ZTSK Q:$D(^%ZTSK(ZTSK,0))#2!(ZTSK="??") W:ZTSK'="?" !?10,"This task is not listed in the Task Log." W !,"Please enter the number of an entry in the Task Log that you wish to requeue."
I ZTSK="??" D ^XUTMQ G INIT
L +^%ZTSK(ZTSK):5 E W !!?10,"That file is not currently available. Please try again later." G LKUP
S ZTREC=^%ZTSK(ZTSK,0),ZTREC2=$S($D(^%ZTSK(ZTSK,.2))#2:^(.2),1:"")
I 'ZTKEY,$S($P(ZTREC,U,11)_","_$P(ZTREC,U,12)=XUTMUCI:DUZ'=$P(ZTREC,U,3),1:ZTNAME'=$P(ZTREC,U,10)) W !!?10,"You may only requeue tasks that you originally queued." G LKUP
I $P(ZTREC,U,1,2)="ZTSK^XQ1",$D(^%ZTSK(ZTSK,.3,"XQSCH")) W !!,"This is a scheduled option, Please use the SCHEDULE/UNSCHDULE option." G LKUP
S %ZTDTH=$P(ZTREC,U,6),%ZTDTH(3)=$$H3^%ZTM(%ZTDTH)
;S %ZTIO=""
;F %ZTI=0:0 S %ZTIO=$O(^%ZTSCH("IO",%ZTIO)),%ZTU="" Q:%ZTIO="" F %ZTI=0:0 S %ZTU=$O(^%ZTSCH("IO",%ZTIO,%ZTU)) Q:%ZTU="" I $D(^%ZTSCH("IO",%ZTIO,%ZTU,ZTSK))#2 S %ZTIO(ZTSK)=%ZTIO G TIME
;
TIME ;Ask Requeue Time
W ! D EN^XUTMTP(ZTSK) W !
S %DT="AERSX",%DT("A")="Requeue for what time: ",%DT("B")="NOW"
I $$HDIFF^XLFDT(%ZTDTH,$H,2)>0 S %DT("B")=$$HTE^XLFDT(%ZTDTH)
D ^%DT G NEXT^XUTMR1:Y=-1 S ZTDTH=$$FMTH^XLFDT(Y)
;
DEV ;Ask Requeue Device And Calculate UCI And CPU Destination
S %ZTYND="YES" S:$P(ZTREC2,U)="" %ZTYND="NO"
S DIR("A")="Do you wish to change the Device the task goes to:",DIR("B")="No",DIR(0)="Y"
S DIR("?")="Please enter whether you wish to change output device for this task." D ^DIR
G NEXT^XUTMR1:$D(DIRUT) K ZTIO S ZTCPU=""
I Y'=1 S ZTIO=$P(ZTREC2,U),%=$P(ZTREC2,U,6) S:$L(%) ZTIO("H")=% S:$D(^%ZTSK(ZTSK,.25))#2 ZTIO("P")=^(.25) G CONT
;
D0 S %ZIS("B")=$S($P(ZTREC2,U)]"":$P(ZTREC2,U),1:""),%ZIS="NQZ",%ZIS("A")="Requeue to what device: " D ^%ZIS S ZTIO=$S($D(IOS)[0:"",POP:"",$D(ION)[0:"",ION]"":ION,IOS="":"",$D(^%ZIS(1,IOS,0))[0:"",1:$P(^(0),U))
I ZTIO="" W !!,"No device selected. Task unchanged." G NEXT^XUTMR1
I IOT="VTRM" D HOME^%ZIS W !,"Tasks can not open virtual terminals. Please select another device.",$C(7),! G D0
S ZTIO=ZTIO_$S($D(IOST)[0:"",1:";"_IOST)_$S($D(IO("DOC"))[0:$S($D(IOM)[0:"",1:";"_IOM_$S($D(IOSL)[0:"",1:";"_IOSL)),1:";"_IO("DOC"))_$S($D(IO("P"))[0:"",IO("P")="":"",1:";/"_IO("P")) S:$D(IOCPU)#2 ZTCPU=IOCPU
I $D(IO("HFSIO"))#2,$D(IOPAR)#2,IOT="HFS" S ZTIO("H")=IO("HFSIO"),ZTIO("P")=IOPAR
;
CONT ;Taskman Requeue Interface Is Continued In XUTMR1
G ^XUTMR1
;
XUTMR ;SEA/RDS - Taskman: Requeue Interface, Part One ;9/8/95 15:49 [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
+2 ;;8.0;KERNEL;**2**;Jul 10, 1995
+3 ;
INIT ;Setup
+1 DO ENV^XUTMUTL
+2 WRITE @IOF
LKUP ;Lookup Task
+1 FOR %ZTI=0:0
READ !!,"Task Number: ",ZTSK:DTIME
IF "^"[ZTSK
GOTO Q^XUTMR1
IF $DATA(^%ZTSK(ZTSK,0))#2!(ZTSK="??")
QUIT
IF ZTSK'="?"
WRITE !?10,"This task is not listed in the Task Log."
WRITE !,"Please enter the number of an entry in the Task Log that you wish to requeue."
+2 IF ZTSK="??"
DO ^XUTMQ
GOTO INIT
+3 LOCK +^%ZTSK(ZTSK):5
IF '$TEST
WRITE !!?10,"That file is not currently available. Please try again later."
GOTO LKUP
+4 SET ZTREC=^%ZTSK(ZTSK,0)
SET ZTREC2=$SELECT($DATA(^%ZTSK(ZTSK,.2))#2:^(.2),1:"")
+5 IF 'ZTKEY
IF $SELECT($PIECE(ZTREC,U,11)_","_$PIECE(ZTREC,U,12)=XUTMUCI:DUZ'=$PIECE(ZTREC,U,3),1:ZTNAME'=$PIECE(ZTREC,U,10))
WRITE !!?10,"You may only requeue tasks that you originally queued."
GOTO LKUP
+6 IF $PIECE(ZTREC,U,1,2)="ZTSK^XQ1"
IF $DATA(^%ZTSK(ZTSK,.3,"XQSCH"))
WRITE !!,"This is a scheduled option, Please use the SCHEDULE/UNSCHDULE option."
GOTO LKUP
+7 SET %ZTDTH=$PIECE(ZTREC,U,6)
SET %ZTDTH(3)=$$H3^%ZTM(%ZTDTH)
+8 ;S %ZTIO=""
+9 ;F %ZTI=0:0 S %ZTIO=$O(^%ZTSCH("IO",%ZTIO)),%ZTU="" Q:%ZTIO="" F %ZTI=0:0 S %ZTU=$O(^%ZTSCH("IO",%ZTIO,%ZTU)) Q:%ZTU="" I $D(^%ZTSCH("IO",%ZTIO,%ZTU,ZTSK))#2 S %ZTIO(ZTSK)=%ZTIO G TIME
+10 ;
TIME ;Ask Requeue Time
+1 WRITE !
DO EN^XUTMTP(ZTSK)
WRITE !
+2 SET %DT="AERSX"
SET %DT("A")="Requeue for what time: "
SET %DT("B")="NOW"
+3 IF $$HDIFF^XLFDT(%ZTDTH,$HOROLOG,2)>0
SET %DT("B")=$$HTE^XLFDT(%ZTDTH)
+4 DO ^%DT
IF Y=-1
GOTO NEXT^XUTMR1
SET ZTDTH=$$FMTH^XLFDT(Y)
+5 ;
DEV ;Ask Requeue Device And Calculate UCI And CPU Destination
+1 SET %ZTYND="YES"
IF $PIECE(ZTREC2,U)=""
SET %ZTYND="NO"
+2 SET DIR("A")="Do you wish to change the Device the task goes to:"
SET DIR("B")="No"
SET DIR(0)="Y"
+3 SET DIR("?")="Please enter whether you wish to change output device for this task."
DO ^DIR
+4 IF $DATA(DIRUT)
GOTO NEXT^XUTMR1
KILL ZTIO
SET ZTCPU=""
+5 IF Y'=1
SET ZTIO=$PIECE(ZTREC2,U)
SET %=$PIECE(ZTREC2,U,6)
IF $LENGTH(%)
SET ZTIO("H")=%
IF $DATA(^%ZTSK(ZTSK,.25))#2
SET ZTIO("P")=^(.25)
GOTO CONT
+6 ;
D0 SET %ZIS("B")=$SELECT($PIECE(ZTREC2,U)]"":$PIECE(ZTREC2,U),1:"")
SET %ZIS="NQZ"
SET %ZIS("A")="Requeue to what device: "
DO ^%ZIS
SET ZTIO=$SELECT($DATA(IOS)[0:"",POP:"",$DATA(ION)[0:"",ION]"":ION,IOS="":"",$DATA(^%ZIS(1,IOS,0))[0:"",1:$PIECE(^(0),U))
+1 IF ZTIO=""
WRITE !!,"No device selected. Task unchanged."
GOTO NEXT^XUTMR1
+2 IF IOT="VTRM"
DO HOME^%ZIS
WRITE !,"Tasks can not open virtual terminals. Please select another device.",$CHAR(7),!
GOTO D0
+3 SET ZTIO=ZTIO_$SELECT($DATA(IOST)[0:"",1:";"_IOST)_$SELECT($DATA(IO("DOC"))[0:$SELECT($DATA(IOM)[0:"",1:";"_IOM_$SELECT($DATA(IOSL)[0:"",1:";"_IOSL)),1:";"_IO("DOC"))_$SELECT($DATA(IO("P"))[0:"",IO("P")="":"",1:";/"_IO("P"))
IF $DATA(IOCPU)#2
SET ZTCPU=IOCPU
+4 IF $DATA(IO("HFSIO"))#2
IF $DATA(IOPAR)#2
IF IOT="HFS"
SET ZTIO("H")=IO("HFSIO")
SET ZTIO("P")=IOPAR
+5 ;
CONT ;Taskman Requeue Interface Is Continued In XUTMR1
+1 GOTO ^XUTMR1
+2 ;