source: FOIAVistA/trunk/r/CAPACITY_MANAGEMENT_TOOLS-KMPD-KMPL/KMPDTP2.m@ 1614

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1KMPDTP2 ;OAK/RAK - CP Timing Daily Time-to-Load Detail ;2/17/04 09:23
2 ;;2.0;CAPACITY MANAGEMENT TOOLS;**4**;Mar 22, 2002
3 ;
4EN ;-- entry point
5 N KMPDATE,KMPDPTNP,KMPDTTL,POP,X,Y,ZTDESC,ZTRTN,ZTSAVE,ZTSK,%ZIS
6 S KMPDTTL=" Daily Coversheet Time-to-Load (TTL) Detailed Report "
7 D HDR^KMPDUTL4(KMPDTTL)
8 W !
9 W !?7,"This detailed report displays daily time-to-load values for the"
10 W !?7,"coversheet at this site. The report breaks the time-to-load"
11 W !?7,"metrics into ten second groupings."
12 W !
13 ;
14 ; if no data
15 I '$O(^KMPD(8973.2,0)) D Q
16 .W !!?7,"*** There is currently no data in file #8973.2 (CP TIMING) ***"
17 ;
18 ; select date range
19 D DATERNG^KMPDTU10("ORWCV",1,.KMPDATE)
20 Q:$G(KMPDATE(0))=""
21 ;
22 ; select time frame
23 S KMPDPTNP=$$PTNPSEL^KMPDUTL4
24 Q:'KMPDPTNP
25 ;
26 ; select output device.
27 S %ZIS="Q",%ZIS("A")="Device: ",%ZIS("B")="HOME"
28 W ! D ^%ZIS I POP W !,"No action taken." Q
29 ; if queued.
30 I $D(IO("Q")) K IO("Q") D Q
31 .S ZTDESC=KMPDTTL
32 .S ZTRTN="EN1^KMPDTP2"
33 .S ZTSAVE("KMPDATE(")="",ZTSAVE("KMPDPTNP")="",ZTSAVE("KMPDTTL")=""
34 .D ^%ZTLOAD W:$G(ZTSK) !,"Task #",ZTSK
35 .D EXIT
36 ;
37 ; if output to terminal display message.
38 W:$E(IOST,1,2)="C-" !,"Compiling timing stats..."
39 D EN1
40 ;
41 Q
42 ;
43EN1 ;-- entry point from taskman
44 Q:'$D(KMPDATE)
45 Q:'$G(KMPDPTNP)
46 ;
47 K ^TMP($J)
48 D DATA,PRINT,EXIT
49 K ^TMP($J)
50 ;
51 Q
52 ;
53DATA ;-- compile data
54 Q:'$D(KMPDATE)
55 Q:'$G(KMPDPTNP)
56 ;
57 N DATA,DATE,DELTA,DOT,END,I,IEN,PTNP,QUEUED,TOTAL
58 ;
59 S QUEUED=$D(ZTQUEUED),DOT=1
60 S DATE=$P(KMPDATE(0),U)-.1,END=$P(KMPDATE(0),U,2),PTNP=(+KMPDPTNP)
61 Q:'DATE!('END)!('PTNP)
62 ;
63 F S DATE=$O(^KMPD(8973.2,"ASSDTPT","ORWCV",DATE)) Q:'DATE!(DATE>END) D
64 .S (IEN,TOTAL)=0,^TMP($J,DATE)=""
65 .F S IEN=$O(^KMPD(8973.2,"ASSDTPT","ORWCV",DATE,PTNP,IEN)) Q:'IEN D
66 ..Q:'$D(^KMPD(8973.2,IEN,0)) S DATA=^(0) Q:DATA=""
67 ..S DOT=DOT+1 W:'QUEUED&('(DOT#1000)) "."
68 ..S DELTA=$P(DATA,U,4)
69 ..;
70 ..; if delta is null increment by 1 and quit
71 ..I DELTA="" S $P(^TMP($J,DATE),U,50)=$P(^TMP($J,DATE),U,50)+1 Q
72 ..; total
73 ..S TOTAL=TOTAL+1
74 ..;
75 ..; loop - less than I*10 seconds
76 ..F I=1:1:9 I DELTA<(I*10) S $P(^TMP($J,DATE),U,I)=$P(^TMP($J,DATE),U,I)+1 Q
77 ..; 90 or greater seconds
78 ..I DELTA>89 S $P(^TMP($J,DATE),U,10)=$P(^TMP($J,DATE),U,10)+1
79 .;
80 .; back to DATE level
81 .; determine percentage
82 .I TOTAL F I=1:1:10 D
83 ..S $P(^TMP($J,DATE,1),U,I)=$FN($P(^TMP($J,DATE),U,I)/TOTAL*100,"",1)
84 ;
85 Q
86 ;
87PRINT ;-- print data
88 U IO
89 D HDR
90 Q:'$D(^TMP($J))
91 ;
92 N CONT,DATE,I,TOTAL
93 ;
94 S DATE="",CONT=1
95 F S DATE=$O(^TMP($J,DATE)) Q:'DATE D Q:'CONT
96 .S TOTAL=""
97 .S DATA=^TMP($J,DATE),DATA(1)=$G(^TMP($J,DATE,1))
98 .W !,$$FMTE^XLFDT(DATE,2)
99 .; if no data
100 .I DATA="" W ?12,"<No Data for ",$P(KMPDPTNP,U,2),">",! Q
101 .; display data
102 .F I=1:1:10 D
103 ..W ?12
104 ..I I<10 W $J(I-1*10,2)," to <",I*10
105 ..E W "90 or greater"
106 ..W ?28,$J($FN($P(DATA,U,I),",",0),10)
107 ..; percentages
108 ..W ?44,$J($FN($P(DATA(1),U,I),"",1),10),"%",!
109 ..; totals
110 ..S $P(TOTAL,U)=$P(TOTAL,U)+$P(DATA,U,I)
111 ..S $P(TOTAL,U,2)=$P(TOTAL,U,2)+$P(DATA(1),U,I)
112 .;
113 .; back to DATE level
114 .; totals
115 .W ?28,"----------",?44,"----------"
116 .W !?28,$J($FN($P(TOTAL,U),",",0),10)
117 .W ?44,$J($FN($P(TOTAL,U,2),"",0),10),"%"
118 .W !!?12,"Incomplete",?28,$J($FN($P(DATA,U,50),",",0),10)
119 .; page feed if another date
120 .I $O(^TMP($J,DATE)) D
121 ..D CONTINUE^KMPDUTL4("",1,.CONT) Q:'CONT
122 ..D HDR
123 ;
124 I CONT D
125 .; legend
126 .W !!?2,"CV = Coversheet",!?2,"TTL = Time-to-Load"
127 .; pause if output to terminal
128 .D CONTINUE^KMPDUTL4("Press RETURN to continue",1)
129 ;
130 Q
131 ;
132HDR ;-- print header
133 W @IOF
134 S X=$G(KMPDTTL)
135 W !?(80-$L(X)\2),X
136 S X=$P($G(KMPDPTNP),U,2)
137 W !?(80-$L(X)\2),X
138 S X=$G(KMPDATE(0)),X=$P(X,U,3)_" - "_$P(X,U,4)
139 W !?(80-$L(X)\2),X,?61,"Printed: ",$$FMTE^XLFDT(DT,2)
140 W !
141 W !,"Date",?12,"TTL Seconds",?28,"# of CV Loads",?44,"CV Percent"
142 W !,$$REPEAT^XLFSTR("-",IOM)
143 ;
144 Q
145 ;
146EXIT ;-- cleanup on exit
147 S:$D(ZTQUEUED) ZTREQ="@"
148 D ^%ZISC
149 K KMPDATE,KMPDPTNP,KMPDTTL
150 Q
Note: See TracBrowser for help on using the repository browser.