FSCSTUPN ;SLC/STAFF-NOIS Site Tracking Update - Patches Not Installed ;1/4/98 20:48
;;1.1;NOIS;;Sep 06, 1998
;
SITENOT(PATCH,CNT) ; from FSCLMIPX, FSCRPCG
N DOMAIN,PACKAGE,PATCH0,NUM,SITENAME,VERSION,VDATE
S CNT=+$G(CNT)
S PATCH0=$G(^A1AE(11005,+$G(PATCH),0)) I '$L(PATCH0) Q
S VDATE=$P(PATCH0,U,11)
I 'VDATE S CNT=1 D SETUP(.CNT," This patch has not been verified.") Q
I VDATE<2980101 S CNT=1 D Q
.D SETUP(.CNT,"This patch was released prior to implementation of tracking (1/1/98).")
.D SETUP(.CNT,"No data available.")
S PACKAGE=$P(PATCH0,U,2) I 'PACKAGE Q
S VERSION=$P(PATCH0,U,3) I 'VERSION Q
S SITENAME="" F S SITENAME=$O(^FSC("SITE","B",SITENAME)) Q:SITENAME="" D
.S NUM=0 F S NUM=$O(^FSC("SITE","B",SITENAME,NUM)) Q:NUM<1 D
..S DOMAIN=+$P($G(^FSC("SITE",NUM,0)),U,14) I 'DOMAIN Q
..I $O(^NTS(2050.2,"APD",PATCH,DOMAIN,0)) Q
..I '$$CHECK(PACKAGE,VERSION,DOMAIN) Q
..D SETUP(.CNT,SITENAME)
I 'CNT D SETUP(.CNT," Patch is installed at all sites.")
D SETUP(.CNT," ")
D SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
Q
;
ALLNOT(SITE,CNT) ; from FSCLMIPX, FSCRPCG
N DOMAIN,LINE,PACKAGE,PATCH,PATCH0,PATCHID,SUBJECT,VERSION K ^TMP("FSC PATCH",$J)
S CNT=+$G(CNT)
S DOMAIN=+$P($G(^FSC("SITE",+$G(SITE),0)),U,14) I 'DOMAIN Q
S PATCH=0 F S PATCH=$O(^NTS(2050.2,"B",PATCH)) Q:PATCH<1 D
.I $O(^NTS(2050.2,"APD",PATCH,DOMAIN,0)) Q
.S PATCH0=$G(^A1AE(11005,PATCH,0)) I '$L(PATCH0) Q
.I '$P(PATCH0,U,11) Q
.I $P(PATCH,U,8)="e" Q
.S PACKAGE=$P(PATCH0,U,2) I 'PACKAGE Q
.S VERSION=$P(PATCH0,U,3) I 'VERSION Q
.I '$$CHECK(PACKAGE,VERSION,DOMAIN) Q
.S PATCHID=$P(PATCH0,U),SUBJECT=$P(PATCH0,U,5)
.S LINE=$$SETSTR^VALM1(SUBJECT,PATCHID,15,$L(SUBJECT))
.S ^TMP("FSC PATCH",$J,PATCHID)=LINE
S PATCHID="" F S PATCHID=$O(^TMP("FSC PATCH",$J,PATCHID)) Q:PATCHID="" S LINE=^(PATCHID) D
.D SETUP(.CNT,LINE)
I 'CNT D SETUP(.CNT," All patches installed. This only applies to patches being tracked.")
D SETUP(.CNT," ")
D SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
K ^TMP("FSC PATCH",$J)
Q
;
PACKNOT(SITE,MODULE,CNT) ; from FSCLMIPX, FSCRPCG
N DOMAIN,LINE,PACKAGE,PATCH,PATCH0,PATCHID,SUBJECT,VERSION
S CNT=+$G(CNT)
S DOMAIN=+$P($G(^FSC("SITE",+$G(SITE),0)),U,14) I 'DOMAIN Q
S PACKAGE=+$P($G(^FSC("MOD",+$G(MODULE),0)),U,8) I 'PACKAGE Q
S PACKAGE=+$P(^FSC("PACK",PACKAGE,0),U,3) I 'PACKAGE Q
S VERSION=+$P($P(^FSC("MOD",MODULE,0),U),"/",2) I 'VERSION S VERSION=1
I '$$CHECK(PACKAGE,VERSION,DOMAIN) Q
S PATCH=0 F S PATCH=$O(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH)) Q:PATCH<1 D
.I $O(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH,DOMAIN,0)) Q
.S PATCH0=$G(^A1AE(11005,PATCH,0)) I '$L(PATCH0) Q
.I '$P(PATCH0,U,11) Q
.I '$P(PATCH,U,8)="e" Q
.S PATCHID=$P(PATCH0,U),SUBJECT=$P(PATCH0,U,5)
.S LINE=$$SETSTR^VALM1(SUBJECT,PATCHID,15,$L(SUBJECT))
.D SETUP(.CNT,LINE)
I 'CNT D SETUP(.CNT," All patches installed. This only applies to patches being tracked.")
D SETUP(.CNT," ")
D SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
Q
;
SETUP(CNT,LINE) ;
S CNT=CNT+1
I $D(VALMCNT) S ^TMP("FSC INSTALLS",$J,CNT,0)=LINE Q
S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
Q
;
CHECK(PACKAGE,VERSION,DOMAIN) ; $$(package, version, domain) -> 1 if installed at site, else 0
N SITEVER
I $O(^NTS(2050.2,"ADPVP",DOMAIN,PACKAGE,+VERSION,0)) Q 1
S SITEVER=+$$VERINST(PACKAGE,DOMAIN)
I SITEVER,SITEVER=+VERSION Q 1
Q 0
;
VERINST(PACKAGE,DOMAIN) ; $$(package,domain) -> current version#
N APP,SITENUM
S DOMAIN=$P($G(^DIC(4.2,+DOMAIN,0)),U)
I '$L(DOMAIN) Q ""
S SITENUM=$O(^NTS(2050,"AE",DOMAIN,0))
I 'SITENUM Q ""
S APP=+$O(^DIC(120102,"AP",PACKAGE,0))
I 'APP Q ""
Q $P($G(^NTS(2050,SITENUM,8,APP,0)),U,7)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCSTUPN 3897 printed Nov 22, 2024@17:30:14 Page 2
FSCSTUPN ;SLC/STAFF-NOIS Site Tracking Update - Patches Not Installed ;1/4/98 20:48
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
SITENOT(PATCH,CNT) ; from FSCLMIPX, FSCRPCG
+1 NEW DOMAIN,PACKAGE,PATCH0,NUM,SITENAME,VERSION,VDATE
+2 SET CNT=+$GET(CNT)
+3 SET PATCH0=$GET(^A1AE(11005,+$GET(PATCH),0))
IF '$LENGTH(PATCH0)
QUIT
+4 SET VDATE=$PIECE(PATCH0,U,11)
+5 IF 'VDATE
SET CNT=1
DO SETUP(.CNT," This patch has not been verified.")
QUIT
+6 IF VDATE<2980101
SET CNT=1
Begin DoDot:1
+7 DO SETUP(.CNT,"This patch was released prior to implementation of tracking (1/1/98).")
+8 DO SETUP(.CNT,"No data available.")
End DoDot:1
QUIT
+9 SET PACKAGE=$PIECE(PATCH0,U,2)
IF 'PACKAGE
QUIT
+10 SET VERSION=$PIECE(PATCH0,U,3)
IF 'VERSION
QUIT
+11 SET SITENAME=""
FOR
SET SITENAME=$ORDER(^FSC("SITE","B",SITENAME))
if SITENAME=""
QUIT
Begin DoDot:1
+12 SET NUM=0
FOR
SET NUM=$ORDER(^FSC("SITE","B",SITENAME,NUM))
if NUM<1
QUIT
Begin DoDot:2
+13 SET DOMAIN=+$PIECE($GET(^FSC("SITE",NUM,0)),U,14)
IF 'DOMAIN
QUIT
+14 IF $ORDER(^NTS(2050.2,"APD",PATCH,DOMAIN,0))
QUIT
+15 IF '$$CHECK(PACKAGE,VERSION,DOMAIN)
QUIT
+16 DO SETUP(.CNT,SITENAME)
End DoDot:2
End DoDot:1
+17 IF 'CNT
DO SETUP(.CNT," Patch is installed at all sites.")
+18 DO SETUP(.CNT," ")
+19 DO SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
+20 QUIT
+21 ;
ALLNOT(SITE,CNT) ; from FSCLMIPX, FSCRPCG
+1 NEW DOMAIN,LINE,PACKAGE,PATCH,PATCH0,PATCHID,SUBJECT,VERSION
KILL ^TMP("FSC PATCH",$JOB)
+2 SET CNT=+$GET(CNT)
+3 SET DOMAIN=+$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U,14)
IF 'DOMAIN
QUIT
+4 SET PATCH=0
FOR
SET PATCH=$ORDER(^NTS(2050.2,"B",PATCH))
if PATCH<1
QUIT
Begin DoDot:1
+5 IF $ORDER(^NTS(2050.2,"APD",PATCH,DOMAIN,0))
QUIT
+6 SET PATCH0=$GET(^A1AE(11005,PATCH,0))
IF '$LENGTH(PATCH0)
QUIT
+7 IF '$PIECE(PATCH0,U,11)
QUIT
+8 IF $PIECE(PATCH,U,8)="e"
QUIT
+9 SET PACKAGE=$PIECE(PATCH0,U,2)
IF 'PACKAGE
QUIT
+10 SET VERSION=$PIECE(PATCH0,U,3)
IF 'VERSION
QUIT
+11 IF '$$CHECK(PACKAGE,VERSION,DOMAIN)
QUIT
+12 SET PATCHID=$PIECE(PATCH0,U)
SET SUBJECT=$PIECE(PATCH0,U,5)
+13 SET LINE=$$SETSTR^VALM1(SUBJECT,PATCHID,15,$LENGTH(SUBJECT))
+14 SET ^TMP("FSC PATCH",$JOB,PATCHID)=LINE
End DoDot:1
+15 SET PATCHID=""
FOR
SET PATCHID=$ORDER(^TMP("FSC PATCH",$JOB,PATCHID))
if PATCHID=""
QUIT
SET LINE=^(PATCHID)
Begin DoDot:1
+16 DO SETUP(.CNT,LINE)
End DoDot:1
+17 IF 'CNT
DO SETUP(.CNT," All patches installed. This only applies to patches being tracked.")
+18 DO SETUP(.CNT," ")
+19 DO SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
+20 KILL ^TMP("FSC PATCH",$JOB)
+21 QUIT
+22 ;
PACKNOT(SITE,MODULE,CNT) ; from FSCLMIPX, FSCRPCG
+1 NEW DOMAIN,LINE,PACKAGE,PATCH,PATCH0,PATCHID,SUBJECT,VERSION
+2 SET CNT=+$GET(CNT)
+3 SET DOMAIN=+$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U,14)
IF 'DOMAIN
QUIT
+4 SET PACKAGE=+$PIECE($GET(^FSC("MOD",+$GET(MODULE),0)),U,8)
IF 'PACKAGE
QUIT
+5 SET PACKAGE=+$PIECE(^FSC("PACK",PACKAGE,0),U,3)
IF 'PACKAGE
QUIT
+6 SET VERSION=+$PIECE($PIECE(^FSC("MOD",MODULE,0),U),"/",2)
IF 'VERSION
SET VERSION=1
+7 IF '$$CHECK(PACKAGE,VERSION,DOMAIN)
QUIT
+8 SET PATCH=0
FOR
SET PATCH=$ORDER(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH))
if PATCH<1
QUIT
Begin DoDot:1
+9 IF $ORDER(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH,DOMAIN,0))
QUIT
+10 SET PATCH0=$GET(^A1AE(11005,PATCH,0))
IF '$LENGTH(PATCH0)
QUIT
+11 IF '$PIECE(PATCH0,U,11)
QUIT
+12 IF '$PIECE(PATCH,U,8)="e"
QUIT
+13 SET PATCHID=$PIECE(PATCH0,U)
SET SUBJECT=$PIECE(PATCH0,U,5)
+14 SET LINE=$$SETSTR^VALM1(SUBJECT,PATCHID,15,$LENGTH(SUBJECT))
+15 DO SETUP(.CNT,LINE)
End DoDot:1
+16 IF 'CNT
DO SETUP(.CNT," All patches installed. This only applies to patches being tracked.")
+17 DO SETUP(.CNT," ")
+18 DO SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
+19 QUIT
+20 ;
SETUP(CNT,LINE) ;
+1 SET CNT=CNT+1
+2 IF $DATA(VALMCNT)
SET ^TMP("FSC INSTALLS",$JOB,CNT,0)=LINE
QUIT
+3 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=LINE
+4 QUIT
+5 ;
CHECK(PACKAGE,VERSION,DOMAIN) ; $$(package, version, domain) -> 1 if installed at site, else 0
+1 NEW SITEVER
+2 IF $ORDER(^NTS(2050.2,"ADPVP",DOMAIN,PACKAGE,+VERSION,0))
QUIT 1
+3 SET SITEVER=+$$VERINST(PACKAGE,DOMAIN)
+4 IF SITEVER
IF SITEVER=+VERSION
QUIT 1
+5 QUIT 0
+6 ;
VERINST(PACKAGE,DOMAIN) ; $$(package,domain) -> current version#
+1 NEW APP,SITENUM
+2 SET DOMAIN=$PIECE($GET(^DIC(4.2,+DOMAIN,0)),U)
+3 IF '$LENGTH(DOMAIN)
QUIT ""
+4 SET SITENUM=$ORDER(^NTS(2050,"AE",DOMAIN,0))
+5 IF 'SITENUM
QUIT ""
+6 SET APP=+$ORDER(^DIC(120102,"AP",PACKAGE,0))
+7 IF 'APP
QUIT ""
+8 QUIT $PIECE($GET(^NTS(2050,SITENUM,8,APP,0)),U,7)