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

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

initial load of FOIAVistA 6/30/08 version

File size: 5.4 KB
Line 
1XTPMSTAT ;OAK/BP - PRINT PATCH STATISTICS BY REPORT GROUP; 2/7/06
2 ;;7.3;TOOLKIT;**98,100**; Apr 25, 1995;Build 4
3 ;
4 S IOP="HOME" D ^%ZIS K IOP
5EN W @IOF,"Patch Monitor Statistics",!!!
6 W "Please select the REPORTING GROUP. You may select as many groups as you",!
7 W "wish for each report. Each group will be reported in a separate section.",!!!
8 K TMP("XTBGRP"),TMP("XTBPKG")
9 N DIC,DA S DIC(0)="AEQM",DIC="^XPD(9.95," D ^DIC S DA(1)=+Y
10 I DA(1)>0 N DIC S DIC(0)="AEQM",DIC="^XPD(9.95,DA(1),2," F D ^DIC Q:Y<0 DO
11 .I $D(TMP("XTBGRP",$P(Y,U,2))) W $C(7),". . . You already have that one" Q
12 .S TMP("XTBGRP",$P(Y,U,2))=+Y
13 G:X[U EXIT
14 G:'$D(TMP("XTBGRP")) EXIT
15 W !!,"Do you want a new form/screen between REPORTING GROUPS" S %=1 D YN^DICN S XTBPGF=%
16 ;
17DATE W ! S %DT="AEP"
18 S %DT("A")="Enter BEGINNING Compliance date: " D ^%DT G:Y<0 EXIT S XTBBDT=Y X ^DD("DD") S XTBBDT1=Y
19 S %DT="AE",%DT("A")=" and ENDING Compliance date: " D ^%DT G:Y<0 EXIT S XTBEDT=Y X ^DD("DD") S XTBEDT1=Y
20 I XTBEDT<XTBBDT W !!,$C(7),"Starting date is later than ending date.",!! H 2 G DATE
21 ;
22DEV W !! S %ZIS="AEQ" D ^%ZIS G:POP EXIT
23 I $D(IO("Q")) S ZTIO=ION,ZTRTN="SORT^XTPMSTAT",ZTSAVE("XTB*")="",ZTSAVE("TMP*")="",ZTDESC="Patch Monitor Statistics" D ^%ZTLOAD D HOME^%ZIS
24 I $D(ZTSK) W !,"Queued as task #",ZTSK H 2 G EXIT
25 ;
26 ; sort patches by compliance date
27SORT U IO F XTBCPLDT=(XTBBDT-.0001):0 S XTBCPLDT=$O(^XPD(9.9,"D",XTBCPLDT)) Q:XTBCPLDT=""!(XTBCPLDT>XTBEDT) DO
28 .F XTBDA=0:0 S XTBDA=$O(^XPD(9.9,"D",XTBCPLDT,XTBDA)) Q:XTBDA="" DO
29 ..S XTBDTA=$G(^XPD(9.9,XTBDA,0)) Q:XTBDTA=""
30 ..S XTBPTNAM=$P(XTBDTA,U,1),XTBNMSP=$P($P(XTBDTA,U,4)," - ",1) Q:XTBNMSP="" ;parent package missing in file
31 ..S XTBRELDT=$P(XTBDTA,U,2),XTBPRIOR=$P(XTBDTA,U,3)
32 ..S TMP("XTBPKG",XTBNMSP,XTBCPLDT,XTBPTNAM,XTBDA)=XTBRELDT_U_XTBPRIOR
33PRINT ; read and print sorted groups
34 S Y=DT X ^DD("DD") S XTBCURDT=Y
35 K XTBLINE S $P(XTBLINE,"-",(IOM-2))="-"
36 S PG=0,XTBGRP="",XTBGRP=$O(TMP("XTBGRP",XTBGRP)) G:XTBGRP="" EXIT D HDR ; first header
37 S (XTBGRP,XTBNMSP,XTBPTNAM,XTBOLDNM,XTBOLGRP)="",(XTBTPTCH,XTBTLATE)=0
38 F S XTBGRP=$O(TMP("XTBGRP",XTBGRP)) Q:XTBGRP="" S XTBGPDA=TMP("XTBGRP",XTBGRP) DO Q:$D(XTBOUT)
39 .; read param file for monitored groups
40 .F S XTBNMSP=$O(^XPD(9.95,1,2,XTBGPDA,1,"B",XTBNMSP)) Q:XTBNMSP="" I $D(TMP("XTBPKG",XTBNMSP)) DO Q:$D(XTBOUT)
41 ..; read sorted namespaces
42 ..F XTBCPLDT=0:0 S XTBCPLDT=$O(TMP("XTBPKG",XTBNMSP,XTBCPLDT)) Q:XTBCPLDT="" F S XTBPTNAM=$O(TMP("XTBPKG",XTBNMSP,XTBCPLDT,XTBPTNAM)) Q:XTBPTNAM="" DO Q:$D(XTBOUT)
43 ...F XTBDA=0:0 S XTBDA=$O(TMP("XTBPKG",XTBNMSP,XTBCPLDT,XTBPTNAM,XTBDA)) Q:XTBDA="" DO Q:$D(XTBOUT)
44 ....S XTBTPTCH=XTBTPTCH+1
45 ....S XTBDTA=TMP("XTBPKG",XTBNMSP,XTBCPLDT,XTBPTNAM,XTBDA)
46 ....S XTBRELDT=$P(XTBDTA,U),XTBPRIOR=$P(XTBDTA,U,2)
47 ....S XTBRCVDT=$P($G(^XPD(9.9,XTBDA,0)),U,2)
48 ....S XTBPTYPE=$P($G(^XPD(9.9,XTBDA,0)),U,10)
49 ....I +XTBPTYPE=0 S D0=XTBDA D ^XTPMKPCF S XTBINSDT=X K D0
50 ....I +XTBPTYPE=1 S XTBINSDT=$P($G(^XPD(9.9,XTBDA,0)),U,11)
51 ....I XTBINSDT]"" S X1=XTBINSDT,X2=XTBCPLDT D ^%DTC S XTBDAYLT=X
52 ....I XTBINSDT="" S X1=DT,X2=XTBCPLDT D ^%DTC S XTBDAYLT=X
53 ....S XTBGRPHD="Report group: "_XTBGRP
54 ....I XTBOLGRP="",PG=1 W XTBGRPHD,!!
55 ....I XTBOLDNM'="",XTBNMSP'=XTBOLDNM W !
56 ....I XTBOLDNM'="",XTBGRP'=XTBOLGRP,XTBPGF=1 D:IOST?1"C-".E PAUSE Q:$D(XTBOUT) D HDR W XTBGRPHD,!!
57 ....I XTBOLDNM'="",XTBGRP'=XTBOLGRP,XTBPGF=0 W !,XTBGRPHD,!!
58 ....I $Y>(IOSL-6),IOST?1"C-".E D PAUSE Q:$D(XTBOUT) D HDR I XTBGRP'=XTBOLGRP W XTBGRPHD,!!
59 ....S Y=XTBINSDT X ^DD("DD") S XTBINSDT=Y
60 ....S Y=XTBCPLDT X ^DD("DD") S XTBCPLDX=Y
61 ....S Y=XTBRELDT X ^DD("DD") S XTBRELDT=Y
62 ....S XTBPRIOR=$S(XTBPRIOR="m":"Mandatory",XTBPRIOR="e":"Emergency",1:"Unknown")
63 ....W XTBCPLDX,?14,XTBPTNAM,?27,XTBRELDT,?41,XTBINSDT,?55,XTBPRIOR
64 ....I XTBDAYLT>0 W ?67,$J(XTBDAYLT,3,0)_$S(XTBDAYLT>1:" days",1:" day") S XTBTLATE=XTBTLATE+1
65 ....W ! S XTBOLDNM=XTBNMSP,XTBOLGRP=XTBGRP
66 ....I $Y>(IOSL-6),IOST?1"C-".E D PAUSE Q:$D(XTBOUT)
67 ....I $Y>(IOSL-6) D HDR I XTBGRP'=XTBOLGRP W XTBGRPHD,!!
68 G:$D(XTBOUT) EXIT
69 I $Y>(IOSL-6),IOST?1"C-".E D HDR
70 W !!?6,"Totals patches received for date range: ",XTBTPTCH,!
71 W "Total patches installed past compliance date: ",XTBTLATE,!!
72 S XTBDIVOK=0 I XTBTPTCH>0 S XTBDIVOK=1
73 W ?25,"Delinquent patch % : ",$S(XTBDIVOK=1:$J((XTBTLATE/XTBTPTCH*100),6,2),1:0)_" %",!
74 W ?25," Compliance % : ",$S(XTBDIVOK=1:$J(100-(XTBTLATE/XTBTPTCH*100),6,2),1:0)," %",!
75 I IOST?1"C-".E K XTBANS W !!,"Press ENTER to end " R XTBANS:DTIME
76 ;
77EXIT I IOST?1"C-".E W @IOF,!
78 D ^%ZISC
79 K %,%DT,%ZIS,XTBNMSP,XTBANS,XTBBDT,XTBBDT1,XTBCPLDT,XTBCPLDX,XTBDA,XTBEDT,XTBEDT1,XTBDAYLT,TMP
80 K XTBGRPDA,XTBGRP,XTBINSDT,XTBLINE,XTBNMSP,XTBOLDNM,XTBNMSP,XTBPTNAM,XTBPTYPE,XTBDTA,XTBGPDA
81 K XTBRCVDT,XTBTLATE,XTBTPTCH,D0,DIC,PG,POP,X,X1,X2,Y,ZTDESC,ZTIO,ZTRTN,ZTSAVE,%T,%Y,XTBGRPHD
82 K TMP("XTBGRP"),TMP("XTBPKG"),XTBOUT,XTBPGF,XTBOLGRP,ZTSK,XTBRELDT,XTBPRIOR,XTBCURDT,XTBDIVOK
83 Q
84 ;
85HDR S PG=PG+1 I IOST?1"P-".E,PG>1 W @IOF
86 I IOST?1"C-".E W @IOF
87 W XTBCURDT S X="Patch Statistical Report for "_^DD("SITE")
88 W ?(IOM-$L(X)\2),X,?(IOM-12),"Page: ",PG,!
89 S X="Date range: "_XTBBDT1_" to "_XTBEDT1 W ?(IOM-$L(X)\2),X,!
90 W !,"Compliance",?14,"Patch",?27,"Release",?41,"Install",?67,"# Days",!
91 W "Date",?14,"Number",?27,"Date",?41,"Date",?55,"Priority",?67,"Delinquent",!,XTBLINE,!
92 Q
93 ;
94PAUSE Q:IOST'?1"C-".E
95 K XTBANS,XTBOUT W !!,"Press ENTER to continue or '^' to end " R XTBANS:DTIME
96 I XTBANS[U!('$T) S (XTBNMSP,XTBPTNAM,XTBCPLDT,XTBDA)="ZZZZZZ",XTBOUT=1
97 Q
Note: See TracBrowser for help on using the repository browser.