XUCSXRT ;SFISC/HVB - CROSS-SITE RTs for 486 SITES ;2/18/96 15:07
;;7.3;TOOLKIT;**14**;Dec 15, 1995
A Q:'$$CHKF^XUCSUTL S U="^" S:'$D(DT) DT=$$HTFM^XLFDT($H,1)
S XUCSEND=0 D A3^XUCSUTL3 G XIT:XUCSEND
S %ZIS="Q" D ^%ZIS I POP S POP=0 G XIT
I $D(IO("Q")) D G XIT
. S ZTSAVE("XUCS*")="",ZTRTN="DQ^XUCSXRT",ZTDESC="MPM X-SITE RT REPORT",ZTIO=ION
. S %DT="AEFRX",%DT("A")="Queue for what DATE/TIME? ",%DT("B")="NOW",%DT(0)="NOW" D ^%DT K %DT
. I +Y'<0 S ZTDTH=Y D ^%ZTLOAD,HOME^%ZIS
. K IO("Q")
U IO W:$E(IOST)="C" #
DQ ; Dequeue entry point
K RT S X=0 F S X=$O(^XUCS(8987.2,X)) Q:X]"@"!(X="") S NODE=^(X,0) D:$E(NODE,4,5)="CS"&($D(^XUCS(8987.2,X))>1)
. S FMDT=XUCSBD F S FMDT=$O(^XUCS(8987.2,"C",FMDT)) Q:FMDT="" Q:$D(^(FMDT,X))
. Q:FMDT="" S Y=$O(^XUCS(8987.2,"C",FMDT,X,0))-1
. F S Y=$O(^XUCS(8987.2,X,1,Y)) Q:Y]"@"!(Y="") S FMDT=^(Y,0) Q:FMDT>(XUCSED+.24) D:FMDT>XUCSBD&($D(^(5))>1)
. . I $E($P(FMDT,".",2),1,2)<12,XUCSRT="P" Q
. . I $E($P(FMDT,".",2),1,2)>11,XUCSRT="A" Q
. . S $P(RT(NODE),"^",18)=$P($G(RT(NODE)),"^",18)+1
. . S $P(RT(NODE),"^",19)=$P(RT(NODE),"^",19)+$P(FMDT,"^",3)
. . F I=1:1:17 S $P(RT(NODE),"^",I)=$P(RT(NODE),"^",I)+$P(^XUCS(8987.2,X,1,Y,5,I,0),"^",3)
P S Y=XUCSBD D DD^%DT S BD=Y,Y=XUCSED D DD^%DT S ED=Y D HDR
S (NODE,OSITE)="" F S NODE=$O(RT(NODE)) Q:NODE="" D
. S SITE=$E(NODE,1,3) I SITE'=OSITE S OSITE=SITE D:$Y>(IOSL-7) HFF W !?1,$P($G(^DIC(4,SITE,0)),"^"),!
. S SUM=0 F I=1:1:12 S SUM=SUM+$P(RT(NODE),"^",I)
. I SUM S (GT30,CUM)=0,CNT=$P(RT(NODE),"^",18),SET=$P(RT(NODE),"^",19) D
. . F I=13:1:17 S GT30=GT30+$P(RT(NODE),"^",I)
. . W $J(NODE,7),$J(CNT,4,0),$J(SUM+GT30/SET,5,1)
. . S (I,SEET)=0 F M=0.3,1.4,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,15,25 S I=I+1,SEET=SEET+($P(RT(NODE),"^",I)*M)
. . W $J(SEET/SUM,6,2),?23
. . F I=1:1:12 S CUM=CUM+$P(RT(NODE),"^",I) S PCT=CUM/SUM*100 I PCT<99.9,I'=8,I'=9 W $J(PCT,5,1)
. . S GT30PCT=GT30/(GT30+SUM)*100 W:GT30PCT>0.045 ?73,$J(GT30PCT,4,2) W !
XIT I $E($G(IOST))'="C",'$D(ZTQUEUED) D ^%ZISC
K BD,CNT,CUM,ED,FMDT,GT30,GT30PCT,I,M,NODE,OSITE,PCT,RT,SEET,SET,SITE,SUM
K X,XUCSBD,XUCSED,XUCSEND,XUCSRT,Y
Q
HFF W #
HDR W ?4,"MPM X-Site Response Time Report for ",BD," to ",ED," (",$S(XUCSRT="A":"AM)",XUCSRT="P":"PM)",1:"AM&PM)")
W !?2,"Node",?9,"N",?13,"R/S",?19,"RT",?24,"<1S <2S <3S <4S <5S <6S <7S <10 <20 <30 ",?74,">30"
W !?1 F I=1:1:76 W "="
W ! Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXUCSXRT 2418 printed Nov 22, 2024@17:52:20 Page 2
XUCSXRT ;SFISC/HVB - CROSS-SITE RTs for 486 SITES ;2/18/96 15:07
+1 ;;7.3;TOOLKIT;**14**;Dec 15, 1995
A if '$$CHKF^XUCSUTL
QUIT
SET U="^"
if '$DATA(DT)
SET DT=$$HTFM^XLFDT($HOROLOG,1)
+1 SET XUCSEND=0
DO A3^XUCSUTL3
if XUCSEND
GOTO XIT
+2 SET %ZIS="Q"
DO ^%ZIS
IF POP
SET POP=0
GOTO XIT
+3 IF $DATA(IO("Q"))
Begin DoDot:1
+4 SET ZTSAVE("XUCS*")=""
SET ZTRTN="DQ^XUCSXRT"
SET ZTDESC="MPM X-SITE RT REPORT"
SET ZTIO=ION
+5 SET %DT="AEFRX"
SET %DT("A")="Queue for what DATE/TIME? "
SET %DT("B")="NOW"
SET %DT(0)="NOW"
DO ^%DT
KILL %DT
+6 IF +Y'<0
SET ZTDTH=Y
DO ^%ZTLOAD
DO HOME^%ZIS
+7 KILL IO("Q")
End DoDot:1
GOTO XIT
+8 USE IO
if $EXTRACT(IOST)="C"
WRITE #
DQ ; Dequeue entry point
+1 KILL RT
SET X=0
FOR
SET X=$ORDER(^XUCS(8987.2,X))
if X]"@"!(X="")
QUIT
SET NODE=^(X,0)
if $EXTRACT(NODE,4,5)="CS"&($DATA(^XUCS(8987.2,X))>1)
Begin DoDot:1
+2 SET FMDT=XUCSBD
FOR
SET FMDT=$ORDER(^XUCS(8987.2,"C",FMDT))
if FMDT=""
QUIT
if $DATA(^(FMDT,X))
QUIT
+3 if FMDT=""
QUIT
SET Y=$ORDER(^XUCS(8987.2,"C",FMDT,X,0))-1
+4 FOR
SET Y=$ORDER(^XUCS(8987.2,X,1,Y))
if Y]"@"!(Y="")
QUIT
SET FMDT=^(Y,0)
if FMDT>(XUCSED+.24)
QUIT
if FMDT>XUCSBD&($DATA(^(5))>1)
Begin DoDot:2
+5 IF $EXTRACT($PIECE(FMDT,".",2),1,2)<12
IF XUCSRT="P"
QUIT
+6 IF $EXTRACT($PIECE(FMDT,".",2),1,2)>11
IF XUCSRT="A"
QUIT
+7 SET $PIECE(RT(NODE),"^",18)=$PIECE($GET(RT(NODE)),"^",18)+1
+8 SET $PIECE(RT(NODE),"^",19)=$PIECE(RT(NODE),"^",19)+$PIECE(FMDT,"^",3)
+9 FOR I=1:1:17
SET $PIECE(RT(NODE),"^",I)=$PIECE(RT(NODE),"^",I)+$PIECE(^XUCS(8987.2,X,1,Y,5,I,0),"^",3)
End DoDot:2
End DoDot:1
P SET Y=XUCSBD
DO DD^%DT
SET BD=Y
SET Y=XUCSED
DO DD^%DT
SET ED=Y
DO HDR
+1 SET (NODE,OSITE)=""
FOR
SET NODE=$ORDER(RT(NODE))
if NODE=""
QUIT
Begin DoDot:1
+2 SET SITE=$EXTRACT(NODE,1,3)
IF SITE'=OSITE
SET OSITE=SITE
if $Y>(IOSL-7)
DO HFF
WRITE !?1,$PIECE($GET(^DIC(4,SITE,0)),"^"),!
+3 SET SUM=0
FOR I=1:1:12
SET SUM=SUM+$PIECE(RT(NODE),"^",I)
+4 IF SUM
SET (GT30,CUM)=0
SET CNT=$PIECE(RT(NODE),"^",18)
SET SET=$PIECE(RT(NODE),"^",19)
Begin DoDot:2
+5 FOR I=13:1:17
SET GT30=GT30+$PIECE(RT(NODE),"^",I)
+6 WRITE $JUSTIFY(NODE,7),$JUSTIFY(CNT,4,0),$JUSTIFY(SUM+GT30/SET,5,1)
+7 SET (I,SEET)=0
FOR M=0.3,1.4,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,15,25
SET I=I+1
SET SEET=SEET+($PIECE(RT(NODE),"^",I)*M)
+8 WRITE $JUSTIFY(SEET/SUM,6,2),?23
+9 FOR I=1:1:12
SET CUM=CUM+$PIECE(RT(NODE),"^",I)
SET PCT=CUM/SUM*100
IF PCT<99.9
IF I'=8
IF I'=9
WRITE $JUSTIFY(PCT,5,1)
+10 SET GT30PCT=GT30/(GT30+SUM)*100
if GT30PCT>0.045
WRITE ?73,$JUSTIFY(GT30PCT,4,2)
WRITE !
End DoDot:2
End DoDot:1
XIT IF $EXTRACT($GET(IOST))'="C"
IF '$DATA(ZTQUEUED)
DO ^%ZISC
+1 KILL BD,CNT,CUM,ED,FMDT,GT30,GT30PCT,I,M,NODE,OSITE,PCT,RT,SEET,SET,SITE,SUM
+2 KILL X,XUCSBD,XUCSED,XUCSEND,XUCSRT,Y
+3 QUIT
HFF WRITE #
HDR WRITE ?4,"MPM X-Site Response Time Report for ",BD," to ",ED," (",$SELECT(XUCSRT="A":"AM)",XUCSRT="P":"PM)",1:"AM&PM)")
+1 WRITE !?2,"Node",?9,"N",?13,"R/S",?19,"RT",?24,"<1S <2S <3S <4S <5S <6S <7S <10 <20 <30 ",?74,">30"
+2 WRITE !?1
FOR I=1:1:76
WRITE "="
+3 WRITE !
QUIT