FSCLMI ;SLC/STAFF-NOIS List Manager - Installs ;1/13/98 12:34
;;1.1;NOIS;;Sep 06, 1998
;
ENTRY ; from list template - entry code, FSCSTUR
N DAY,LINE,NUM,NUM0,NUM1,SEQ
K ^TMP("FSC INSTALLS",$J)
I '$G(FSCDEV) W !
S VALMCNT=0,VALMCAP="",$P(VALMCAP," ",80)=""
I '$D(FSCSTU) Q
;S VALMCNT=VALMCNT+1,^TMP("FSC INSTALLS",$J,VALMCNT,0)="Description:"
S DATE=$G(DATE,DT)
D
.I FSCSTU="ALERT" D Q
..N DA,DIK S DIK="^FSCD(""STU ALERT"","
..S NUM="" F S NUM=$O(^FSCD("STU ALERT","B",DUZ,NUM),-1) Q:NUM="" S NUM0=+$P($G(^FSCD("STU ALERT",NUM,0)),U,2) I NUM0 D
...S NUM1=0 F S NUM1=$O(^FSCD("STU MSG",NUM0,1,NUM1)) Q:NUM1<1 S LINE=$G(^(NUM1,0)) D
....S VALMCNT=VALMCNT+1,^TMP("FSC INSTALLS",$J,VALMCNT,0)=LINE
...S DA=+NUM D ^DIK
.I FSCSTU="ALL" D Q
..S DAY="" F S DAY=$O(^FSCD("STU MSG","B",DAY),-1) Q:DAY="" Q:DAY<DATE D
...S NUM="" F S NUM=$O(^FSCD("STU MSG","B",DAY,NUM),-1) Q:NUM="" D
....S NUM1=0 F S NUM1=$O(^FSCD("STU MSG",NUM,1,NUM1)) Q:NUM1<1 S LINE=$G(^(NUM1,0)) D
.....S VALMCNT=VALMCNT+1,^TMP("FSC INSTALLS",$J,VALMCNT,0)=LINE
.I FSCSTU="PACKAGE" D Q
..I '$G(PACKAGE) Q
..S DAY="" F S DAY=$O(^FSCD("STU MSG","APD",PACKAGE,DAY),-1) Q:DAY="" Q:DAY<DATE D
...S NUM="" F S NUM=$O(^FSCD("STU MSG","APD",PACKAGE,DAY,NUM),-1) Q:NUM="" D
....S NUM1=0 F S NUM1=$O(^FSCD("STU MSG",NUM,1,NUM1)) Q:NUM1<1 S LINE=$G(^(NUM1,0)) D
.....S VALMCNT=VALMCNT+1,^TMP("FSC INSTALLS",$J,VALMCNT,0)=LINE
.I FSCSTU="SITE" D Q
..I '$G(SITE) Q
..S DAY="" F S DAY=$O(^FSCD("STU MSG","ASD",SITE,DAY),-1) Q:DAY="" Q:DAY<DATE D
...S NUM="" F S NUM=$O(^FSCD("STU MSG","ASD",SITE,DAY,NUM),-1) Q:NUM="" D
....S NUM1=0 F S NUM1=$O(^FSCD("STU MSG",NUM,1,NUM1)) Q:NUM1<1 S LINE=$G(^(NUM1,0)) D
.....S VALMCNT=VALMCNT+1,^TMP("FSC INSTALLS",$J,VALMCNT,0)=LINE
S ^TMP("FSC INSTALLS",$J)=VALMCNT_U_VALMCNT
I 'VALMCNT S VALMCNT=2,^TMP("FSC INSTALLS",$J,1,0)=" ",^TMP("FSC INSTALLS",$J,2,0)=" No messages on list."
Q
;
HDRPATCH ; from FSCSTUR
N HDR S FSCSTU=$G(FSCSTU),DATE=$G(DATE,DT)
S HDR="Site Tracking"
I FSCSTU="PATCH SITE" S HDR=HDR_" - Patch "_$P($G(^A1AE(11005,+$G(PATCH),0)),U)_" installed at these sites"
I FSCSTU="PATCH SITENOT" S HDR=HDR_" - Patch "_$P($G(^A1AE(11005,+$G(PATCH),0)),U)_" is NOT installed at these sites"
I FSCSTU="PATCH ALL" S HDR=HDR_" - "_$P($G(^FSC("SITE",+$G(SITE),0)),U)_" patch installs backto "_$$FMTE^XLFDT(DATE)
I FSCSTU="PATCH ALLNOT" S HDR=HDR_" - "_$P($G(^FSC("SITE",+$G(SITE),0)),U)_" patches NOT installed"
I FSCSTU="PATCH PACK" S HDR=HDR_" - "_$P($G(^FSC("SITE",+$G(SITE),0)),U)_" patches for "_$P($G(^FSC("MOD",+$G(MODULE),0)),U)
I FSCSTU="PATCH PACKNOT" S HDR=HDR_" - "_$P($G(^FSC("SITE",+$G(SITE),0)),U)_" patches NOT installed for "_$P($G(^FSC("MOD",+$G(MODULE),0)),U)
S VALMHDR(1)=HDR
Q
;
N HDR S FSCSTU=$G(FSCSTU),DATE=$G(DATE,DT)
S HDR="Site Tracking Update Messages"
I FSCSTU="ALERT" S HDR=HDR_" - Install Alerts"
I FSCSTU="ALL" S HDR=HDR_" - All installs backto "_$$FMTE^XLFDT(DATE)
I FSCSTU="PACKAGE" S HDR=HDR_" - "_$P($G(^FSC("PACK",+$G(PACKAGE),0)),U)_" installs backto "_$$FMTE^XLFDT(DATE)
I FSCSTU="SITE" S HDR=HDR_" - "_$P($G(^FSC("SITE",+$G(SITE),0)),U)_" installs backto "_$$FMTE^XLFDT(DATE)
S VALMHDR(1)=HDR
Q
;
EXIT ; from list template - exit code
I $G(FSC1) D CLEAR^VALM1
K ^TMP("FSC INSTALLS",$J)
Q
;
HELP ; from list template - help code
I $G(X)'["?" Q
S VALMBCK="R"
N XQH
I X="?" S XQH="FSC MENU MODIFY" D EN^XQH Q
I X="???" S VALMANS="?" D CLEAR^VALM1 S XQH="FSC U1 NOIS" D EN^XQH Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCLMI 3635 printed Oct 16, 2024@18:18:43 Page 2
FSCLMI ;SLC/STAFF-NOIS List Manager - Installs ;1/13/98 12:34
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
ENTRY ; from list template - entry code, FSCSTUR
+1 NEW DAY,LINE,NUM,NUM0,NUM1,SEQ
+2 KILL ^TMP("FSC INSTALLS",$JOB)
+3 IF '$GET(FSCDEV)
WRITE !
+4 SET VALMCNT=0
SET VALMCAP=""
SET $PIECE(VALMCAP," ",80)=""
+5 IF '$DATA(FSCSTU)
QUIT
+6 ;S VALMCNT=VALMCNT+1,^TMP("FSC INSTALLS",$J,VALMCNT,0)="Description:"
+7 SET DATE=$GET(DATE,DT)
+8 Begin DoDot:1
+9 IF FSCSTU="ALERT"
Begin DoDot:2
+10 NEW DA,DIK
SET DIK="^FSCD(""STU ALERT"","
+11 SET NUM=""
FOR
SET NUM=$ORDER(^FSCD("STU ALERT","B",DUZ,NUM),-1)
if NUM=""
QUIT
SET NUM0=+$PIECE($GET(^FSCD("STU ALERT",NUM,0)),U,2)
IF NUM0
Begin DoDot:3
+12 SET NUM1=0
FOR
SET NUM1=$ORDER(^FSCD("STU MSG",NUM0,1,NUM1))
if NUM1<1
QUIT
SET LINE=$GET(^(NUM1,0))
Begin DoDot:4
+13 SET VALMCNT=VALMCNT+1
SET ^TMP("FSC INSTALLS",$JOB,VALMCNT,0)=LINE
End DoDot:4
+14 SET DA=+NUM
DO ^DIK
End DoDot:3
End DoDot:2
QUIT
+15 IF FSCSTU="ALL"
Begin DoDot:2
+16 SET DAY=""
FOR
SET DAY=$ORDER(^FSCD("STU MSG","B",DAY),-1)
if DAY=""
QUIT
if DAY<DATE
QUIT
Begin DoDot:3
+17 SET NUM=""
FOR
SET NUM=$ORDER(^FSCD("STU MSG","B",DAY,NUM),-1)
if NUM=""
QUIT
Begin DoDot:4
+18 SET NUM1=0
FOR
SET NUM1=$ORDER(^FSCD("STU MSG",NUM,1,NUM1))
if NUM1<1
QUIT
SET LINE=$GET(^(NUM1,0))
Begin DoDot:5
+19 SET VALMCNT=VALMCNT+1
SET ^TMP("FSC INSTALLS",$JOB,VALMCNT,0)=LINE
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
QUIT
+20 IF FSCSTU="PACKAGE"
Begin DoDot:2
+21 IF '$GET(PACKAGE)
QUIT
+22 SET DAY=""
FOR
SET DAY=$ORDER(^FSCD("STU MSG","APD",PACKAGE,DAY),-1)
if DAY=""
QUIT
if DAY<DATE
QUIT
Begin DoDot:3
+23 SET NUM=""
FOR
SET NUM=$ORDER(^FSCD("STU MSG","APD",PACKAGE,DAY,NUM),-1)
if NUM=""
QUIT
Begin DoDot:4
+24 SET NUM1=0
FOR
SET NUM1=$ORDER(^FSCD("STU MSG",NUM,1,NUM1))
if NUM1<1
QUIT
SET LINE=$GET(^(NUM1,0))
Begin DoDot:5
+25 SET VALMCNT=VALMCNT+1
SET ^TMP("FSC INSTALLS",$JOB,VALMCNT,0)=LINE
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
QUIT
+26 IF FSCSTU="SITE"
Begin DoDot:2
+27 IF '$GET(SITE)
QUIT
+28 SET DAY=""
FOR
SET DAY=$ORDER(^FSCD("STU MSG","ASD",SITE,DAY),-1)
if DAY=""
QUIT
if DAY<DATE
QUIT
Begin DoDot:3
+29 SET NUM=""
FOR
SET NUM=$ORDER(^FSCD("STU MSG","ASD",SITE,DAY,NUM),-1)
if NUM=""
QUIT
Begin DoDot:4
+30 SET NUM1=0
FOR
SET NUM1=$ORDER(^FSCD("STU MSG",NUM,1,NUM1))
if NUM1<1
QUIT
SET LINE=$GET(^(NUM1,0))
Begin DoDot:5
+31 SET VALMCNT=VALMCNT+1
SET ^TMP("FSC INSTALLS",$JOB,VALMCNT,0)=LINE
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
QUIT
End DoDot:1
+32 SET ^TMP("FSC INSTALLS",$JOB)=VALMCNT_U_VALMCNT
+33 IF 'VALMCNT
SET VALMCNT=2
SET ^TMP("FSC INSTALLS",$JOB,1,0)=" "
SET ^TMP("FSC INSTALLS",$JOB,2,0)=" No messages on list."
+34 QUIT
+35 ;
HDRPATCH ; from FSCSTUR
+1 NEW HDR
SET FSCSTU=$GET(FSCSTU)
SET DATE=$GET(DATE,DT)
+2 SET HDR="Site Tracking"
+3 IF FSCSTU="PATCH SITE"
SET HDR=HDR_" - Patch "_$PIECE($GET(^A1AE(11005,+$GET(PATCH),0)),U)_" installed at these sites"
+4 IF FSCSTU="PATCH SITENOT"
SET HDR=HDR_" - Patch "_$PIECE($GET(^A1AE(11005,+$GET(PATCH),0)),U)_" is NOT installed at these sites"
+5 IF FSCSTU="PATCH ALL"
SET HDR=HDR_" - "_$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U)_" patch installs backto "_$$FMTE^XLFDT(DATE)
+6 IF FSCSTU="PATCH ALLNOT"
SET HDR=HDR_" - "_$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U)_" patches NOT installed"
+7 IF FSCSTU="PATCH PACK"
SET HDR=HDR_" - "_$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U)_" patches for "_$PIECE($GET(^FSC("MOD",+$GET(MODULE),0)),U)
+8 IF FSCSTU="PATCH PACKNOT"
SET HDR=HDR_" - "_$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U)_" patches NOT installed for "_$PIECE($GET(^FSC("MOD",+$GET(MODULE),0)),U)
+9 SET VALMHDR(1)=HDR
+10 QUIT
+11 ;
+1 NEW HDR
SET FSCSTU=$GET(FSCSTU)
SET DATE=$GET(DATE,DT)
+2 SET HDR="Site Tracking Update Messages"
+3 IF FSCSTU="ALERT"
SET HDR=HDR_" - Install Alerts"
+4 IF FSCSTU="ALL"
SET HDR=HDR_" - All installs backto "_$$FMTE^XLFDT(DATE)
+5 IF FSCSTU="PACKAGE"
SET HDR=HDR_" - "_$PIECE($GET(^FSC("PACK",+$GET(PACKAGE),0)),U)_" installs backto "_$$FMTE^XLFDT(DATE)
+6 IF FSCSTU="SITE"
SET HDR=HDR_" - "_$PIECE($GET(^FSC("SITE",+$GET(SITE),0)),U)_" installs backto "_$$FMTE^XLFDT(DATE)
+7 SET VALMHDR(1)=HDR
+8 QUIT
+9 ;
EXIT ; from list template - exit code
+1 IF $GET(FSC1)
DO CLEAR^VALM1
+2 KILL ^TMP("FSC INSTALLS",$JOB)
+3 QUIT
+4 ;
HELP ; from list template - help code
+1 IF $GET(X)'["?"
QUIT
+2 SET VALMBCK="R"
+3 NEW XQH
+4 IF X="?"
SET XQH="FSC MENU MODIFY"
DO EN^XQH
QUIT
+5 IF X="???"
SET VALMANS="?"
DO CLEAR^VALM1
SET XQH="FSC U1 NOIS"
DO EN^XQH
QUIT
+6 QUIT