INHRTH ;DP; 9 May 96 15:41;27 Dec 95 10:39;Throughput analyzer report
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
Q
EN ;Main entry point
N DES,N,I,X,INLOAD,DET,INBEG,INEND,INENDX,INTM,INC,INT,INLN,MS
N INABEG,INAEND,DAY,FLG,IN,IN1,INLST,INSITE,INTIM1,LOOP,MSGDAT,MSGDT,MSGTM,P,PAG,PAGES,POP,SE,ST,TM,INDESM,%DT,ASTRX,CNT,DIC,DIRCP,DIRI,DIRMAX,DT1,DT2,DT3,I,IEN2,II,INDES,INTMI,STAT,X,X1,X2,X3,X4,Z,ZE
W @IOF Q:'$$PARM^INHRTH1
Q:POP
;Device handling & Tasking logic
K IOP S %ZIS("A")="QUEUE ON DEVICE: ",%ZIS("B")="",%ZIS="NQ"
D ^%ZIS G:POP QUIT
S IOP=ION_";"_IOST_";"_IOM_";"_IOSL
I IO=IO(0) S %ZIS="" D ^%ZIS I POP W *7,!,"Sorry, unable to find device..." G QUIT
I IO'=IO(0) D G QUIT
.S ZTDESC="Throughput analyzer report",ZTIO=IOP,ZTRTN="ENQUE^INHRTH"
.S ZTSAVE("INLOAD")=INLOAD
.D ^%ZTLOAD
ENQUE ;Taskman entry point
K ^UTILITY($J)
S ST=$P(INLOAD,U),DET=$P(INLOAD,U,2),DES=$P(INLOAD,U,3)
S INBEG=$P(INLOAD,U,4),INEND=$P(INLOAD,U,5),INTM=$P(INLOAD,U,6)
S INABEG=$P(INLOAD,U,7),INAEND=$P(INLOAD,U,8)
;
; INDES flag for destination list
; 1 List
; 0 All destinations
; INDESM=1 if more than 1 destination is included in report
;
S (INDES,INDESM)=0 I $L(DES)>1 S INDES=1 D
.F I=1:1:$L(DES,",")-1 S X=$P(DES,",",I),DES(X)=$P(^INRHD(X,0),U)
.S:I>1 INDESM=1
;build array for ALL destinations
I 'INDES S X=0,INDESM=1 F S X=$O(^INRHD(X)) Q:'X S DES(X)=$P(^INRHD(X,0),U)
S PAG=1,X1=0,DV=1 S:INTM["H" INTM=INTM*60
D COMP,SUM,DEV,OUTPUT
I 'POP D
.F I=$Y:1:(IOSL-1) W !
.S X="*** End of Report ***" W ?IOM-$L(X)\2,X
K ^UTILITY($J)
;
QUIT ;Exit point
D ^%ZISC
Q
;
COMP ;Compile statistics
;
; INC = holder of creation totals
; INT = holder of transmission totals
;
S LOOP=$O(^INTHU("B",INBEG,"")),INC="CC",INT="TT"
; get the last internal number for the ending date
S INENDX=$O(^INTHU("B",INEND,""),-1) D INTER
I $P(IOST,"-")["C",IO=IO(0) W !,"Compiling data "
F CNT=1:1 S LOOP=$O(^INTHU(LOOP)) Q:'LOOP!(LOOP>INENDX) D
. I IO=$P W:'(CNT#1000) "."
. S ZE=$G(^INTHU(LOOP,0))
. ; quit if date is out of range
. Q:+ZE>INAEND
. ;
. ; message creation date and time
. ; MSGDT = date
. ; MSGTM = time HHMM
. S MSGDT=+$P($P(ZE,U),"."),MSGTM=$E($P(ZE,U),9,20)
. S MSGDAT=$E($P(ZE,U),1,12)
. ; get destination
. S DES=$P(ZE,U,2) Q:DES=""
. ;quit if destination is not on the selected array.
. I INDES Q:'$D(DES(DES))
. ;for message that was created befor the begining date make
. ;sure to quit if no work was done later.
. I +ZE<INABEG Q:$P(ZE,U,14)<INABEG D MULT Q
. ;
. ;Quit if status is not part of the selection string
. Q:$F(ST,$P(ZE,U,3))<2
. S STAT=$P(ZE,U,3)
. S MS=+MSGDAT S:'$D(^UTILITY($J,MS)) MS=$O(^UTILITY($J,MS),-1)
. ;following variable does not seem to be used. Verify for 4.6
. S MSGTM=$E(MSGTM,1,2)*60+$E(MSGTM,3,4)
. ;store details. SUM tag summarizes details
. S ^UTILITY($J,MS,DES,STAT,INC)=$G(^UTILITY($J,MS,DES,STAT,INC))+1
. D MULT
Q
MULT ; Look for activity on the multiple level
N ACT,ACTLOOP,ACTZE,DTTM,DTDT,DAY
S ACT=0
F ACTLOOP=0:1 S ACT=$O(^INTHU(LOOP,1,ACT)) Q:'ACT&ACTLOOP D
.S ACTZE=""
.S:ACT ACTZE=$G(^INTHU(LOOP,1,ACT,0))
.; Get status
.Q:$F(ST,$P(ACTZE,U,2))<2 S STAT=$P(ACTZE,U,2)
.; Quit if messages has no date/time.
.Q:+ACTZE=0 S DTTM=$P(ACTZE,U)
.Q:DTTM>INAEND
.S DTDT=$P(DTTM,"."),DTTM=$E(DTTM,1,12)
.S DAY=+DTTM S:'$D(^UTILITY($J,DTTM)) DAY=$O(^UTILITY($J,DAY),-1)
.Q:DAY="" S DTTM=$E(DTTM,1,2)*60+$E(DTTM,3,4)
.S ^UTILITY($J,DAY,DES,STAT,INT)=$G(^UTILITY($J,DAY,DES,STAT,INT))+1
Q
INTER ;Initalize intervals for all date/time
N I,IA,II,III,D,ZZ,OLDTM
S ZZ=$P(INLOAD,U,3),IA=0
;last time bracket
S INLST=$E($$ADDT^%ZTFDT(INAEND,0,0,-INTM),1,12),OLDTM=0
F S X=$E($$ADDT^%ZTFDT(INABEG,0,0,(INTM*IA)),1,12),IA=IA+1 Q:OLDTM'<INLST D
.S OLDTM=X
.S DES=0 F S DES=$O(DES(DES)) Q:'DES D
..F III=1:1:$L(ST) F IN=INC,INT S ^UTILITY($J,X,DES,$E(ST,III),IN)=0
Q
;
OUTPUT ;Output data
W ! S (DT1,DAY)=0,ASTRX="",$P(ASTRX,"*",80)="",POP=0
F S DAY=$O(^UTILITY($J,DAY)) Q:DAY=""!(DAY="B")!POP S TM="" D
.D DT Q:POP
.S FLG=1 F I=INC,INT S X=$G(^UTILITY($J,DAY,I)) D @I
.;quit here if this is not a detailed report AND only 1 dest is selected
.W ! I 'INDESM,'DET Q
.S FLG=0,DES=""
.F S DES=$O(^UTILITY($J,DAY,DES)) Q:DES=""!POP D
..; display destination
..I DES'?.N W ! Q
..I $Y>(IOSL-2) D HDR Q:POP D DT
..W !?19,$E($P(^INRHD(DES,0),U),1,30)
..F I=INC,INT S X=$G(^UTILITY($J,"B",DAY,DES,I)) Q:X=""!POP D @I
..;Quit if not a detailed report
..Q:'DET
..; display status
..W ! S ST="" F S ST=$O(^UTILITY($J,DAY,DES,ST)) Q:ST=""!POP D
...I ST'?1A W ! Q
...I $Y>(IOSL-2) S DT1="" D HDR Q:POP D DT
...W ?46,ST
...F I=INC,INT S X=$G(^UTILITY($J,DAY,DES,ST,I)) D @I
...W ! I $Y>(IOSL-2) D HDR D:'POP DT
Q
;
CC ;Dsplay details for creation rate
I $Y>IOSL S DT1="" D HDR Q:POP D DT
I X="" W ! Q
S P=$S(FLG:24,1:54) W ?(P-$L(X)),X
; display the astrics line
S X1=$E(ASTRX,1,$J(X/DV,0,0)) S:'$L(X1) X1="*"
S:X=0 X1=""
S:$L(X1)>SE X1=$E(X1,1,(SE-2))_">>" W ?(P+2),X1
Q
TT ;Display details for transmission rate
N X0
I X="" W ! Q
S X0=X,X=$E(ASTRX,1,$J(X/DV,0,0))
S:'$L(X) X="*" S:X0=0 X="" S:$L(X)>SE X="<<"_$E(X,1,(SE-2))
S X=X_$J(X0,7) W ?IOM-1-$L(X),X
Q
DT ;Print date time
I $Y>(IOSL-3) S DT1="" D HDR Q:POP
S DT2=$$CDATASC^%ZTFDT(DAY,2,1)
W $P(DT2,"@")," ",$P(DT2,"@",2),"-"
S DT3=$O(^UTILITY($J,DAY)) I 'DT3 W $P($$CDATASC^%ZTFDT(INAEND,2,1),"@",2) Q
S X=$$ADDT^%ZTFDT(DT3,0,0,-1)
W $P($$CDATASC^%ZTFDT(X,2,1),"@",2)
Q
SUM ;Calculate totals for date/time
N DAY,DDE,SST,X
S DAY="",DV=1
F S DAY=$O(^UTILITY($J,DAY)) Q:DAY=""&(DAY'?.N1".".N) S DDE="" D
.Q:DAY="B" F S DDE=$O(^UTILITY($J,DAY,DDE)) Q:DDE="" S SST="" D
..F S SST=$O(^UTILITY($J,DAY,DDE,SST)) Q:SST="" D
...F I=INC,INT D
....S X=^UTILITY($J,DAY,DDE,SST,I)
....; total for date & time
....S ^UTILITY($J,DAY,I)=$G(^UTILITY($J,DAY,I))+X
....S:^UTILITY($J,DAY,I)>DV DV=^(I)
....; total for date/time & destination
....S ^UTILITY($J,"B",DAY,DDE,I)=$G(^UTILITY($J,"B",DAY,DDE,I))+X
Q
;
DEV ;Calculate the devisor
S SE=16 I 'DET S DV=DV/2,SE=31
S DV=$S(DV>9000:1000,DV>4500:500,DV>1900:250,DV>900:100,1:25)
;
; Set header
S X=$$CDATASC^%ZTFDT($H,1,1),INLN(0)=X_" Page "
S INLN(1)="Throughput analyzer report"
I DET S INLN(1)=INLN(1)_" - Detailed"
S X="From: "_$$CDATASC^%ZTFDT($E(INABEG,1,12),3,1)
S INLN(2)=X_" To: "_$$CDATASC^%ZTFDT($E(INAEND,1,12),3,1)
D ST1^INHRTH1 S INLN(3)="Status: "_INLN(3)
S INLN(5)="Divisor: (*) "_DV
S X=INTM S:INTM>60 X=(INTM\60)_"Hr"
S INTMI="Time interval: "_X S:INTM<60 INTMI=INTMI_"Minutes"
;get the site name
S INSITE=$S($D(^DIC(4,^DD("SITE",1),0)):^(0),1:^DD("SITE"))
S INSITE=$S($P(INSITE,U,4)]"":$P(INSITE,U,4),1:$P(INSITE,U,1))
S INLN="",$P(INLN,"-",IOM)=""
;
HDR ;Print header
I $P(IOST,"-")["C",IO=IO(0),$Y>15 S X=$$CR^UTSRD I X S POP=1 Q
I PAG>1!($P(IOST,"-")["C") W @IOF
W !,INSITE
S X=INLN(0)_PAG,PAG=PAG+1,DT1=""
W ?IOM-$L(X)-2,X,!
F I=1:1:4 I $G(INLN(I))'="" W !?IOM-$L(INLN(I))\2,INLN(I)
W !,"Destination:" D
.I 'INDES W " All",! Q
.S II="" F S II=$O(DES(II)) Q:II="" W !?14,DES(II)
W !!,INLN(5),!,INTMI,!!,INLN
W !," Date Time" W:DET ?19,"Destination"
W:DET ?42,"Status"
S P=15 S:DET P=40 W !?P,"Creation Rates "
S X="Transmission Rates" W ?IOM-$L(X)-2,X
W !,INLN,!
Q
;
INHRTH ;DP; 9 May 96 15:41;27 Dec 95 10:39;Throughput analyzer report
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 QUIT
EN ;Main entry point
+1 NEW DES,N,I,X,INLOAD,DET,INBEG,INEND,INENDX,INTM,INC,INT,INLN,MS
+2 NEW INABEG,INAEND,DAY,FLG,IN,IN1,INLST,INSITE,INTIM1,LOOP,MSGDAT,MSGDT,MSGTM,P,PAG,PAGES,POP,SE,ST,TM,INDESM,%DT,ASTRX,CNT,DIC,DIRCP,DIRI,DIRMAX,DT1,DT2,DT3,I,IEN2,II,INDES,INTMI,STAT,X,X1,X2,X3,X4,Z,ZE
+3 WRITE @IOF
IF '$$PARM^INHRTH1
QUIT
+4 IF POP
QUIT
+5 ;Device handling & Tasking logic
+6 KILL IOP
SET %ZIS("A")="QUEUE ON DEVICE: "
SET %ZIS("B")=""
SET %ZIS="NQ"
+7 DO ^%ZIS
IF POP
GOTO QUIT
+8 SET IOP=ION_";"_IOST_";"_IOM_";"_IOSL
+9 IF IO=IO(0)
SET %ZIS=""
DO ^%ZIS
IF POP
WRITE *7,!,"Sorry, unable to find device..."
GOTO QUIT
+10 IF IO'=IO(0)
Begin DoDot:1
+11 SET ZTDESC="Throughput analyzer report"
SET ZTIO=IOP
SET ZTRTN="ENQUE^INHRTH"
+12 SET ZTSAVE("INLOAD")=INLOAD
+13 DO ^%ZTLOAD
End DoDot:1
GOTO QUIT
ENQUE ;Taskman entry point
+1 KILL ^UTILITY($JOB)
+2 SET ST=$PIECE(INLOAD,U)
SET DET=$PIECE(INLOAD,U,2)
SET DES=$PIECE(INLOAD,U,3)
+3 SET INBEG=$PIECE(INLOAD,U,4)
SET INEND=$PIECE(INLOAD,U,5)
SET INTM=$PIECE(INLOAD,U,6)
+4 SET INABEG=$PIECE(INLOAD,U,7)
SET INAEND=$PIECE(INLOAD,U,8)
+5 ;
+6 ; INDES flag for destination list
+7 ; 1 List
+8 ; 0 All destinations
+9 ; INDESM=1 if more than 1 destination is included in report
+10 ;
+11 SET (INDES,INDESM)=0
IF $LENGTH(DES)>1
SET INDES=1
Begin DoDot:1
+12 FOR I=1:1:$LENGTH(DES,",")-1
SET X=$PIECE(DES,",",I)
SET DES(X)=$PIECE(^INRHD(X,0),U)
+13 IF I>1
SET INDESM=1
End DoDot:1
+14 ;build array for ALL destinations
+15 IF 'INDES
SET X=0
SET INDESM=1
FOR
SET X=$ORDER(^INRHD(X))
IF 'X
QUIT
SET DES(X)=$PIECE(^INRHD(X,0),U)
+16 SET PAG=1
SET X1=0
SET DV=1
IF INTM["H"
SET INTM=INTM*60
+17 DO COMP
DO SUM
DO DEV
DO OUTPUT
+18 IF 'POP
Begin DoDot:1
+19 FOR I=$Y:1:(IOSL-1)
WRITE !
+20 SET X="*** End of Report ***"
WRITE ?IOM-$LENGTH(X)\2,X
End DoDot:1
+21 KILL ^UTILITY($JOB)
+22 ;
QUIT ;Exit point
+1 DO ^%ZISC
+2 QUIT
+3 ;
COMP ;Compile statistics
+1 ;
+2 ; INC = holder of creation totals
+3 ; INT = holder of transmission totals
+4 ;
+5 SET LOOP=$ORDER(^INTHU("B",INBEG,""))
SET INC="CC"
SET INT="TT"
+6 ; get the last internal number for the ending date
+7 SET INENDX=$ORDER(^INTHU("B",INEND,""),-1)
DO INTER
+8 IF $PIECE(IOST,"-")["C"
IF IO=IO(0)
WRITE !,"Compiling data "
+9 FOR CNT=1:1
SET LOOP=$ORDER(^INTHU(LOOP))
IF 'LOOP!(LOOP>INENDX)
QUIT
Begin DoDot:1
+10 IF IO=$PRINCIPAL
IF '(CNT#1000)
WRITE "."
+11 SET ZE=$GET(^INTHU(LOOP,0))
+12 ; quit if date is out of range
+13 IF +ZE>INAEND
QUIT
+14 ;
+15 ; message creation date and time
+16 ; MSGDT = date
+17 ; MSGTM = time HHMM
+18 SET MSGDT=+$PIECE($PIECE(ZE,U),".")
SET MSGTM=$EXTRACT($PIECE(ZE,U),9,20)
+19 SET MSGDAT=$EXTRACT($PIECE(ZE,U),1,12)
+20 ; get destination
+21 SET DES=$PIECE(ZE,U,2)
IF DES=""
QUIT
+22 ;quit if destination is not on the selected array.
+23 IF INDES
IF '$DATA(DES(DES))
QUIT
+24 ;for message that was created befor the begining date make
+25 ;sure to quit if no work was done later.
+26 IF +ZE<INABEG
IF $PIECE(ZE,U,14)<INABEG
QUIT
DO MULT
QUIT
+27 ;
+28 ;Quit if status is not part of the selection string
+29 IF $FIND(ST,$PIECE(ZE,U,3))<2
QUIT
+30 SET STAT=$PIECE(ZE,U,3)
+31 SET MS=+MSGDAT
IF '$DATA(^UTILITY($JOB,MS))
SET MS=$ORDER(^UTILITY($JOB,MS),-1)
+32 ;following variable does not seem to be used. Verify for 4.6
+33 SET MSGTM=$EXTRACT(MSGTM,1,2)*60+$EXTRACT(MSGTM,3,4)
+34 ;store details. SUM tag summarizes details
+35 SET ^UTILITY($JOB,MS,DES,STAT,INC)=$GET(^UTILITY($JOB,MS,DES,STAT,INC))+1
+36 DO MULT
End DoDot:1
+37 QUIT
MULT ; Look for activity on the multiple level
+1 NEW ACT,ACTLOOP,ACTZE,DTTM,DTDT,DAY
+2 SET ACT=0
+3 FOR ACTLOOP=0:1
SET ACT=$ORDER(^INTHU(LOOP,1,ACT))
IF 'ACT&ACTLOOP
QUIT
Begin DoDot:1
+4 SET ACTZE=""
+5 IF ACT
SET ACTZE=$GET(^INTHU(LOOP,1,ACT,0))
+6 ; Get status
+7 IF $FIND(ST,$PIECE(ACTZE,U,2))<2
QUIT
SET STAT=$PIECE(ACTZE,U,2)
+8 ; Quit if messages has no date/time.
+9 IF +ACTZE=0
QUIT
SET DTTM=$PIECE(ACTZE,U)
+10 IF DTTM>INAEND
QUIT
+11 SET DTDT=$PIECE(DTTM,".")
SET DTTM=$EXTRACT(DTTM,1,12)
+12 SET DAY=+DTTM
IF '$DATA(^UTILITY($JOB,DTTM))
SET DAY=$ORDER(^UTILITY($JOB,DAY),-1)
+13 IF DAY=""
QUIT
SET DTTM=$EXTRACT(DTTM,1,2)*60+$EXTRACT(DTTM,3,4)
+14 SET ^UTILITY($JOB,DAY,DES,STAT,INT)=$GET(^UTILITY($JOB,DAY,DES,STAT,INT))+1
End DoDot:1
+15 QUIT
INTER ;Initalize intervals for all date/time
+1 NEW I,IA,II,III,D,ZZ,OLDTM
+2 SET ZZ=$PIECE(INLOAD,U,3)
SET IA=0
+3 ;last time bracket
+4 SET INLST=$EXTRACT($$ADDT^%ZTFDT(INAEND,0,0,-INTM),1,12)
SET OLDTM=0
+5 FOR
SET X=$EXTRACT($$ADDT^%ZTFDT(INABEG,0,0,(INTM*IA)),1,12)
SET IA=IA+1
IF OLDTM'<INLST
QUIT
Begin DoDot:1
+6 SET OLDTM=X
+7 SET DES=0
FOR
SET DES=$ORDER(DES(DES))
IF 'DES
QUIT
Begin DoDot:2
+8 FOR III=1:1:$LENGTH(ST)
FOR IN=INC,INT
SET ^UTILITY($JOB,X,DES,$EXTRACT(ST,III),IN)=0
End DoDot:2
End DoDot:1
+9 QUIT
+10 ;
OUTPUT ;Output data
+1 WRITE !
SET (DT1,DAY)=0
SET ASTRX=""
SET $PIECE(ASTRX,"*",80)=""
SET POP=0
+2 FOR
SET DAY=$ORDER(^UTILITY($JOB,DAY))
IF DAY=""!(DAY="B")!POP
QUIT
SET TM=""
Begin DoDot:1
+3 DO DT
IF POP
QUIT
+4 SET FLG=1
FOR I=INC,INT
SET X=$GET(^UTILITY($JOB,DAY,I))
DO @I
+5 ;quit here if this is not a detailed report AND only 1 dest is selected
+6 WRITE !
IF 'INDESM
IF 'DET
QUIT
+7 SET FLG=0
SET DES=""
+8 FOR
SET DES=$ORDER(^UTILITY($JOB,DAY,DES))
IF DES=""!POP
QUIT
Begin DoDot:2
+9 ; display destination
+10 IF DES'?.N
WRITE !
QUIT
+11 IF $Y>(IOSL-2)
DO HDR
IF POP
QUIT
DO DT
+12 WRITE !?19,$EXTRACT($PIECE(^INRHD(DES,0),U),1,30)
+13 FOR I=INC,INT
SET X=$GET(^UTILITY($JOB,"B",DAY,DES,I))
IF X=""!POP
QUIT
DO @I
+14 ;Quit if not a detailed report
+15 IF 'DET
QUIT
+16 ; display status
+17 WRITE !
SET ST=""
FOR
SET ST=$ORDER(^UTILITY($JOB,DAY,DES,ST))
IF ST=""!POP
QUIT
Begin DoDot:3
+18 IF ST'?1A
WRITE !
QUIT
+19 IF $Y>(IOSL-2)
SET DT1=""
DO HDR
IF POP
QUIT
DO DT
+20 WRITE ?46,ST
+21 FOR I=INC,INT
SET X=$GET(^UTILITY($JOB,DAY,DES,ST,I))
DO @I
+22 WRITE !
IF $Y>(IOSL-2)
DO HDR
IF 'POP
DO DT
End DoDot:3
End DoDot:2
End DoDot:1
+23 QUIT
+24 ;
CC ;Dsplay details for creation rate
+1 IF $Y>IOSL
SET DT1=""
DO HDR
IF POP
QUIT
DO DT
+2 IF X=""
WRITE !
QUIT
+3 SET P=$SELECT(FLG:24,1:54)
WRITE ?(P-$LENGTH(X)),X
+4 ; display the astrics line
+5 SET X1=$EXTRACT(ASTRX,1,$JUSTIFY(X/DV,0,0))
IF '$LENGTH(X1)
SET X1="*"
+6 IF X=0
SET X1=""
+7 IF $LENGTH(X1)>SE
SET X1=$EXTRACT(X1,1,(SE-2))_">>"
WRITE ?(P+2),X1
+8 QUIT
TT ;Display details for transmission rate
+1 NEW X0
+2 IF X=""
WRITE !
QUIT
+3 SET X0=X
SET X=$EXTRACT(ASTRX,1,$JUSTIFY(X/DV,0,0))
+4 IF '$LENGTH(X)
SET X="*"
IF X0=0
SET X=""
IF $LENGTH(X)>SE
SET X="<<"_$EXTRACT(X,1,(SE-2))
+5 SET X=X_$JUSTIFY(X0,7)
WRITE ?IOM-1-$LENGTH(X),X
+6 QUIT
DT ;Print date time
+1 IF $Y>(IOSL-3)
SET DT1=""
DO HDR
IF POP
QUIT
+2 SET DT2=$$CDATASC^%ZTFDT(DAY,2,1)
+3 WRITE $PIECE(DT2,"@")," ",$PIECE(DT2,"@",2),"-"
+4 SET DT3=$ORDER(^UTILITY($JOB,DAY))
IF 'DT3
WRITE $PIECE($$CDATASC^%ZTFDT(INAEND,2,1),"@",2)
QUIT
+5 SET X=$$ADDT^%ZTFDT(DT3,0,0,-1)
+6 WRITE $PIECE($$CDATASC^%ZTFDT(X,2,1),"@",2)
+7 QUIT
SUM ;Calculate totals for date/time
+1 NEW DAY,DDE,SST,X
+2 SET DAY=""
SET DV=1
+3 FOR
SET DAY=$ORDER(^UTILITY($JOB,DAY))
IF DAY=""&(DAY'?.N1".".N)
QUIT
SET DDE=""
Begin DoDot:1
+4 IF DAY="B"
QUIT
FOR
SET DDE=$ORDER(^UTILITY($JOB,DAY,DDE))
IF DDE=""
QUIT
SET SST=""
Begin DoDot:2
+5 FOR
SET SST=$ORDER(^UTILITY($JOB,DAY,DDE,SST))
IF SST=""
QUIT
Begin DoDot:3
+6 FOR I=INC,INT
Begin DoDot:4
+7 SET X=^UTILITY($JOB,DAY,DDE,SST,I)
+8 ; total for date & time
+9 SET ^UTILITY($JOB,DAY,I)=$GET(^UTILITY($JOB,DAY,I))+X
+10 IF ^UTILITY($JOB,DAY,I)>DV
SET DV=^(I)
+11 ; total for date/time & destination
+12 SET ^UTILITY($JOB,"B",DAY,DDE,I)=$GET(^UTILITY($JOB,"B",DAY,DDE,I))+X
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+13 QUIT
+14 ;
DEV ;Calculate the devisor
+1 SET SE=16
IF 'DET
SET DV=DV/2
SET SE=31
+2 SET DV=$SELECT(DV>9000:1000,DV>4500:500,DV>1900:250,DV>900:100,1:25)
+3 ;
+4 ; Set header
+5 SET X=$$CDATASC^%ZTFDT($HOROLOG,1,1)
SET INLN(0)=X_" Page "
+6 SET INLN(1)="Throughput analyzer report"
+7 IF DET
SET INLN(1)=INLN(1)_" - Detailed"
+8 SET X="From: "_$$CDATASC^%ZTFDT($EXTRACT(INABEG,1,12),3,1)
+9 SET INLN(2)=X_" To: "_$$CDATASC^%ZTFDT($EXTRACT(INAEND,1,12),3,1)
+10 DO ST1^INHRTH1
SET INLN(3)="Status: "_INLN(3)
+11 SET INLN(5)="Divisor: (*) "_DV
+12 SET X=INTM
IF INTM>60
SET X=(INTM\60)_"Hr"
+13 SET INTMI="Time interval: "_X
IF INTM<60
SET INTMI=INTMI_"Minutes"
+14 ;get the site name
+15 SET INSITE=$SELECT($DATA(^DIC(4,^DD("SITE",1),0)):^(0),1:^DD("SITE"))
+16 SET INSITE=$SELECT($PIECE(INSITE,U,4)]"":$PIECE(INSITE,U,4),1:$PIECE(INSITE,U,1))
+17 SET INLN=""
SET $PIECE(INLN,"-",IOM)=""
+18 ;
HDR ;Print header
+1 IF $PIECE(IOST,"-")["C"
IF IO=IO(0)
IF $Y>15
SET X=$$CR^UTSRD
IF X
SET POP=1
QUIT
+2 IF PAG>1!($PIECE(IOST,"-")["C")
WRITE @IOF
+3 WRITE !,INSITE
+4 SET X=INLN(0)_PAG
SET PAG=PAG+1
SET DT1=""
+5 WRITE ?IOM-$LENGTH(X)-2,X,!
+6 FOR I=1:1:4
IF $GET(INLN(I))'=""
WRITE !?IOM-$LENGTH(INLN(I))\2,INLN(I)
+7 WRITE !,"Destination:"
Begin DoDot:1
+8 IF 'INDES
WRITE " All",!
QUIT
+9 SET II=""
FOR
SET II=$ORDER(DES(II))
IF II=""
QUIT
WRITE !?14,DES(II)
End DoDot:1
+10 WRITE !!,INLN(5),!,INTMI,!!,INLN
+11 WRITE !," Date Time"
IF DET
WRITE ?19,"Destination"
+12 IF DET
WRITE ?42,"Status"
+13 SET P=15
IF DET
SET P=40
WRITE !?P,"Creation Rates "
+14 SET X="Transmission Rates"
WRITE ?IOM-$LENGTH(X)-2,X
+15 WRITE !,INLN,!
+16 QUIT
+17 ;