source: FOIAVistA/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/AWCMCPR2.m@ 1608

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

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1AWCMCPR2 ;VISN7/THM-CPRS MONITOR HTML CODE [07-07-2003] ; 09 Jan 2004 3:43 PM
2 ;;7.3;TOOLKIT;**84**;Jan 9, 2004
3 ;
4PART1 ; HTML section that creates java applet data
5 ; Variables are killed in calling program
6 ;
7 W "<html><head>",!
8 W "<META HTTP-EQUIV=""Refresh"""," Content=""300; URL="_$P(^AWC(177100.12,1,0),U,6)_"_"_AWCDIVNM_".htm",""">",!
9 W "<title>CPRS Response Time Monitor - "_AWCDIVN1_"</title></head>",!
10 W "<body>",!
11 S AWCY99=$P(^AWC(177100.12,1,0),U),AWCY99=$P($G(^DIC(4,+AWCY99,0)),U)
12 W "<center><H2>"_AWCY99_"</H2>"
13 W "<H4>","CPRS Response Time Monitor for facility -- "_AWCDIVN1,!,"</H4>"
14 D MENU1
15 W "<APPLET CODE=linegraph.class HEIGHT=350 WIDTH="_$S(AWCDHRS=5:800,AWCDHRS=6:850,AWCDHRS=7:900,AWCDHRS=8:950,AWCDHRS=9:1000,AWCDHRS=10:1050,AWCDHRS=11:1100,1:1150)_">",!
16 Q
17 ;
18PART2 ;
19 W "<PARAM NAME=KeyWidth VALUE=80>",!
20 W "<PARAM NAME=LineColor_R_L1 VALUE="_$P(AWCTIULN,",",1)_">",!
21 W "<PARAM NAME=LineColor_G_L1 VALUE="_$P(AWCTIULN,",",2)_">",!
22 W "<PARAM NAME=LineColor_B_L1 VALUE="_$P(AWCTIULN,",",3)_">",!
23 W "<PARAM NAME=LineColor_R_L2 VALUE="_$P(AWCLABLN,",",1)_">",!
24 W "<PARAM NAME=LineColor_G_L2 VALUE="_$P(AWCLABLN,",",2)_">",!
25 W "<PARAM NAME=LineColor_B_L2 VALUE="_$P(AWCLABLN,",",3)_">",!
26 W "<PARAM NAME=LineColor_R_L3 VALUE="_$P(AWCREMLN,",",1)_">",!
27 W "<PARAM NAME=LineColor_G_L3 VALUE="_$P(AWCREMLN,",",2)_">",!
28 W "<PARAM NAME=LineColor_B_L3 VALUE="_$P(AWCREMLN,",",3)_">",!
29 W "<PARAM NAME=yMax VALUE="_AWCMXSEC_">",!
30 W "<PARAM NAME=yMin VALUE=0>",!
31 W "<PARAM NAME=Mode VALUE=0>",!
32 W "<PARAM NAME=Lines VALUE=3>",!
33 W "<PARAM NAME=Title VALUE="""">",!
34 W "<PARAM NAME=Border VALUE=""30"""_">",!
35 W "<PARAM NAME=Grid VALUE="""_AWCGRDON_""">",!
36 W "<PARAM NAME=""lines"" VALUE=1>",!
37 W "<PARAM NAME=""bg_r"" VALUE="_$P(AWCBKGRN,",",1)_">",!
38 W "<PARAM NAME=""bg_g"" VALUE="_$P(AWCBKGRN,",",2)_">",!
39 W "<PARAM NAME=""bg_b"" VALUE="_$P(AWCBKGRN,",",3)_">",!
40 F AWCTYPE=0:0 S AWCTYPE=$O(TMP("AWC",AWCTYPE)) Q:AWCTYPE="" S AWCPCNTR=0 F AWCTIME=-9999:0 S AWCTIME=$O(TMP("AWC",AWCTYPE,AWCTIME)) Q:AWCTIME="" DO
41 .S AWCPCNTR=AWCPCNTR+1,AWCPARAM="VAL"_AWCPCNTR_"_L"_AWCTYPE
42 .W "<PARAM NAME="""_AWCPARAM_""" ","VALUE="""
43 .S AWCDTA=$G(TMP("AWC",AWCTYPE,AWCTIME)),AWCSEC=$P(AWCDTA,U),AWCCNT=$P(AWCDTA,U,2)
44 .S AWCAVG=$S(AWCCNT>0:$J(AWCSEC/AWCCNT,0,2),1:0)
45 .I AWCAVG>AWCMXSEC S AWCAVG=AWCMXSEC ;if average is greater than max, set to max
46 .I AWCAVG<0 S AWCAVG=0 ;no values <0
47 .W +AWCAVG,""">",! ;finish the HTML line
48 .; add the time values for the x-axis
49 S AWCLBCNT=1
50 F YYY=-99999:0 S YYY=$O(^TMP("AWCTTIM",$J,YYY)) Q:YYY="" DO
51 .S Y=YYY
52 .I Y<0 S Y=9999+Y
53 .; format the time, if necessary
54 .I $L(Y)=1 S Y="000"_Y
55 .I $L(Y)=2 S Y="00"_Y
56 .I $L(Y)=3 S Y="0"_Y
57 .W "<PARAM NAME=LAB"_AWCLBCNT_" VALUE="""_$S($E(Y,3,4)=10:"*",$E(Y,3,4)=20:"*",$E(Y,3,4)=40:"*",$E(Y,3,4)=50:"*",1:Y)_""">",! S AWCLBCNT=AWCLBCNT+1
58 ; add the remaining values
59 S (AWCLBCNT,AWCVCNTR)=(AWCLBCNT-1) ;label count and value count
60 W !,"<PARAM NAME=Key_L1 VALUE="_""" - TIU"">",!
61 W "<PARAM NAME=Key_L2 VALUE="_""" - Lab"">",!
62 W "<PARAM NAME=Key_L3 VALUE="_""" - Reminder"">",!!
63 W "<PARAM NAME=NumberOfVals VALUE="_AWCVCNTR_">",!
64 W "<PARAM NAME=NumberOfLabs VALUE="_AWCLBCNT_">",!
65 W "</applet>","<p><h4><center>Response Time In Seconds for the last "_AWCDHRS_" hours </h4>","</center>",!
66 W "<b><h5>Last updated: " D NOW^%DTC S Y=% X ^DD("DD") W Y,!,"</b></h5></body></html>",!
67 D CLOSE^%ZISH("AWCCPR1"),^%ZISC
68 K AWCY99
69 Q
70 ;
71MENU1 ; java script - makes drop-down menu
72 ; goes in <body> portion of page
73 Q:$O(AWCFDIV(0))="" ;only one division at facility
74 S AWCWEBRT=$P(^AWC(177100.12,1,0),U,15) Q:AWCWEBRT="" ;not set up in param file
75 S AWCWL=$L(AWCWEBRT) I $E(AWCWEBRT,AWCWL,AWCWL)'="/" S AWCWEBRT=AWCWEBRT_"/"
76 W "<form name=""jump"">",!
77 W "<select name=""menu"">",!
78 W "<option value=""#"">Other Facilities</option>",!
79 S AWCDVNM="" F S AWCDVNM=$O(AWCFDIV(AWCDVNM)) Q:AWCDVNM="" DO
80 .S AWCDVDTA=AWCFDIV(AWCDVNM),AWCFDIVN=$P(AWCDVDTA,U),AWCDVNB=$P(AWCDVDTA,U,2)
81 .W "<option value=""http://"_AWCWEBRT_$P(AWCFILE,"_")_"_"_AWCDVNB_".htm"_""">"_$P(AWCFDIV(AWCDVNM),U)_"</option>",!
82 W "</select>",!
83 W "<input type=""button"" onClick=""location=document.jump.menu.options[document.jump.menu.selectedIndex].value;"" value=""GO"">",!
84 W "</form>",!
85 Q
Note: See TracBrowser for help on using the repository browser.