LRCAPV1S ;SLC/FHS-SET WKLD CODE INTO LRO(68 PART 2 ; 12/3/1997
;;5.2T9;LR;**1018**;Nov 17, 2004
;;5.2;LAB SERVICE;**42,153,201,221**;Sep 27, 1994
SET ; From LRCAPV1
Q:'$D(^LRO(68,+LRAA,1,LRAD,1,LRAN,0))#2
I '$D(LRTIME) S LRTIME=$$NOW^XLFDT
I '$P(LRTIME,".",2) S LRTIME=$$NOW^XLFDT
I '$D(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,0))#2 S:$G(LRALERT) LRURGW=LRALERT D
. S ^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,0)=LRT_U_(50+$G(LRURGW))_U_U_DUZ_U_LRTIME_"^^^"_LRCDEF_U_$P($G(LRT("P")),U)
. S $P(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,0),U,3)=LRT,$P(^(0),U,4)=1+$P(^(0),U,4),^LRO(68,+LRAA,1,LRAD,1,LRAN,4,"B",LRT,LRT)=""
S:'$P(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,0),U,8) $P(^(0),U,8)=$G(LRCDEF)
S:'$D(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,0))#2 ^(0)="^68.14P^" S NODE0=^(0),NODE=LRP_U_"^^^^"_LRTIME_U_DUZ_U_DUZ(2)_U_$S($G(LRCAPMS):LRCAPMS,1:+LRAA)_U
I '$D(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0)) S $P(NODE0,U,3)=LRP,$P(NODE0,U,4)=1+$P(NODE0,U,4),^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,0)=NODE0,^(LRP,0)=NODE
S X=^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0) I '$D(LRADD),$P(X,U,2) Q
I $D(LRADD) S:'$P(X,U,3) $P(X,U,2)=LRCNT+$P(X,U,2) S:$P(X,U,3) $P(X,U,2)=LRCNT,$P(X,U,3)=0 S ^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0)=X
I '$D(LRADD),'$P(X,U,3) S $P(X,U,2)=LRCNT,^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0)=X
I $G(LRCSQ),$G(LRCSQQ) D
. S ^XTMP("LRCAP",LRCSQ,DUZ,0)=$$HTFM^XLFDT($H+30,1)_U_DT_U_"Lab Control workload count"_U_$G(DUZ)
. S ^XTMP("LRCAP",LRCSQ,DUZ,LRP)=""
Q
LRCAPV1S ;SLC/FHS-SET WKLD CODE INTO LRO(68 PART 2 ; 12/3/1997
+1 ;;5.2T9;LR;**1018**;Nov 17, 2004
+2 ;;5.2;LAB SERVICE;**42,153,201,221**;Sep 27, 1994
SET ; From LRCAPV1
+1 IF '$DATA(^LRO(68,+LRAA,1,LRAD,1,LRAN,0))#2
QUIT
+2 IF '$DATA(LRTIME)
SET LRTIME=$$NOW^XLFDT
+3 IF '$PIECE(LRTIME,".",2)
SET LRTIME=$$NOW^XLFDT
+4 IF '$DATA(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,0))#2
IF $GET(LRALERT)
SET LRURGW=LRALERT
Begin DoDot:1
+5 SET ^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,0)=LRT_U_(50+$GET(LRURGW))_U_U_DUZ_U_LRTIME_"^^^"_LRCDEF_U_$PIECE($GET(LRT("P")),U)
+6 SET $PIECE(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,0),U,3)=LRT
SET $PIECE(^(0),U,4)=1+$PIECE(^(0),U,4)
SET ^LRO(68,+LRAA,1,LRAD,1,LRAN,4,"B",LRT,LRT)=""
End DoDot:1
+7 IF '$PIECE(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,0),U,8)
SET $PIECE(^(0),U,8)=$GET(LRCDEF)
+8 IF '$DATA(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,0))#2
SET ^(0)="^68.14P^"
SET NODE0=^(0)
SET NODE=LRP_U_"^^^^"_LRTIME_U_DUZ_U_DUZ(2)_U_$SELECT($GET(LRCAPMS):LRCAPMS,1:+LRAA)_U
+9 IF '$DATA(^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0))
SET $PIECE(NODE0,U,3)=LRP
SET $PIECE(NODE0,U,4)=1+$PIECE(NODE0,U,4)
SET ^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,0)=NODE0
SET ^(LRP,0)=NODE
+10 SET X=^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0)
IF '$DATA(LRADD)
IF $PIECE(X,U,2)
QUIT
+11 IF $DATA(LRADD)
IF '$PIECE(X,U,3)
SET $PIECE(X,U,2)=LRCNT+$PIECE(X,U,2)
IF $PIECE(X,U,3)
SET $PIECE(X,U,2)=LRCNT
SET $PIECE(X,U,3)=0
SET ^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0)=X
+12 IF '$DATA(LRADD)
IF '$PIECE(X,U,3)
SET $PIECE(X,U,2)=LRCNT
SET ^LRO(68,+LRAA,1,LRAD,1,LRAN,4,LRT,1,LRP,0)=X
+13 IF $GET(LRCSQ)
IF $GET(LRCSQQ)
Begin DoDot:1
+14 SET ^XTMP("LRCAP",LRCSQ,DUZ,0)=$$HTFM^XLFDT($HOROLOG+30,1)_U_DT_U_"Lab Control workload count"_U_$GET(DUZ)
+15 SET ^XTMP("LRCAP",LRCSQ,DUZ,LRP)=""
End DoDot:1
+16 QUIT