LRNIGHT ;SLC/CJS/AVAMC/REG - NIGHTLY LAB CLEANUP ;6/5/90 21:08 ;
;;5.2;LAB SERVICE;**1031**;NOV 1, 1997
;
;;VA LR Patch(s): 291
;
;D REQUE ;REQUED BY TASKMAN
Q:'$D(^LAB(69.9,1,0)) S:$D(ZTQUEUED) DUZ(0)="@",ZTREQ="@" K ^LRO(69,"AN") K ^LRO(69,DT-1,1,"AD") I $P(^LAB(69.9,1,0),U,14) D MANUAL
S %DT="",X="T-"_$S($P(^LAB(69.9,1,0),"^",9):$P(^(0),"^",9),1:7) D ^%DT S LRSAVE=Y
F L=0:0 S L=$O(^LRO(69,"AT",L)) Q:L'>0 F T=0:0 S T=$O(^LRO(69,"AT",L,T)) Q:T'>0 F S=0:0 S S=$O(^LRO(69,"AT",L,T,S)) Q:S'>0 S X=-LRSAVE,X1=LRSAVE F X=X:0 S X=$O(^LRO(69,"AT",L,T,S,X)) Q:X=""!(X'<X1) K ^LRO(69,"AT",L,T,S,X)
K %,%H,%X,%Y,L,LRIOZERO,LRSAVE,POP,S,T,X,X1,Z,Y
STDQC ;Cleanup the XTMP("LRCAP" global
D XTMP^LRCAPPH
;Check roll-up date; process pending panels if appropriate date
S X=$T(EN^LRBEBA5) I X'="" D EN^LRBEBA5
Q
REQUE S ZTDTH=$H+1_",1",ZTIO="",ZTRTN="^LRNIGHT" D ^%ZTLOAD K ZTDTH,ZTIO,ZTRTN,ZTSK Q
END K DUOUT,DTOUT,%DT,LRW,D,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,LRDFN,DFN,LRCD
Q
MANUAL ;
RANGE ;
S ZTRTN="LRCAPV2",ZTIO="",ZTDTH=$H,ZTDESC="TALLY CAP WORKLOAD" D ^%ZTLOAD Q
LRNIGHT ;SLC/CJS/AVAMC/REG - NIGHTLY LAB CLEANUP ;6/5/90 21:08 ;
+1 ;;5.2;LAB SERVICE;**1031**;NOV 1, 1997
+2 ;
+3 ;;VA LR Patch(s): 291
+4 ;
+5 ;D REQUE ;REQUED BY TASKMAN
+6 IF '$DATA(^LAB(69.9,1,0))
QUIT
IF $DATA(ZTQUEUED)
SET DUZ(0)="@"
SET ZTREQ="@"
KILL ^LRO(69,"AN")
KILL ^LRO(69,DT-1,1,"AD")
IF $PIECE(^LAB(69.9,1,0),U,14)
DO MANUAL
+7 SET %DT=""
SET X="T-"_$SELECT($PIECE(^LAB(69.9,1,0),"^",9):$PIECE(^(0),"^",9),1:7)
DO ^%DT
SET LRSAVE=Y
+8 FOR L=0:0
SET L=$ORDER(^LRO(69,"AT",L))
IF L'>0
QUIT
FOR T=0:0
SET T=$ORDER(^LRO(69,"AT",L,T))
IF T'>0
QUIT
FOR S=0:0
SET S=$ORDER(^LRO(69,"AT",L,T,S))
IF S'>0
QUIT
SET X=-LRSAVE
SET X1=LRSAVE
FOR X=X:0
SET X=$ORDER(^LRO(69,"AT",L,T,S,X))
IF X=""!(X'<X1)
QUIT
KILL ^LRO(69,"AT",L,T,S,X)
+9 KILL %,%H,%X,%Y,L,LRIOZERO,LRSAVE,POP,S,T,X,X1,Z,Y
STDQC ;Cleanup the XTMP("LRCAP" global
+1 DO XTMP^LRCAPPH
+2 ;Check roll-up date; process pending panels if appropriate date
+3 SET X=$TEXT(EN^LRBEBA5)
IF X'=""
DO EN^LRBEBA5
+4 QUIT
REQUE SET ZTDTH=$HOROLOG+1_",1"
SET ZTIO=""
SET ZTRTN="^LRNIGHT"
DO ^%ZTLOAD
KILL ZTDTH,ZTIO,ZTRTN,ZTSK
QUIT
END KILL DUOUT,DTOUT,%DT,LRW,D,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,S15,LRDFN,DFN,LRCD
+1 QUIT
MANUAL ;
RANGE ;
+1 SET ZTRTN="LRCAPV2"
SET ZTIO=""
SET ZTDTH=$HOROLOG
SET ZTDESC="TALLY CAP WORKLOAD"
DO ^%ZTLOAD
QUIT