KMPRPG02 ;OAK/RAK - RUM Data by Date for Single Node ;11/19/04 10:32
;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
;
EN ;-- entry point.
;
N DATES,DIR,ELEMENT,I,IORVOFF,IORVON,LHTIME,NODE,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(" RUM Data by Date for Single Node ") 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
.; 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^KMPDUG(TMP,TITLES,$G(OPTIONS))
Q
;
EXIT ;
D ^%ZISC
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPRPG02 2005 printed Nov 22, 2024@16:51:52 Page 2
KMPRPG02 ;OAK/RAK - RUM Data by Date for Single Node ;11/19/04 10:32
+1 ;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
+2 ;
EN ;-- entry point.
+1 ;
+2 NEW DATES,DIR,ELEMENT,I,IORVOFF,IORVON,LHTIME,NODE,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(" RUM Data by Date for Single Node ")
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 ; set up set-of-codes with nodes.
+16 KILL DIR
SET DIR(0)="SO^"
SET DIR("A")="Select Node"
+17 SET I=0
SET X=""
+18 FOR
SET X=$ORDER(^KMPR(8971.1,"ANODE",X))
if X=""
QUIT
Begin DoDot:2
+19 SET I=I+1
SET DIR(0)=DIR(0)_I_":"_X_";"
End DoDot:2
+20 DO ^DIR
IF 'Y
SET OUT=1
QUIT
+21 KILL NODE
SET NODE(Y(0))=""
+22 SET OPTIONS="DGV"
+23 KILL @TMP
+24 WRITE !!?3,"compiling data for: "
+25 ; get data - display graph - cleanup.
+26 DO DATA
DO GRAPH
DO EXIT
+27 KILL @TMP
End DoDot:1
if OUT
QUIT
+28 ;
+29 QUIT
+30 ;
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^KMPDUG(TMP,TITLES,$GET(OPTIONS))
+13 QUIT
+14 ;
EXIT ;
+1 DO ^%ZISC
+2 QUIT