LEXRXXT3 ;ISL/KER - Repair/Re-Index - Task (cont) ;04/21/2014
;;2.0;LEXICON UTILITY;**81,80**;Sep 23, 1996;Build 10
;
; Global Variables
; ^XTMP("LEXRX") SACC 2.3.2.5.2
;
; External References
; $$S^%ZTLOAD ICR 10063
; $$DT^XLFDT ICR 10103
; $$FMADD^XLFDT ICR 10103
; $$NOW^XLFDT ICR 10103
;
; Local Variables NEWed or KILLed Elsewhere
; LEXQ Quiet flag NEWed/KILLed by LEXRXXT2
; ZTQUEUED Task flag NEWed/KILLed by Taskman
; ZTSK Task Number NEWed/KILLed by Taskman
;
Q
UPD(X,LEXDES,LEXUPD) ; Update Task ^XTMP and ^%ZTSK
Q:$D(LEXQ) 0 N LEXNAM,LEXCRE,LEXPRG,LEXTC S LEXTC=0
S LEXNAM=$G(X),LEXDES=$G(LEXDES),LEXUPD=$G(LEXUPD)
S LEXCRE=$$DT^XLFDT,LEXPRG=$$FMADD^XLFDT(LEXCRE,1)
I $L(LEXNAM),'$L(LEXDES),'$L(LEXUPD) K ^XTMP(LEXNAM) Q 0
I $L(LEXNAM) I '$D(^XTMP(LEXNAM,0)) D
. S ^XTMP(LEXNAM,0)=LEXPRG_"^"_LEXCRE I $L(LEXDES) D
. . S $P(^XTMP(LEXNAM,0),"^",3)=$$NOW^XLFDT
. . S $P(^XTMP(LEXNAM,0),"^",4)=LEXDES
. S:+($G(ZTSK))>0 ^XTMP(LEXNAM,1)=+($G(ZTSK))
I $L(LEXNAM),$L(LEXUPD) I $D(^XTMP(LEXNAM,0)) D
. S ^XTMP(LEXNAM,2)=$$NOW^XLFDT_"^"_LEXUPD
I $D(ZTQUEUED) D
. S:$L(LEXDES)&('$L(LEXUPD)) LEXTC=$$S^%ZTLOAD(LEXDES)
. S:$L(LEXUPD) LEXTC=$$S^%ZTLOAD(LEXUPD)
. S:+($G(ZTSK))>0&($L(LEXNAM)) ^XTMP(LEXNAM,1)=+($G(ZTSK))
S X=LEXTC
Q X
;
; Miscellaneous
CLR ; Clear
K LEXQ,ZTQUEUED,ZTSK
Q
LEXRXXT3 ;ISL/KER - Repair/Re-Index - Task (cont) ;04/21/2014
+1 ;;2.0;LEXICON UTILITY;**81,80**;Sep 23, 1996;Build 10
+2 ;
+3 ; Global Variables
+4 ; ^XTMP("LEXRX") SACC 2.3.2.5.2
+5 ;
+6 ; External References
+7 ; $$S^%ZTLOAD ICR 10063
+8 ; $$DT^XLFDT ICR 10103
+9 ; $$FMADD^XLFDT ICR 10103
+10 ; $$NOW^XLFDT ICR 10103
+11 ;
+12 ; Local Variables NEWed or KILLed Elsewhere
+13 ; LEXQ Quiet flag NEWed/KILLed by LEXRXXT2
+14 ; ZTQUEUED Task flag NEWed/KILLed by Taskman
+15 ; ZTSK Task Number NEWed/KILLed by Taskman
+16 ;
+17 QUIT
UPD(X,LEXDES,LEXUPD) ; Update Task ^XTMP and ^%ZTSK
+1 IF $DATA(LEXQ)
QUIT 0
NEW LEXNAM,LEXCRE,LEXPRG,LEXTC
SET LEXTC=0
+2 SET LEXNAM=$GET(X)
SET LEXDES=$GET(LEXDES)
SET LEXUPD=$GET(LEXUPD)
+3 SET LEXCRE=$$DT^XLFDT
SET LEXPRG=$$FMADD^XLFDT(LEXCRE,1)
+4 IF $LENGTH(LEXNAM)
IF '$LENGTH(LEXDES)
IF '$LENGTH(LEXUPD)
KILL ^XTMP(LEXNAM)
QUIT 0
+5 IF $LENGTH(LEXNAM)
IF '$DATA(^XTMP(LEXNAM,0))
Begin DoDot:1
+6 SET ^XTMP(LEXNAM,0)=LEXPRG_"^"_LEXCRE
IF $LENGTH(LEXDES)
Begin DoDot:2
+7 SET $PIECE(^XTMP(LEXNAM,0),"^",3)=$$NOW^XLFDT
+8 SET $PIECE(^XTMP(LEXNAM,0),"^",4)=LEXDES
End DoDot:2
+9 IF +($GET(ZTSK))>0
SET ^XTMP(LEXNAM,1)=+($GET(ZTSK))
End DoDot:1
+10 IF $LENGTH(LEXNAM)
IF $LENGTH(LEXUPD)
IF $DATA(^XTMP(LEXNAM,0))
Begin DoDot:1
+11 SET ^XTMP(LEXNAM,2)=$$NOW^XLFDT_"^"_LEXUPD
End DoDot:1
+12 IF $DATA(ZTQUEUED)
Begin DoDot:1
+13 IF $LENGTH(LEXDES)&('$LENGTH(LEXUPD))
SET LEXTC=$$S^%ZTLOAD(LEXDES)
+14 IF $LENGTH(LEXUPD)
SET LEXTC=$$S^%ZTLOAD(LEXUPD)
+15 IF +($GET(ZTSK))>0&($LENGTH(LEXNAM))
SET ^XTMP(LEXNAM,1)=+($GET(ZTSK))
End DoDot:1
+16 SET X=LEXTC
+17 QUIT X
+18 ;
+19 ; Miscellaneous
CLR ; Clear
+1 KILL LEXQ,ZTQUEUED,ZTSK
+2 QUIT