source: WorldVistAEHR/trunk/r/CAPACITY_MANAGEMENT_RUM-KMPR/KMPRPG01.m@ 949

Last change on this file since 949 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1KMPRPG01 ;OAK/RAK - RUM Data for All Nodes (Graph) ;11/19/04 08:58
2 ;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
3 ;
4EN ;-- entry point.
5 ;
6 N DATES,DIR,ELEMENT,I,LHTIME,OPTIONS,OUT,TMP,X,Y
7 ;
8 ; temporary global storage for stats.
9 S TMP=$NA(^TMP("KMPR HR STATS",$J))
10 S OUT=0
11 F D Q:OUT
12 .D HDR^KMPDUTL4(" Data for All Nodes (Graph) ") W !!
13 .D GRPHMSG^KMPRUTL
14 .; select element for display.
15 .D ELEMENT^KMPRUTL(.Y) I 'Y S OUT=1 Q
16 .S ELEMENT=Y_"^"_Y(0)
17 .; get date range.
18 .D RUMDATES^KMPRUTL(.DATES) Q:'DATES
19 .; determine number of nodes.
20 .S I=0,X=""
21 .F S X=$O(^KMPR(8971.1,"ANODE",X)) Q:X="" S I=I+1
22 .S OPTIONS="G" S:I<8 OPTIONS=OPTIONS_"D"
23 .K @TMP
24 .W !!?3,"compiling data for: "
25 .; get data - display graph - cleanup.
26 .D DATA,GRAPH,EXIT
27 .K @TMP
28 ;
29 Q
30 ;
31DATA ;-- compile rum stats per node for selected element.
32 Q:$G(TMP)=""
33 Q:'$G(ELEMENT)
34 Q:'$G(DATES)
35 ;
36 N DAYS,DOTS,I,J,KMPRAR,NODES
37 ;
38 ; determine if dots should be printed to screen while gathering data.
39 S DOTS=$S($E(IOST,1,2)="C-":0,1:1)
40 ; set nodes into NODES() array.
41 D NODEARRY^KMPRUTL("NODES") Q:'$D(NODES)
42 ; get RUM data.
43 D ELEMDATA^KMPRUTL2(+ELEMENT,$P(DATES,U),$P(DATES,U,2),.NODES,"KMPRAR",DOTS)
44 Q:'$D(KMPRAR)
45 ;
46 ; format data into TMP array.
47 S I="",DAYS=$$FMDIFF^XLFDT($P(DATES,U,2),$P(DATES,U))+1
48 F S I=$O(KMPRAR(I)) Q:I="" S J=0 D
49 .F S J=$O(KMPRAR(I,J)) Q:J="" D
50 ..S $P(@TMP@(I,0),U)=I
51 ..S $P(@TMP@(I,0),U,2)=$P(@TMP@(I,0),U,2)+KMPRAR(I,J)
52 .S $P(@TMP@(I,0),U,2)=$FN($P(@TMP@(I,0),U,2)/DAYS,"",2)
53 ;
54 Q
55 ;
56GRAPH ;-- display data in graph.
57 Q:$G(TMP)=""
58 Q:'$G(ELEMENT)
59 ;
60 N TITLES
61 ; graph titles.
62 S $P(TITLES,U)="RUM Data for All Nodes"
63 S $P(TITLES,U,2)="From "_$P($G(DATES),U,3)_" to "_$P($G(DATES),U,4)
64 S $P(TITLES,U,3)=$P(ELEMENT,U,2)_"/per "_$S(+ELEMENT=1!(+ELEMENT=7):"occurrence",1:"sec")
65 S $P(TITLES,U,4)="Node"
66 ; call graphics routine.
67 D EN^KMPDUG(TMP,TITLES,$G(OPTIONS))
68 Q
69 ;
70EXIT ;
71 D ^%ZISC
72 Q
Note: See TracBrowser for help on using the repository browser.