KMPRPG01 ;SFISC/RAK - RUM Data for All Nodes (Graph) ;22 Oct 1998
;;1.0;CAPACITY MANAGEMENT - RUM;;Dec 09, 1998
;
EN ;-- entry point.
;
N DATES,DIR,ELEMENT,I,IORVOFF,IORVON,LHTIME,OPTIONS,OUT,TMP,X,Y
;
D ZIS^KMPRUTL
; temporary global storage for stats.
S TMP=$NA(^TMP("KMPR HR STATS",$J))
S OUT=0
F D Q:OUT
.W @IOF,!?30,IORVON," Data for All Nodes (Graph) ",IORVOFF,!!
.D GRPHMSG^KMPRUTL
.; select element for display.
.D ELEMENT^KMPRUTL(.Y) I 'Y S OUT=1 Q
.S ELEMENT=Y_"^"_Y(0)
.; get date range.
.D RUMDATES^KMPRUTL(.DATES) Q:'DATES
.; determine number of nodes.
.S I=0,X=""
.F S X=$O(^KMPR(8971.1,"ANODE",X)) Q:X="" S I=I+1
.S OPTIONS="G" S:I<8 OPTIONS=OPTIONS_"D"
.K @TMP
.W !!?3,"compiling data for: "
.; get data - display graph - cleanup.
.D DATA,GRAPH,EXIT
.K @TMP
;
Q
;
DATA ;-- compile rum stats per node for selected element.
Q:$G(TMP)=""
Q:'$G(ELEMENT)
Q:'$G(DATES)
;
N DAYS,DOTS,I,J,KMPRAR,NODES
;
; determine if dots should be printed to screen while gathering data.
S DOTS=$S($E(IOST,1,2)="C-":0,1:1)
; set nodes into NODES() array.
D NODEARRY^KMPRUTL("NODES") Q:'$D(NODES)
; get RUM data.
D ELEMDATA^KMPRUTL2(+ELEMENT,$P(DATES,U),$P(DATES,U,2),.NODES,"KMPRAR",DOTS)
Q:'$D(KMPRAR)
;
; format data into TMP array.
S I="",DAYS=$$FMDIFF^XLFDT($P(DATES,U,2),$P(DATES,U))+1
F S I=$O(KMPRAR(I)) Q:I="" S J=0 D
.F S J=$O(KMPRAR(I,J)) Q:J="" D
..S $P(@TMP@(I,0),U)=I
..S $P(@TMP@(I,0),U,2)=$P(@TMP@(I,0),U,2)+KMPRAR(I,J)
.S $P(@TMP@(I,0),U,2)=$FN($P(@TMP@(I,0),U,2)/DAYS,"",2)
;
Q
;
GRAPH ;-- display data in graph.
Q:$G(TMP)=""
Q:'$G(ELEMENT)
;
N TITLES
; graph titles.
S $P(TITLES,U)="RUM Data for All Nodes"
S $P(TITLES,U,2)="From "_$P($G(DATES),U,3)_" to "_$P($G(DATES),U,4)
S $P(TITLES,U,3)=$P(ELEMENT,U,2)_"/per "_$S(+ELEMENT=1!(+ELEMENT=7):"occurrence",1:"sec")
S $P(TITLES,U,4)="Node"
; call graphics routine.
D EN^KMPUG(TMP,TITLES,$G(OPTIONS))
Q
;
EXIT ;
D ^%ZISC
Q
KMPRPG01 ;SFISC/RAK - RUM Data for All Nodes (Graph) ;22 Oct 1998
+1 ;;1.0;CAPACITY MANAGEMENT - RUM;;Dec 09, 1998
+2 ;
EN ;-- entry point.
+1 ;
+2 NEW DATES,DIR,ELEMENT,I,IORVOFF,IORVON,LHTIME,OPTIONS,OUT,TMP,X,Y
+3 ;
+4 DO ZIS^KMPRUTL
+5 ; temporary global storage for stats.
+6 SET TMP=$NAME(^TMP("KMPR HR STATS",$JOB))
+7 SET OUT=0
+8 FOR
Begin DoDot:1
+9 WRITE @IOF,!?30,IORVON," Data for All Nodes (Graph) ",IORVOFF,!!
+10 DO GRPHMSG^KMPRUTL
+11 ; select element for display.
+12 DO ELEMENT^KMPRUTL(.Y)
IF 'Y
SET OUT=1
QUIT
+13 SET ELEMENT=Y_"^"_Y(0)
+14 ; get date range.
+15 DO RUMDATES^KMPRUTL(.DATES)
IF 'DATES
QUIT
+16 ; determine number of nodes.
+17 SET I=0
SET X=""
+18 FOR
SET X=$ORDER(^KMPR(8971.1,"ANODE",X))
IF X=""
QUIT
SET I=I+1
+19 SET OPTIONS="G"
IF I<8
SET OPTIONS=OPTIONS_"D"
+20 KILL @TMP
+21 WRITE !!?3,"compiling data for: "
+22 ; get data - display graph - cleanup.
+23 DO DATA
DO GRAPH
DO EXIT
+24 KILL @TMP
End DoDot:1
IF OUT
QUIT
+25 ;
+26 QUIT
+27 ;
DATA ;-- compile rum stats per node for selected element.
+1 IF $GET(TMP)=""
QUIT
+2 IF '$GET(ELEMENT)
QUIT
+3 IF '$GET(DATES)
QUIT
+4 ;
+5 NEW DAYS,DOTS,I,J,KMPRAR,NODES
+6 ;
+7 ; determine if dots should be printed to screen while gathering data.
+8 SET DOTS=$SELECT($EXTRACT(IOST,1,2)="C-":0,1:1)
+9 ; set nodes into NODES() array.
+10 DO NODEARRY^KMPRUTL("NODES")
IF '$DATA(NODES)
QUIT
+11 ; get RUM data.
+12 DO ELEMDATA^KMPRUTL2(+ELEMENT,$PIECE(DATES,U),$PIECE(DATES,U,2),.NODES,"KMPRAR",DOTS)
+13 IF '$DATA(KMPRAR)
QUIT
+14 ;
+15 ; format data into TMP array.
+16 SET I=""
SET DAYS=$$FMDIFF^XLFDT($PIECE(DATES,U,2),$PIECE(DATES,U))+1
+17 FOR
SET I=$ORDER(KMPRAR(I))
IF I=""
QUIT
SET J=0
Begin DoDot:1
+18 FOR
SET J=$ORDER(KMPRAR(I,J))
IF J=""
QUIT
Begin DoDot:2
+19 SET $PIECE(@TMP@(I,0),U)=I
+20 SET $PIECE(@TMP@(I,0),U,2)=$PIECE(@TMP@(I,0),U,2)+KMPRAR(I,J)
End DoDot:2
+21 SET $PIECE(@TMP@(I,0),U,2)=$FNUMBER($PIECE(@TMP@(I,0),U,2)/DAYS,"",2)
End DoDot:1
+22 ;
+23 QUIT
+24 ;
GRAPH ;-- display data in graph.
+1 IF $GET(TMP)=""
QUIT
+2 IF '$GET(ELEMENT)
QUIT
+3 ;
+4 NEW TITLES
+5 ; graph titles.
+6 SET $PIECE(TITLES,U)="RUM Data for All Nodes"
+7 SET $PIECE(TITLES,U,2)="From "_$PIECE($GET(DATES),U,3)_" to "_$PIECE($GET(DATES),U,4)
+8 SET $PIECE(TITLES,U,3)=$PIECE(ELEMENT,U,2)_"/per "_$SELECT(+ELEMENT=1!(+ELEMENT=7):"occurrence",1:"sec")
+9 SET $PIECE(TITLES,U,4)="Node"
+10 ; call graphics routine.
+11 DO EN^KMPUG(TMP,TITLES,$GET(OPTIONS))
+12 QUIT
+13 ;
EXIT ;
+1 DO ^%ZISC
+2 QUIT