BGUPOST ; IHS/OIT/MJL - BGU TRACE FILE CLEANUP ; [ 04/21/2006 9:15 AM ]
;;1.5;BGU;**2**;MAY 26, 2005
SETUP ;SET THE SITE PARAMETER FILE
S DIR(0)="Y",DIR("A")="Should I set the BGU SITE PARAMETERS File?",DIR("B")="Y",DIR("?")="Will set site parameters for the GUI" K DA D ^DIR K DIR
I 'Y G CLEANUP
S BGUFILE=90062,BGUIENST="1,",BGUFDA(BGUFILE,BGUIENST,.01)=1,BGUFDA(BGUFILE,BGUIENST,.02)="N",BGUFDA(BGUFILE,BGUIENST,.04)=8000,BGUFDA(BGUFILE,BGUIENST,.05)="N",BGUFDA(BGUFILE,BGUIENST,.06)=3600,BGUFDA(BGUFILE,BGUIENST,.07)=10 D FILE
;SCHEDULE THE FOLLOWING TASKS IF THEY AREN'T ALREADY
CLEANUP ;SET THE TASK FOR BGUTRACE CLEANUP
S DIR(0)="Y",DIR("A")="Should I create the CLEANUP Task for the GUI Trace?",DIR("B")="Y",DIR("?")="Most Sites including Regional Setups having multiple UCI's should answer Yes." K DA D ^DIR K DIR
I 'Y G TSKLISTN
S DIC=19.2,DIC(0)="XM",X="BGUTASK TRACE ENTRY CLEANUP" D ^DIC
I Y<0 S DIC=19 D ^DIC I Y>0 S BGUOPT=+Y D
.S %H=$H+1 D YMD^%DTC S BGUDT=X
.S BGUFILE=19.2,BGUIENST="?+1,",BGUFDA(BGUFILE,BGUIENST,.01)=BGUOPT,BGUFDA(BGUFILE,BGUIENST,2)=BGUDT+.02,BGUFDA(BGUFILE,BGUIENST,5)=^%ZOSF("VOL"),BGUFDA(BGUFILE,BGUIENST,6)="1D"
.D FILE
TSKLISTN ;
;SET THE STARTUP TASK FOR THE LISTENER
S DIR(0)="Y",DIR("A")="Should I create the STARTUP Task for the GUI Listener?",DIR("B")="Y",DIR("?")="Most Sites including Regional Setups having multiple UCI's should answer Yes." K DA D ^DIR K DIR
I 'Y G STLISTEN
S DIC=19.2,DIC(0)="XM",X="BGU START LISTENER" D ^DIC
I Y<0 S DIC=19 D ^DIC I Y>0 S BGUOPT=+Y D
.S %H=$H+1 D YMD^%DTC S BGUDT=X
.S BGUFILE=19.2,BGUIENST="?+1,",BGUFDA(BGUFILE,BGUIENST,.01)=BGUOPT,BGUFDA(BGUFILE,BGUIENST,2)=BGUDT+.02,BGUFDA(BGUFILE,BGUIENST,5)=^%ZOSF("VOL"),BGUFDA(BGUFILE,BGUIENST,9)="S"
.D FILE
K BGUDT,BGUFILE,BGUIENST,BGUOPT
STLISTEN ;START THE LISTENER
S DIR(0)="Y",DIR("A")="Should I start the listener on port 8000?",DIR("B")="Y",DIR("?")="Most Sites including Regional Setups having multiple UCI's should answer Yes." K DA D ^DIR K DIR
I 'Y G EOJ
W !! D STRT^BGUTCP(8000)
EOJ ;
S BGUN="" F S BGUN=$O(^BGUMRU(BGUN)) Q:BGUN="" K ^(BGUN)
K BGUN
Q
;
FILE ;
D UPDATE^DIE(,"BGUFDA",,"BGUEMSG")
K BGUFDA,BGUEMSG
Q
BGUPOST ; IHS/OIT/MJL - BGU TRACE FILE CLEANUP ; [ 04/21/2006 9:15 AM ]
+1 ;;1.5;BGU;**2**;MAY 26, 2005
SETUP ;SET THE SITE PARAMETER FILE
+1 SET DIR(0)="Y"
SET DIR("A")="Should I set the BGU SITE PARAMETERS File?"
SET DIR("B")="Y"
SET DIR("?")="Will set site parameters for the GUI"
KILL DA
DO ^DIR
KILL DIR
+2 IF 'Y
GOTO CLEANUP
+3 SET BGUFILE=90062
SET BGUIENST="1,"
SET BGUFDA(BGUFILE,BGUIENST,.01)=1
SET BGUFDA(BGUFILE,BGUIENST,.02)="N"
SET BGUFDA(BGUFILE,BGUIENST,.04)=8000
SET BGUFDA(BGUFILE,BGUIENST,.05)="N"
SET BGUFDA(BGUFILE,BGUIENST,.06)=3600
SET BGUFDA(BGUFILE,BGUIENST,.07)=10
DO FILE
+4 ;SCHEDULE THE FOLLOWING TASKS IF THEY AREN'T ALREADY
CLEANUP ;SET THE TASK FOR BGUTRACE CLEANUP
+1 SET DIR(0)="Y"
SET DIR("A")="Should I create the CLEANUP Task for the GUI Trace?"
SET DIR("B")="Y"
SET DIR("?")="Most Sites including Regional Setups having multiple UCI's should answer Yes."
KILL DA
DO ^DIR
KILL DIR
+2 IF 'Y
GOTO TSKLISTN
+3 SET DIC=19.2
SET DIC(0)="XM"
SET X="BGUTASK TRACE ENTRY CLEANUP"
DO ^DIC
+4 IF Y<0
SET DIC=19
DO ^DIC
IF Y>0
SET BGUOPT=+Y
Begin DoDot:1
+5 SET %H=$HOROLOG+1
DO YMD^%DTC
SET BGUDT=X
+6 SET BGUFILE=19.2
SET BGUIENST="?+1,"
SET BGUFDA(BGUFILE,BGUIENST,.01)=BGUOPT
SET BGUFDA(BGUFILE,BGUIENST,2)=BGUDT+.02
SET BGUFDA(BGUFILE,BGUIENST,5)=^%ZOSF("VOL")
SET BGUFDA(BGUFILE,BGUIENST,6)="1D"
+7 DO FILE
End DoDot:1
TSKLISTN ;
+1 ;SET THE STARTUP TASK FOR THE LISTENER
+2 SET DIR(0)="Y"
SET DIR("A")="Should I create the STARTUP Task for the GUI Listener?"
SET DIR("B")="Y"
SET DIR("?")="Most Sites including Regional Setups having multiple UCI's should answer Yes."
KILL DA
DO ^DIR
KILL DIR
+3 IF 'Y
GOTO STLISTEN
+4 SET DIC=19.2
SET DIC(0)="XM"
SET X="BGU START LISTENER"
DO ^DIC
+5 IF Y<0
SET DIC=19
DO ^DIC
IF Y>0
SET BGUOPT=+Y
Begin DoDot:1
+6 SET %H=$HOROLOG+1
DO YMD^%DTC
SET BGUDT=X
+7 SET BGUFILE=19.2
SET BGUIENST="?+1,"
SET BGUFDA(BGUFILE,BGUIENST,.01)=BGUOPT
SET BGUFDA(BGUFILE,BGUIENST,2)=BGUDT+.02
SET BGUFDA(BGUFILE,BGUIENST,5)=^%ZOSF("VOL")
SET BGUFDA(BGUFILE,BGUIENST,9)="S"
+8 DO FILE
End DoDot:1
+9 KILL BGUDT,BGUFILE,BGUIENST,BGUOPT
STLISTEN ;START THE LISTENER
+1 SET DIR(0)="Y"
SET DIR("A")="Should I start the listener on port 8000?"
SET DIR("B")="Y"
SET DIR("?")="Most Sites including Regional Setups having multiple UCI's should answer Yes."
KILL DA
DO ^DIR
KILL DIR
+2 IF 'Y
GOTO EOJ
+3 WRITE !!
DO STRT^BGUTCP(8000)
EOJ ;
+1 SET BGUN=""
FOR
SET BGUN=$ORDER(^BGUMRU(BGUN))
IF BGUN=""
QUIT
KILL ^(BGUN)
+2 KILL BGUN
+3 QUIT
+4 ;
FILE ;
+1 DO UPDATE^DIE(,"BGUFDA",,"BGUEMSG")
+2 KILL BGUFDA,BGUEMSG
+3 QUIT