KMPRPG02 ;SFISC/RAK - RUM Data by Date for Single Node ;27 Oct 1998
;;1.0;CAPACITY MANAGEMENT - RUM;;Dec 09, 1998
;
EN ;-- entry point.
;
N DATES,DIR,ELEMENT,I,IORVOFF,IORVON,LHTIME,NODE,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,!?23,IORVON," RUM Data by Date for Single Node ",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
.; set up set-of-codes with nodes.
.K DIR S DIR(0)="SO^",DIR("A")="Select Node"
.S I=0,X=""
.F S X=$O(^KMPR(8971.1,"ANODE",X)) Q:X="" D
..S I=I+1,DIR(0)=DIR(0)_I_":"_X_";"
.D ^DIR I 'Y S OUT=1 Q
.K NODE S NODE(Y(0))=""
.S OPTIONS="DGV"
.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)
Q:'$D(NODE)=""
;
N DOTS,I,J,KMPRAR
;
; determine if dots should be printed to screen while gathering data.
S DOTS=$S($E(IOST,1,2)="C-":0,1:1)
; get RUM data.
D ELEMDATA^KMPRUTL2(+ELEMENT,$P(DATES,U),$P(DATES,U,2),.NODE,"KMPRAR",DOTS)
Q:'$D(KMPRAR)
;
; format data into TMP array.
S I=""
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@(J,0),U)=$$FMTE^DILIBF(J,2)
..S $P(@TMP@(J,0),U,2)=KMPRAR(I,J)
;
Q
;
GRAPH ;-- display data in graph.
Q:$G(TMP)=""
Q:'$G(ELEMENT)
;
N NODE1,TITLES
S NODE1=$O(NODE(""))
; graph titles.
S $P(TITLES,U)="RUM Data by Date for Node '"_NODE1_"'"
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)="Date"
; call graphics routine.
D EN^KMPUG(TMP,TITLES,$G(OPTIONS))
Q
;
EXIT ;
D ^%ZISC
Q
KMPRPG02 ;SFISC/RAK - RUM Data by Date for Single Node ;27 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,NODE,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,!?23,IORVON," RUM Data by Date for Single Node ",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 ; set up set-of-codes with nodes.
+17 KILL DIR
SET DIR(0)="SO^"
SET DIR("A")="Select Node"
+18 SET I=0
SET X=""
+19 FOR
SET X=$ORDER(^KMPR(8971.1,"ANODE",X))
IF X=""
QUIT
Begin DoDot:2
+20 SET I=I+1
SET DIR(0)=DIR(0)_I_":"_X_";"
End DoDot:2
+21 DO ^DIR
IF 'Y
SET OUT=1
QUIT
+22 KILL NODE
SET NODE(Y(0))=""
+23 SET OPTIONS="DGV"
+24 KILL @TMP
+25 WRITE !!?3,"compiling data for: "
+26 ; get data - display graph - cleanup.
+27 DO DATA
DO GRAPH
DO EXIT
+28 KILL @TMP
End DoDot:1
IF OUT
QUIT
+29 ;
+30 QUIT
+31 ;
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 IF '$DATA(NODE)=""
QUIT
+5 ;
+6 NEW DOTS,I,J,KMPRAR
+7 ;
+8 ; determine if dots should be printed to screen while gathering data.
+9 SET DOTS=$SELECT($EXTRACT(IOST,1,2)="C-":0,1:1)
+10 ; get RUM data.
+11 DO ELEMDATA^KMPRUTL2(+ELEMENT,$PIECE(DATES,U),$PIECE(DATES,U,2),.NODE,"KMPRAR",DOTS)
+12 IF '$DATA(KMPRAR)
QUIT
+13 ;
+14 ; format data into TMP array.
+15 SET I=""
+16 FOR
SET I=$ORDER(KMPRAR(I))
IF I=""
QUIT
SET J=0
Begin DoDot:1
+17 FOR
SET J=$ORDER(KMPRAR(I,J))
IF J=""
QUIT
Begin DoDot:2
+18 SET $PIECE(@TMP@(J,0),U)=$$FMTE^DILIBF(J,2)
+19 SET $PIECE(@TMP@(J,0),U,2)=KMPRAR(I,J)
End DoDot:2
End DoDot:1
+20 ;
+21 QUIT
+22 ;
GRAPH ;-- display data in graph.
+1 IF $GET(TMP)=""
QUIT
+2 IF '$GET(ELEMENT)
QUIT
+3 ;
+4 NEW NODE1,TITLES
+5 SET NODE1=$ORDER(NODE(""))
+6 ; graph titles.
+7 SET $PIECE(TITLES,U)="RUM Data by Date for Node '"_NODE1_"'"
+8 SET $PIECE(TITLES,U,2)="From "_$PIECE($GET(DATES),U,3)_" to "_$PIECE($GET(DATES),U,4)
+9 SET $PIECE(TITLES,U,3)=$PIECE(ELEMENT,U,2)_"/per "_$SELECT(+ELEMENT=1!(+ELEMENT=7):"occurrence",1:"sec")
+10 SET $PIECE(TITLES,U,4)="Date"
+11 ; call graphics routine.
+12 DO EN^KMPUG(TMP,TITLES,$GET(OPTIONS))
+13 QUIT
+14 ;
EXIT ;
+1 DO ^%ZISC
+2 QUIT