source: WorldVistAEHR/trunk/r/CAPACITY_MANAGEMENT_RUM-KMPR/KMPRPG02.m@ 1742

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1KMPRPG02 ;OAK/RAK - RUM Data by Date for Single Node ;11/19/04 10:32
2 ;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
3 ;
4EN ;-- entry point.
5 ;
6 N DATES,DIR,ELEMENT,I,IORVOFF,IORVON,LHTIME,NODE,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(" RUM Data by Date for Single Node ") 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 .; set up set-of-codes with nodes.
20 .K DIR S DIR(0)="SO^",DIR("A")="Select Node"
21 .S I=0,X=""
22 .F S X=$O(^KMPR(8971.1,"ANODE",X)) Q:X="" D
23 ..S I=I+1,DIR(0)=DIR(0)_I_":"_X_";"
24 .D ^DIR I 'Y S OUT=1 Q
25 .K NODE S NODE(Y(0))=""
26 .S OPTIONS="DGV"
27 .K @TMP
28 .W !!?3,"compiling data for: "
29 .; get data - display graph - cleanup.
30 .D DATA,GRAPH,EXIT
31 .K @TMP
32 ;
33 Q
34 ;
35DATA ;-- compile rum stats per node for selected element.
36 Q:$G(TMP)=""
37 Q:'$G(ELEMENT)
38 Q:'$G(DATES)
39 Q:'$D(NODE)=""
40 ;
41 N DOTS,I,J,KMPRAR
42 ;
43 ; determine if dots should be printed to screen while gathering data.
44 S DOTS=$S($E(IOST,1,2)="C-":0,1:1)
45 ; get RUM data.
46 D ELEMDATA^KMPRUTL2(+ELEMENT,$P(DATES,U),$P(DATES,U,2),.NODE,"KMPRAR",DOTS)
47 Q:'$D(KMPRAR)
48 ;
49 ; format data into TMP array.
50 S I=""
51 F S I=$O(KMPRAR(I)) Q:I="" S J=0 D
52 .F S J=$O(KMPRAR(I,J)) Q:J="" D
53 ..S $P(@TMP@(J,0),U)=$$FMTE^DILIBF(J,2)
54 ..S $P(@TMP@(J,0),U,2)=KMPRAR(I,J)
55 ;
56 Q
57 ;
58GRAPH ;-- display data in graph.
59 Q:$G(TMP)=""
60 Q:'$G(ELEMENT)
61 ;
62 N NODE1,TITLES
63 S NODE1=$O(NODE(""))
64 ; graph titles.
65 S $P(TITLES,U)="RUM Data by Date for Node '"_NODE1_"'"
66 S $P(TITLES,U,2)="From "_$P($G(DATES),U,3)_" to "_$P($G(DATES),U,4)
67 S $P(TITLES,U,3)=$P(ELEMENT,U,2)_"/per "_$S(+ELEMENT=1!(+ELEMENT=7):"occurrence",1:"sec")
68 S $P(TITLES,U,4)="Date"
69 ; call graphics routine.
70 D EN^KMPDUG(TMP,TITLES,$G(OPTIONS))
71 Q
72 ;
73EXIT ;
74 D ^%ZISC
75 Q
Note: See TracBrowser for help on using the repository browser.