KMPRPG01 ;OAK/RAK - RUM Data for All Nodes (Graph) ;11/19/04 08:58
;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
;
EN ;-- entry point.
;
N DATES,DIR,ELEMENT,I,LHTIME,OPTIONS,OUT,TMP,X,Y
;
; temporary global storage for stats.
S TMP=$NA(^TMP("KMPR HR STATS",$J))
S OUT=0
F D Q:OUT
.D HDR^KMPDUTL4(" Data for All Nodes (Graph) ") W !!
.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^KMPDUG(TMP,TITLES,$G(OPTIONS))
Q
;
EXIT ;
D ^%ZISC
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPRPG01 2002 printed Dec 13, 2024@01:41:39 Page 2
KMPRPG01 ;OAK/RAK - RUM Data for All Nodes (Graph) ;11/19/04 08:58
+1 ;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
+2 ;
EN ;-- entry point.
+1 ;
+2 NEW DATES,DIR,ELEMENT,I,LHTIME,OPTIONS,OUT,TMP,X,Y
+3 ;
+4 ; temporary global storage for stats.
+5 SET TMP=$NAME(^TMP("KMPR HR STATS",$JOB))
+6 SET OUT=0
+7 FOR
Begin DoDot:1
+8 DO HDR^KMPDUTL4(" Data for All Nodes (Graph) ")
WRITE !!
+9 DO GRPHMSG^KMPRUTL
+10 ; select element for display.
+11 DO ELEMENT^KMPRUTL(.Y)
IF 'Y
SET OUT=1
QUIT
+12 SET ELEMENT=Y_"^"_Y(0)
+13 ; get date range.
+14 DO RUMDATES^KMPRUTL(.DATES)
if 'DATES
QUIT
+15 ; determine number of nodes.
+16 SET I=0
SET X=""
+17 FOR
SET X=$ORDER(^KMPR(8971.1,"ANODE",X))
if X=""
QUIT
SET I=I+1
+18 SET OPTIONS="G"
if I<8
SET OPTIONS=OPTIONS_"D"
+19 KILL @TMP
+20 WRITE !!?3,"compiling data for: "
+21 ; get data - display graph - cleanup.
+22 DO DATA
DO GRAPH
DO EXIT
+23 KILL @TMP
End DoDot:1
if OUT
QUIT
+24 ;
+25 QUIT
+26 ;
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^KMPDUG(TMP,TITLES,$GET(OPTIONS))
+12 QUIT
+13 ;
EXIT ;
+1 DO ^%ZISC
+2 QUIT