FSCSTUPT ;SLC/STAFF-NOIS Site Tracking Update - Patches (Test) Installed ;1/4/98 20:49
;;1.1;NOIS;;Sep 06, 1998
;
TEST(PATCH,CNT) ; from FSCLMIPX, FSCRPCG
N DOMAIN,INDATE,LINE,NUM,SITENAME,VDATE,ZERO K ^TMP("FSC PATCH",$J)
S CNT=+$G(CNT)
S PATCH=+$G(PATCH) I 'PATCH Q
S VDATE=$P($G(^A1AE(11005,PATCH,0)),U,11)
I VDATE,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 DOMAIN=0 F S DOMAIN=$O(^NTS(2050.2,"APD",PATCH,DOMAIN)) Q:DOMAIN<1 D
.S SITENAME=$P($G(^FSC("SITE",+$O(^FSC("SITE","AE",DOMAIN,0)),0)),U)
.I '$L(SITENAME) Q
.S NUM=0 F S NUM=$O(^NTS(2050.2,"APD",PATCH,DOMAIN,NUM)) Q:NUM<1 D
..S ZERO=$G(^NTS(2050.2,NUM,0))
..S INDATE=$$FMTE^XLFDT($P(ZERO,U,3))
..I VDATE,INDATE'<VDATE Q
..S ^TMP("FSC PATCH",$J,SITENAME,NUM)=$$SETSTR^VALM1(INDATE,SITENAME,30,$L(INDATE))
S SITENAME="" F S SITENAME=$O(^TMP("FSC PATCH",$J,SITENAME)) Q:SITENAME="" D
.S NUM="" F S NUM=$O(^TMP("FSC PATCH",$J,SITENAME,NUM),-1) Q:NUM="" S LINE=^(NUM) D
..D SETUP(.CNT,LINE)
I 'CNT D SETUP(.CNT," No test installs of this patch at any site.")
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
;
SITE(SITE,CNT) ; from FSCLMIPX, FSCRPCG
N DAY,DOMAIN,INDATE,LINE,NUM,PATCH,PATCH0,SUBJECT,ZERO
S CNT=+$G(CNT)
S DOMAIN=+$P($G(^FSC("SITE",+$G(SITE),0)),U,14) I 'DOMAIN Q
S DAY="" F S DAY=$O(^NTS(2050.2,"ADTP",DOMAIN,DAY),-1) Q:DAY="" D
.S PATCH=0 F S PATCH=$O(^NTS(2050.2,"ADTP",DOMAIN,DAY,PATCH)) Q:PATCH<1 D
..S PATCH0=$G(^A1AE(11005,PATCH,0)) I '$L(PATCH0) Q
..Q:$P(PATCH0,U,11) S SUBJECT=$P(PATCH0,U,5)
..S NUM="" F S NUM=$O(^NTS(2050.2,"ADTP",DOMAIN,DAY,PATCH,NUM),-1) Q:NUM="" D
...S ZERO=$G(^NTS(2050.2,NUM,0))
...S INDATE=$$FMTE^XLFDT($P(ZERO,U,3))
...S LINE=$$SETSTR^VALM1($P(PATCH0,U),INDATE,15,$L($P(PATCH0,U)))
...S LINE=$$SETSTR^VALM1(SUBJECT,LINE,30,$L(SUBJECT))
...D SETUP(.CNT,LINE)
I 'CNT D SETUP(.CNT," No unreleased patches installed at this site.")
D SETUP(.CNT," ")
D SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
Q
;
PACK(MODULE,CNT) ; from FSCLMIPX, FSCRPCG
N DOMAIN,INDATE,LINE,NUM,PACKAGE,PATCH,PATCH0,SITENAME,SUBJECT,VERSION,ZERO
S CNT=+$G(CNT)
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
S PATCH=0 F S PATCH=$O(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH)) Q:PATCH<1 D
.S PATCH0=$G(^A1AE(11005,PATCH,0)) I '$L(PATCH0) Q
.Q:$P(PATCH0,U,11) S SUBJECT=$P(PATCH0,U,5)
.S DOMAIN=0 F S DOMAIN=$O(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH,DOMAIN)) Q:DOMAIN<1 D
..S SITENAME=$P($G(^FSC("SITE",+$O(^FSC("SITE","AE",DOMAIN,0)),0)),U)
..I '$L(SITENAME) Q
..S NUM=0 F S NUM=$O(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH,DOMAIN,NUM)) Q:NUM<1 D
...S ZERO=$G(^NTS(2050.2,NUM,0))
...S INDATE=$$FMTE^XLFDT($P(ZERO,U,3))
...S LINE=$$SETSTR^VALM1(SITENAME,$P(PATCH0,U),15,$L(SITENAME))
...S LINE=$$SETSTR^VALM1(INDATE,LINE,45,$L(INDATE))
...D SETUP(.CNT,LINE)
I 'CNT D SETUP(.CNT," No unreleased patches installed for this package.")
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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCSTUPT 3627 printed Sep 02, 2024@19:05:27 Page 2
FSCSTUPT ;SLC/STAFF-NOIS Site Tracking Update - Patches (Test) Installed ;1/4/98 20:49
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
TEST(PATCH,CNT) ; from FSCLMIPX, FSCRPCG
+1 NEW DOMAIN,INDATE,LINE,NUM,SITENAME,VDATE,ZERO
KILL ^TMP("FSC PATCH",$JOB)
+2 SET CNT=+$GET(CNT)
+3 SET PATCH=+$GET(PATCH)
IF 'PATCH
QUIT
+4 SET VDATE=$PIECE($GET(^A1AE(11005,PATCH,0)),U,11)
+5 IF VDATE
IF VDATE<2980101
SET CNT=1
Begin DoDot:1
+6 DO SETUP(.CNT,"This patch was released prior to implementation of tracking (1/1/98).")
+7 DO SETUP(.CNT,"No data available.")
End DoDot:1
QUIT
+8 SET DOMAIN=0
FOR
SET DOMAIN=$ORDER(^NTS(2050.2,"APD",PATCH,DOMAIN))
if DOMAIN<1
QUIT
Begin DoDot:1
+9 SET SITENAME=$PIECE($GET(^FSC("SITE",+$ORDER(^FSC("SITE","AE",DOMAIN,0)),0)),U)
+10 IF '$LENGTH(SITENAME)
QUIT
+11 SET NUM=0
FOR
SET NUM=$ORDER(^NTS(2050.2,"APD",PATCH,DOMAIN,NUM))
if NUM<1
QUIT
Begin DoDot:2
+12 SET ZERO=$GET(^NTS(2050.2,NUM,0))
+13 SET INDATE=$$FMTE^XLFDT($PIECE(ZERO,U,3))
+14 IF VDATE
IF INDATE'<VDATE
QUIT
+15 SET ^TMP("FSC PATCH",$JOB,SITENAME,NUM)=$$SETSTR^VALM1(INDATE,SITENAME,30,$LENGTH(INDATE))
End DoDot:2
End DoDot:1
+16 SET SITENAME=""
FOR
SET SITENAME=$ORDER(^TMP("FSC PATCH",$JOB,SITENAME))
if SITENAME=""
QUIT
Begin DoDot:1
+17 SET NUM=""
FOR
SET NUM=$ORDER(^TMP("FSC PATCH",$JOB,SITENAME,NUM),-1)
if NUM=""
QUIT
SET LINE=^(NUM)
Begin DoDot:2
+18 DO SETUP(.CNT,LINE)
End DoDot:2
End DoDot:1
+19 IF 'CNT
DO SETUP(.CNT," No test installs of this patch at any site.")
+20 DO SETUP(.CNT," ")
+21 DO SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
+22 KILL ^TMP("FSC PATCH",$JOB)
+23 QUIT
+24 ;
SITE(SITE,CNT) ; from FSCLMIPX, FSCRPCG
+1 NEW DAY,DOMAIN,INDATE,LINE,NUM,PATCH,PATCH0,SUBJECT,ZERO
+2 SET CNT=+$GET(CNT)
+3 SET DOMAIN=+$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U,14)
IF 'DOMAIN
QUIT
+4 SET DAY=""
FOR
SET DAY=$ORDER(^NTS(2050.2,"ADTP",DOMAIN,DAY),-1)
if DAY=""
QUIT
Begin DoDot:1
+5 SET PATCH=0
FOR
SET PATCH=$ORDER(^NTS(2050.2,"ADTP",DOMAIN,DAY,PATCH))
if PATCH<1
QUIT
Begin DoDot:2
+6 SET PATCH0=$GET(^A1AE(11005,PATCH,0))
IF '$LENGTH(PATCH0)
QUIT
+7 if $PIECE(PATCH0,U,11)
QUIT
SET SUBJECT=$PIECE(PATCH0,U,5)
+8 SET NUM=""
FOR
SET NUM=$ORDER(^NTS(2050.2,"ADTP",DOMAIN,DAY,PATCH,NUM),-1)
if NUM=""
QUIT
Begin DoDot:3
+9 SET ZERO=$GET(^NTS(2050.2,NUM,0))
+10 SET INDATE=$$FMTE^XLFDT($PIECE(ZERO,U,3))
+11 SET LINE=$$SETSTR^VALM1($PIECE(PATCH0,U),INDATE,15,$LENGTH($PIECE(PATCH0,U)))
+12 SET LINE=$$SETSTR^VALM1(SUBJECT,LINE,30,$LENGTH(SUBJECT))
+13 DO SETUP(.CNT,LINE)
End DoDot:3
End DoDot:2
End DoDot:1
+14 IF 'CNT
DO SETUP(.CNT," No unreleased patches installed at this site.")
+15 DO SETUP(.CNT," ")
+16 DO SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
+17 QUIT
+18 ;
PACK(MODULE,CNT) ; from FSCLMIPX, FSCRPCG
+1 NEW DOMAIN,INDATE,LINE,NUM,PACKAGE,PATCH,PATCH0,SITENAME,SUBJECT,VERSION,ZERO
+2 SET CNT=+$GET(CNT)
+3 SET PACKAGE=+$PIECE($GET(^FSC("MOD",+$GET(MODULE),0)),U,8)
IF 'PACKAGE
QUIT
+4 SET PACKAGE=+$PIECE(^FSC("PACK",PACKAGE,0),U,3)
IF 'PACKAGE
QUIT
+5 SET VERSION=+$PIECE($PIECE(^FSC("MOD",MODULE,0),U),"/",2)
IF 'VERSION
SET VERSION=1
+6 SET PATCH=0
FOR
SET PATCH=$ORDER(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH))
if PATCH<1
QUIT
Begin DoDot:1
+7 SET PATCH0=$GET(^A1AE(11005,PATCH,0))
IF '$LENGTH(PATCH0)
QUIT
+8 if $PIECE(PATCH0,U,11)
QUIT
SET SUBJECT=$PIECE(PATCH0,U,5)
+9 SET DOMAIN=0
FOR
SET DOMAIN=$ORDER(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH,DOMAIN))
if DOMAIN<1
QUIT
Begin DoDot:2
+10 SET SITENAME=$PIECE($GET(^FSC("SITE",+$ORDER(^FSC("SITE","AE",DOMAIN,0)),0)),U)
+11 IF '$LENGTH(SITENAME)
QUIT
+12 SET NUM=0
FOR
SET NUM=$ORDER(^NTS(2050.2,"APVPD",PACKAGE,VERSION,PATCH,DOMAIN,NUM))
if NUM<1
QUIT
Begin DoDot:3
+13 SET ZERO=$GET(^NTS(2050.2,NUM,0))
+14 SET INDATE=$$FMTE^XLFDT($PIECE(ZERO,U,3))
+15 SET LINE=$$SETSTR^VALM1(SITENAME,$PIECE(PATCH0,U),15,$LENGTH(SITENAME))
+16 SET LINE=$$SETSTR^VALM1(INDATE,LINE,45,$LENGTH(INDATE))
+17 DO SETUP(.CNT,LINE)
End DoDot:3
End DoDot:2
End DoDot:1
+18 IF 'CNT
DO SETUP(.CNT," No unreleased patches installed for this package.")
+19 DO SETUP(.CNT," ")
+20 DO SETUP(.CNT,"Note: Tracking of patch installs began 1/1/98. Prior installs are not reported.")
+21 QUIT
+22 ;
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