AGSSM ; IHS/ASDS/EFG - MONITOR PROGRAM ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
;this program monitors the background SSA SSN processing
D DT^DICRW
S DIC="^AUTTLOC(",DIC(0)="AEMQ",DIC("A")="Monitor which Site: " D ^DIC
Q:+Y<0 S AGSSITE=+Y
F Q:($G(DROUT)!$G(DIROUT)!$G(DUOUT)) D DISP W !!!,"The display will recycle every 10 seconds",! K DIR S DIR("T")=10,DIR(0)="E" D ^DIR
D QUIT
Q
DISP ;EP
U IO(0) W $$S^AGVDF("IOF")
W !,?10,"Monitor Program for the SSA SSN Matching Process"
S %H=$H D YX^%DTC W !!,"The current time is : ",Y
I '$D(^AGSSTEMP) W !,"The processing program has not started",!! G EDISP
S AGSSBGT=$G(^AGSSTEMP(AGSSITE,0,"BEGIN-TIME")),AGSSTM=$G(^AGSSTEMP(AGSSITE,0,"CURRENT-TIME")),AGSS1BGT=$G(^AGSSTEMP(AGSSITE,0,"1ST-BEGIN-TIME"))
S AGSS1LRC=$G(^AGSSTEMP(AGSSITE,0,"1ST-LAST-RECORD")),AGSSLRC=$G(^AGSSTEMP(AGSSITE,0,"LAST-RECORD")),AGSSVOL=$G(^AGSSTEMP(AGSSITE,0,"VOL-REC"))
W !,"Last Record Processed: "
W !,AGSSLRC
I ($P(AGSSTM,",")'=$P($H,","))!($P($H,",",2)-$P(AGSSTM,",",2)>600) W !!!,"The process has been idle for more than 10 minutes",!,*7,"PLEASE CHECK WITH THE SITE MANAGER !!",! G EDISP
S AGSSDAY=(AGSSTM/1)-(AGSSBGT/1)*24*60*60,AGSSSEC=AGSSDAY+$P(AGSSTM,",",2)-$P(AGSSBGT,",",2)
W:$G(^AGSSTEMP(AGSSITE,0,"END-PROCESS")) !!,"PROCESS COMPLETE",!!
W:$G(^AGSSTEMP(AGSSITE,0,"NOPEN")) !!,"Could not open host file.",!!
EDISP ;EP END MONITOR DISPLAY
QUIT K DROUT,DIROUT,DUOUT,DTOUT
Q
SET ;
S ^AGSSTEMP(AGSSITE,0,"VOL-RECORD")=25000
S ^AGSSTEMP(AGSSITE,0,"LAST-RECORD")=1000
S ^AGSSTEMP(AGSSITE,0,"CURRENT-TIME")=$H
S ^AGSSTEMP(AGSSITE,0,"BEGIN-TIME")=$P($H,",")_","_($P($H,",",2)-600)
S ^AGSSTEMP(AGSSITE,0,"1ST-LAST-RECORD")=0
S ^AGSSTEMP(AGSSITE,0,"1ST-BEGIN-TIME")=0
Q
AGSSM ; IHS/ASDS/EFG - MONITOR PROGRAM ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
+3 ;this program monitors the background SSA SSN processing
+4 DO DT^DICRW
+5 SET DIC="^AUTTLOC("
SET DIC(0)="AEMQ"
SET DIC("A")="Monitor which Site: "
DO ^DIC
+6 IF +Y<0
QUIT
SET AGSSITE=+Y
+7 FOR
IF ($GET(DROUT)!$GET(DIROUT)!$GET(DUOUT))
QUIT
DO DISP
WRITE !!!,"The display will recycle every 10 seconds",!
KILL DIR
SET DIR("T")=10
SET DIR(0)="E"
DO ^DIR
+8 DO QUIT
+9 QUIT
DISP ;EP
+1 USE IO(0)
WRITE $$S^AGVDF("IOF")
+2 WRITE !,?10,"Monitor Program for the SSA SSN Matching Process"
+3 SET %H=$HOROLOG
DO YX^%DTC
WRITE !!,"The current time is : ",Y
+4 IF '$DATA(^AGSSTEMP)
WRITE !,"The processing program has not started",!!
GOTO EDISP
+5 SET AGSSBGT=$GET(^AGSSTEMP(AGSSITE,0,"BEGIN-TIME"))
SET AGSSTM=$GET(^AGSSTEMP(AGSSITE,0,"CURRENT-TIME"))
SET AGSS1BGT=$GET(^AGSSTEMP(AGSSITE,0,"1ST-BEGIN-TIME"))
+6 SET AGSS1LRC=$GET(^AGSSTEMP(AGSSITE,0,"1ST-LAST-RECORD"))
SET AGSSLRC=$GET(^AGSSTEMP(AGSSITE,0,"LAST-RECORD"))
SET AGSSVOL=$GET(^AGSSTEMP(AGSSITE,0,"VOL-REC"))
+7 WRITE !,"Last Record Processed: "
+8 WRITE !,AGSSLRC
+9 IF ($PIECE(AGSSTM,",")'=$PIECE($HOROLOG,","))!($PIECE($HOROLOG,",",2)-$PIECE(AGSSTM,",",2)>600)
WRITE !!!,"The process has been idle for more than 10 minutes",!,*7,"PLEASE CHECK WITH THE SITE MANAGER !!",!
GOTO EDISP
+10 SET AGSSDAY=(AGSSTM/1)-(AGSSBGT/1)*24*60*60
SET AGSSSEC=AGSSDAY+$PIECE(AGSSTM,",",2)-$PIECE(AGSSBGT,",",2)
+11 IF $GET(^AGSSTEMP(AGSSITE,0,"END-PROCESS"))
WRITE !!,"PROCESS COMPLETE",!!
+12 IF $GET(^AGSSTEMP(AGSSITE,0,"NOPEN"))
WRITE !!,"Could not open host file.",!!
EDISP ;EP END MONITOR DISPLAY
QUIT KILL DROUT,DIROUT,DUOUT,DTOUT
+1 QUIT
SET ;
+1 SET ^AGSSTEMP(AGSSITE,0,"VOL-RECORD")=25000
+2 SET ^AGSSTEMP(AGSSITE,0,"LAST-RECORD")=1000
+3 SET ^AGSSTEMP(AGSSITE,0,"CURRENT-TIME")=$HOROLOG
+4 SET ^AGSSTEMP(AGSSITE,0,"BEGIN-TIME")=$PIECE($HOROLOG,",")_","_($PIECE($HOROLOG,",",2)-600)
+5 SET ^AGSSTEMP(AGSSITE,0,"1ST-LAST-RECORD")=0
+6 SET ^AGSSTEMP(AGSSITE,0,"1ST-BEGIN-TIME")=0
+7 QUIT