source: WorldVistAEHR/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XTPMKPTC.m@ 1150

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

initial load of WorldVistAEHR

File size: 9.0 KB
Line 
1XTPMKPTC ;OAK/BP - PATCH MONITOR FUNCTIONS ; 2/7/06
2 ;;7.3;TOOLKIT;**98,100**; Apr 25, 1995;Build 4
3 ;
4SRVR N XMB X XMREC
5 S XTBMLN1=$G(^XMB(3.9,XMZ,0))
6 I XTBMLN1["COMPLIANCE DATE CHANGE" G CKCMPDT
7 ;
8CHECK I XTBMLN1["TEST" G EXIT
9 I XTBMLN1["COMPLIANCE DATE CHANGE" G CKCMPDT
10 I XTBMLN1["Entered in error patch" DO I $D(OUT) K OUT G EXIT
11 .F XTBX=1:1:8 S XTBY=$G(^XMB(3.9,XMZ,2,+XTBX,0)) I XTBY["The patch is" DO Q:$D(OUT)
12 ..K OUT S X=$P(XTBY,"'",2),DIC(0)="QLM",DIC="^XPD(9.9," D ^DIC I Y<0 S OUT=1 Q
13 ..S DIK=DIC,DA=+Y D ^DIK K DIC,DIK,DA,XTBX,XTBY,Y,X S OUT=1 Q
14 I XTBMLN1'["SEQ #"!(XTBMLN1'["National Patch Module") G EXIT
15 ;
16CKCMPDT D CMPDTCG^XTPMKPCF I $D(XTBCMDCG) K XTBCMDCG G EXIT ;compliance date chg check
17 S XTBPTYPE=1 ;assume NON-KIDS until verified
18 F XTBX=0:0 S XTBX=$O(^XMB(3.9,XMZ,2,XTBX)) Q:XTBX=""!(+XTBX=0) S XTBY=$G(^XMB(3.9,XMZ,2,XTBX,0)) I XTBY["$KID" DO
19 .S XTBZ=$O(^XMB(3.9,XMZ,2,XTBX)) I $G(^XMB(3.9,XMZ,2,XTBZ,0))["**INSTALL NAME**" S XTBPTYPE="",XTBX=9999999 Q
20 ;
21EXTINFO S (XTBDESG,XTBPKG,XTBPRIO,XTBVER,XTBSEQ,XTBSUB)=""
22 F X XMREC Q:XMER<0!(XMRG["Description") DO Q:$D(NOFILE)
23 .K NOFILE
24 .Q:XMRG["====="
25 .I XMRG["Designation" S (XTBDESG,XTBINST)=$P(XMRG,"Designation: ",2) Q:$D(NOFILE) DO
26 ..S XTBY=$P(XTBDESG,"*",2) I XTBY'?1.2N1".".N S XTBY=XTBY_".0",$P(XTBINST,"*",2)=XTBY
27 .I XTBDESG="" S NOFILE=1 Q
28 .I $D(^XPD(9.9,"B",XTBDESG)) S NOFILE=1 Q ; already done
29 .I XMRG["Package" DO
30 ..S XTBPKG=$P(XMRG,"Package : ",2),XTBPKG=$P(XTBPKG,"Priority: ",1),XTBPKG=$E(XTBPKG,1,35)
31 ..S XTBX=$L(XTBPKG)
32 ..F XX=XTBX:-1 S XTBY=$E(XTBPKG,XX,XX) Q:($A(XTBY)>64)!(XTBY="") I $A(XTBY)=32 S $E(XTBPKG,XX,XX)="z"
33 ..I XTBPKG["z" S XTBPKG=$P(XTBPKG,"z",1)
34 .I XMRG["Priority" S XTBPRIO=$P(XMRG,"Priority: ",2) DO
35 ..S XTBPRIO=$P(XTBPRIO," ",1) S X=XTBPRIO X ^%ZOSF("UPPERCASE") S XTBPRIO=X
36 .I XMRG["Version" S XTBVER=$P(XMRG,"Version: ",1) DO
37 ..S XTBSEQ=$P(XTBVER,"#",2),XTBSEQ=$P(XTBSEQ," ",1)
38 ..S XTBVER=$P(XTBVER,"Version : ",2),XTBVER=+XTBVER
39 .I XMRG["Compliance Date:" S XTBCMPDT=$P(XMRG,"Compliance Date: ",2)
40 .I XMRG["Subject" S XTBSUB=$P(XMRG,"Subject: ",2),XTBSUB=$E(XTBSUB,1,50),XTBSUB=$TR(XTBSUB,":;","--")
41 G:$D(NOFILE) EXIT
42 ;
43FILE K DO,DD S (DIC,DIE)="^XPD(9.9,",DIC(0)="M",X=XTBDESG
44 S XTBRCPDT=$G(^XMB(3.9,XMZ,.6)) I XTBRCPDT="" S XTBRCPDT=DT
45 S DIC("DR")="1////"_XTBRCPDT_";2///"_XTBPRIO_";3///"_XTBPKG_";4////"_XTBSEQ_";5////"_XTBVER_";6///"_XTBSUB_";7///"_XTBINST_";8///"_XTBCMPDT_";11////"_XTBPTYPE
46 D FILE^DICN
47 ;
48EXIT G EXITA^XTPMKPCF
49 ;
50NIGHT S XTBPURGI=$P($G(^XPD(9.95,1,0)),U,3) ;purge y/n
51 K ^TMP($J) S XTBX="",XTBLN=8,XTBCNT=0
52 S NIGHT=1 D TEXT S Y=DT X ^DD("DD") S XTBRUNDT=Y
53 F S XTBX=$O(^XPD(9.9,"B",XTBX)) Q:XTBX="" F XTBDA=0:0 S XTBDA=$O(^XPD(9.9,"B",XTBX,XTBDA)) Q:XTBDA="" DO
54 .K XTBKILLD
55 .S XTBDTA=$G(^XPD(9.9,XTBDA,0)) Q:XTBDTA=""
56 .S XTBINST=$P(XTBDTA,U,8) Q:XTBINST=""
57 .S XTBPTYPE=$P(XTBDTA,U,10)
58 .S XTBXX=$O(^XPD(9.7,"B",XTBINST,9999999999),-1) I $G(^XPD(9.7,+XTBXX,2))[" TEST v" S XTBXX=""
59 .I $P($G(^XPD(9.7,+XTBXX,0)),U,9)=3!(XTBPTYPE=1&($P(XTBDTA,U,11)]"")),XTBPURGI=1 DO Q:$D(XTBKILLD) ; installed, check purge flag
60 ..S DA=XTBDA,DIK="^XPD(9.9," D ^DIK S XTBKILLD=1 K DA,DIK Q
61 .I XTBXX]"",XTBPTYPE=1 S XTBPTYPE="",$P(^XPD(9.9,XTBDA,0),U,10)="" ;found In INSTALL
62 .Q:XTBPTYPE=1&($P(XTBDTA,U,11)]"") ;non-kids, has install date
63 .Q:$P($G(^XPD(9.7,+XTBXX,0)),U,9)=3
64 .I (DT>$P(XTBDTA,U,9)) D SET
65 I '$D(^TMP($J,9,0)) K ^TMP($J) S ^TMP($J,3,0)="",^TMP($J,4,0)=" No Delinquent Patches were found."
66 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
67 I XTBCNT>0 S ^TMP($J,XTBLN,0)="Total: "_XTBCNT,XTBLN=XTBLN+1
68 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
69 S XMSUB="Patch Monitor Report for "_^DD("SITE")_" for "_XTBRUNDT
70 N DUZ S XMDUZ=.5,XMTEXT="^TMP($J,",XMY("G.XTPM PATCH MONITOR")="",XMY(.5)="" D ^XMD
71 ; purge old data
72 I +XTBPURGI=0 D ^XTPMKPP
73 G EXIT
74 ;
75SET S XTBPTNM=$P(XTBDTA,U,1),XTBSUBJ=$E($P(XTBDTA,U,7),1,20)
76 S X=$P(XTBDTA,U,3),XTBPRIO=$S(X="m":"Mandatory",X="e":"Emergency",1:"Unknown")
77 S (X1,Y)=$P(XTBDTA,U,2) X ^DD("DD") S XTBRECPT=Y
78 S (Y,YY1)=$P(XTBDTA,U,9) X ^DD("DD") S XTBINSTX=Y ; compliance date
79 I YY1<DT,'$D(NIGHT) S XTBINSTX=Y_" *"
80 S XTBPKG=$P(XTBPTNM,"*",1),XTBPKGPT=$O(^DIC(9.4,"C",XTBPKG,0))
81 S XTBPCTVR=+$P(XTBPTNM,"*",2),XTBPLVER=+$G(^DIC(9.4,+XTBPKGPT,"VERSION"))
82 I XTBPCTVR>XTBPLVER,XTBPLVER>0 S XTBINSTX="Future Version"
83 I XTBPCTVR>XTBPLVER,XTBPLVER=0 S $P(^XPD(9.9,XTBDA,0),U,10)=1,XTBINSTX="CompleteByHand"
84 I XTBPCTVR=999 S XTBINSTX="CompleteByHand" ;mainly new Mailman domains
85 I XTBINSTX="Future Version"&($D(NIGHT)) Q
86 I XTBINSTX="Future Version"&($D(XTBPSTD)) Q
87 S XTBLN=XTBLN+1 ; first line=9
88 S XTBCNT=XTBCNT+1
89 S XTBDTA=""
90 S $E(XTBDTA,1)=XTBPTNM,$E(XTBDTA,15)=XTBSUBJ,$E(XTBDTA,38)=XTBPRIO,$E(XTBDTA,51)=XTBRECPT,$E(XTBDTA,64)=XTBINSTX
91 S ^TMP($J,XTBLN,0)=XTBDTA,XTBLN=XTBLN+1
92 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
93 Q
94 ;
95TEXT S ^TMP($J,1,0)=""
96 S ^TMP($J,2,0)="The following patches are not installed at this site and are past the"
97 S ^TMP($J,3,0)="designated installation time:"
98 S ^TMP($J,4,0)=""
99 S ^TMP($J,5,0)=" Compliance"
100 S ^TMP($J,6,0)="Patch # Subject Priority Recpt Date Date"
101 S ^TMP($J,7,0)="------- ------- -------- ----- ---- ----------"
102 S ^TMP($J,8,0)=""
103 Q
104 ;
105REG ; regular notification
106 K ^TMP($J) S XTBX="",XTBLN=8,XTBCNT=0
107 D TEXT S Y=DT X ^DD("DD") S XTBRUNDT=Y
108 S ^TMP($J,2,0)="The following patches are uninstalled at this site:" K ^TMP($J,3,0)
109 F S XTBX=$O(^XPD(9.9,"B",XTBX)) Q:XTBX="" F XTBDA=0:0 S XTBDA=$O(^XPD(9.9,"B",XTBX,XTBDA)) Q:XTBDA="" DO
110 .S XTBDTA=$G(^XPD(9.9,XTBDA,0)),XTBINST=$P(XTBDTA,U,8)
111 .Q:XTBDTA=""!(XTBINST="") ;no data or no install name
112 .S XTBXX=$O(^XPD(9.7,"B",XTBINST,9999999999),-1) I $G(^XPD(9.7,+XTBXX,2))[" TEST v" S XTBXX=""
113 .Q:$P(XTBDTA,U,10)=1&($P(XTBDTA,U,11)]"") ;non-kids
114 .Q:$P($G(^XPD(9.7,+XTBXX,0)),U,9)=3
115 .D SET
116 I '$D(^TMP($J,9,0)) G EXIT
117 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
118 S ^TMP($J,XTBLN,0)="Total: "_XTBCNT,XTBLN=XTBLN+1
119 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
120 S XMSUB="Uninstalled Patch Report for "_^DD("SITE")_" for "_XTBRUNDT
121 N DUZ K XMY
122 S XMDUZ=.5,XMTEXT="^TMP($J," D MG,^XMD
123 G EXIT
124 ;
125RPT W @IOF,!,"Complete Uninstalled Patch Report for "_^DD("SITE"),!!!
126 S %ZIS="AEQ" D ^%ZIS G:POP EXIT
127 I $D(IO("Q")) S ZTIO=ION,ZTSAVE="",ZTRTN="RPT1^XTPMKPTC",ZTDESC="Uninstalled Patch Report" D ^%ZTLOAD D HOME^%ZIS
128 I $D(ZTSK) W !,"Queued as task# ",ZTSK,!! H 2 G EXIT
129 ;
130RPT1 U IO K ^TMP($J) S XTBX="",XTBLN=8,XTBCNT=0
131 D TEXT S Y=DT X ^DD("DD") S XTBRUNDT=Y
132 K ^TMP($J,2,0),^TMP($J,3,0)
133 F S XTBX=$O(^XPD(9.9,"B",XTBX)) Q:XTBX="" F XTBDA=0:0 S XTBDA=$O(^XPD(9.9,"B",XTBX,XTBDA)) Q:XTBDA="" DO
134 .S XTBDTA=$G(^XPD(9.9,XTBDA,0)),XTBINST=$P(XTBDTA,U,8) Q:XTBDTA=""!(XTBINST="") ; no data or no install name
135 .S XTBXX=$O(^XPD(9.7,"B",XTBINST,9999999999),-1) I $G(^XPD(9.7,+XTBXX,2))[" TEST v" S XTBXX=""
136 .Q:$P(XTBDTA,U,10)=1&($P(XTBDTA,U,11)]"") ;non-kids
137 .Q:$P($G(^XPD(9.7,+XTBXX,0)),U,9)=3
138 .D SET
139 I '$D(^TMP($J,9,0)) S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1,^TMP($J,XTBLN,0)=" Nothing to report",XTBLN=XTBLN+1
140 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
141 I XTBCNT>0 S ^TMP($J,XTBLN,0)="Total: "_XTBCNT,XTBLN=XTBLN+1
142 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
143 S PG=1,XTBHDR="Uninstalled Patch Report for "_^DD("SITE")_" for "_XTBRUNDT
144 W:IOST?1"C-".E @IOF W !,XTBHDR,?(IOM-12),"Page: ",PG,!
145 F XTBLN=0:0 S XTBLN=$O(^TMP($J,XTBLN)) Q:XTBLN="" W ^TMP($J,XTBLN,0),! I $Y>(IOSL-5) S PG=PG+1 D PAUSE W @IOF,!,XTBHDR,?(IOM-12),"Page: ",PG,!!
146 G EXIT
147 ;
148PASTDUE W @IOF,!,"Past Due Patch Report for "_^DD("SITE"),!!!
149 S %ZIS="AEQ" D ^%ZIS G:POP EXIT
150 I $D(IO("Q")) S ZTIO=ION,ZTSAVE="",ZTRTN="PASTD1^XTPMKPTC",ZTDESC="Past Due Patch Report" D ^%ZTLOAD D HOME^%ZIS
151 I $D(ZTSK) W !,"Queued as task# ",ZTSK,!! H 2 G EXIT
152 ;
153PASTD1 U IO K ^TMP($J) S XTBX="",XTBLN=8,XTBCNT=0
154 S XTBPSTD=1
155 D TEXT S Y=DT X ^DD("DD") S XTBRUNDT=Y
156 K ^TMP($J,2,0),^TMP($J,3,0)
157 F S XTBX=$O(^XPD(9.9,"B",XTBX)) Q:XTBX="" F XTBDA=0:0 S XTBDA=$O(^XPD(9.9,"B",XTBX,XTBDA)) Q:XTBDA="" DO
158 .S XTBDTA=$G(^XPD(9.9,XTBDA,0)),XTBINST=$P(XTBDTA,U,8) Q:XTBDTA=""!(XTBINST="")
159 .S XTBXX=$O(^XPD(9.7,"B",XTBINST,9999999999),-1) I $G(^XPD(9.7,+XTBXX,2))[" TEST v" S XTBXX=""
160 .Q:$P(XTBDTA,U,10)=1&($P(XTBDTA,U,11)]"") ;non-kids
161 .Q:$P($G(^XPD(9.7,+XTBXX,0)),U,9)=3
162 .S XTBCOMPD=$P(XTBDTA,U,9) Q:XTBCOMPD'<DT
163 .D SET
164 I '$D(^TMP($J,9,0)) S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1,^TMP($J,XTBLN,0)=" Nothing to report",XTBLN=XTBLN+1
165 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
166 I XTBCNT>0 S ^TMP($J,XTBLN,0)="Total: "_XTBCNT,XTBLN=XTBLN+1
167 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
168 S ^TMP($J,XTBLN,0)="",XTBLN=XTBLN+1
169 S PG=1,XTBHDR="Past Due Patch Report for "_^DD("SITE")_" for "_XTBRUNDT
170 W:IOST?1"C-".E @IOF W !,XTBHDR,?(IOM-12),"Page: ",PG,!
171 F XTBLN=0:0 S XTBLN=$O(^TMP($J,XTBLN)) Q:XTBLN="" W ^TMP($J,XTBLN,0),! I $Y>(IOSL-5) S PG=PG+1 D PAUSE W @IOF,!,XTBHDR,?(IOM-12),"Page: ",PG,!!
172 K XTBPSTD G EXIT
173 ;
174PAUSE W !,"Press RETURN to continue or '^' to exit: " R XTBANS:DTIME
175 I XTBANS["^" S XTBLN=9999
176 Q
177 ;
178MG F XTBMG=0:0 S XTBMG=$O(^XPD(9.95,1,1,"B",XTBMG)) Q:XTBMG="" DO
179 .S XTBMGN=$P(^XMB(3.8,XTBMG,0),U)
180 .S XMY("G."_XTBMGN)=""
181 S XMY("G.XTPM PATCH MONITOR USER")="",XMY(.5)=""
182 Q
Note: See TracBrowser for help on using the repository browser.