source: FOIAVistA/trunk/r/CAPACITY_MANAGEMENT_RUM-KMPR/KMPRPN03.m@ 761

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

initial load of FOIAVistA 6/30/08 version

File size: 2.8 KB
Line 
1KMPRPN03 ;OAK/RAK - Print Package RUM Stats ;11/19/04 09:01
2 ;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
3EN ;-- entry point.
4 ;
5 N %ZIS,CONT,DIR,KMPRDATE,KMPRNAM,MESSAGE,POP
6 N X,Y,ZTDESC,ZTRTN,ZTSAVE,ZTSK
7 ;
8 D HDR^KMPDUTL4(" Package Resource Usage ")
9 W !,?2,"This option will display the package Resource Usage Monitor statistics.",!
10 W ?2,"The printout summarizes the statistics of the options, protocols and",!
11 W ?2,"tasks for a selected namespace as percentages.",!!
12 ;
13 K DIR S DIR(0)="FO^1:999:0^K:X="" "" X"
14 S DIR("A")="Select Package Namespace (case sensitive)"
15 D ^DIR Q:Y=""!(Y="^")
16 S KMPRNAM=Y
17 ;
18 ; determine start date from file 8970.1
19 D RUMDATES^KMPRUTL(.KMPRDATE)
20 Q:'KMPRDATE
21 ;
22 ; select output device.
23 S %ZIS="Q",%ZIS("A")="Device: ",%ZIS("B")="HOME"
24 W ! D ^%ZIS I POP W !,"No action taken." Q
25 ; if queued.
26 I $D(IO("Q")) K IO("Q") D Q
27 .S ZTDESC="RUM Package Resource Usage for '"_KMPRNAM_"'."
28 .S ZTRTN="EN1^KMPRPN03"
29 .S ZTSAVE("KMPRDATE")="",ZTSAVE("KMPRNAM")=""
30 .D ^%ZTLOAD W:$G(ZTSK) !,"Task #",ZTSK
31 .D EXIT
32 ;
33 ; if output to terminal display message.
34 W:$E(IOST,1,2)="C-" !?3,"compiling data for: "
35 ;
36EN1 ;-- entry point from taskman.
37 ;
38 Q:'$G(KMPRDATE)
39 Q:$G(KMPRNAM)=""
40 ;
41 N DOTS,ELEMENT,KMPRARRY
42 ;
43 S DOTS=$S($E(IOST,1,2)="C-":0,1:1)
44 D ELEARRY^KMPRUTL("ELEMENT") Q:'$D(ELEMENT)
45 S KMPRARRY=$NA(^TMP("KMPR PKG %",$J))
46 K @KMPRARRY
47 D PKGDATA^KMPRUTL2(KMPRNAM,$P(KMPRDATE,U),$P(KMPRDATE,U,2),KMPRARRY,DOTS)
48 D PRINT,EXIT
49 K @KMPRARRY
50 ;
51 Q
52 ;
53EXIT ;
54 S:$D(ZTQUEUED) ZTREQ="@"
55 D ^%ZISC
56 K KMPUDATE,KMPUNAM
57 ;
58 Q
59 ;
60PRINT ;-- print data from KMPRARRY.
61 ;
62 Q:'$D(ELEMENT)
63 Q:$G(KMPRARRY)=""
64 ;
65 U IO
66 ;
67 I '$D(@KMPRARRY) D HDR W !,"<<<No Data to Report>>>" Q
68 ;
69 N DATA,I,NODE,PIECE,SITE,TOTALS,TYP
70 ;
71 ; facility name.
72 S SITE=$P($$SITE^VASITE,U,2)
73 S NODE="",CONT=1
74 F S NODE=$O(@KMPRARRY@(NODE)) Q:NODE="" D Q:'CONT
75 .D HDR S I=0
76 .F S I=$O(ELEMENT(I)) Q:'I D Q:'CONT
77 ..W !,$P(ELEMENT(I),U) S PIECE=$P(ELEMENT(I),U,2)
78 ..S TOTALS=$P($G(@KMPRARRY@(NODE,"TOTALS")),U,PIECE)
79 ..F TYP=KMPRNAM,"PRTCL","RPC","HL7","TASK","OTH" D
80 ...S DATA=$P($G(@KMPRARRY@(NODE,TYP)),U,PIECE)
81 ...W ?($S(TYP=KMPRNAM:20,TYP="PRTCL":30,TYP="RPC":40,TYP="HL7":50,TYP="TASK":60,1:70))
82 ...W $J($S('TOTALS:"n/a",1:$FN(DATA/TOTALS*100,"",1)),6)
83 .;
84 .; back to NODE level.
85 .; if no more entries send message else use default.
86 .S MESSAGE=""
87 .S:$O(@KMPRARRY@(NODE))="" MESSAGE="Press RETURN to continue"
88 .D CONTINUE^KMPDUTL4(MESSAGE,2,.CONT)
89 ;
90 Q
91 ;
92HDR ;
93 W:$Y @IOF
94 W !?29,"Package Resource Usage"
95 W !?(80-$L($G(SITE))\2),$G(SITE)
96 W !?17,"Node ",$G(NODE)," from ",$P(KMPRDATE,U,3)," to ",$P(KMPRDATE,U,4)
97 W !?(80-($L(KMPRNAM)+12)\2),"'",KMPRNAM,"' Namespace"
98 W !
99 W !?20," % ",?30," % ",?40," % ",?50," % ",?60," % ",?70,"All Other"
100 W !?20,"Options",?30,"Protocols",?40," RPC",?50," HL7",?60," Tasks",?70,"Packages"
101 W !
102 ;
103 Q
Note: See TracBrowser for help on using the repository browser.