BQINRUN ;PRXM/HC/ALA - Nightly Job Status ; 20 Jul 2006 10:34 AM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
EN(DATA) ;EP -- BQI GET NIGHT STATUS
;Description
; Gets the status of the nightly job
;
NEW UID,II,OPTION,FREQ,OPTN,SCHDTM,X
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQINRUN",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQINRUN D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
S @DATA@(II)="D00020SCHEDULED_TO_RUN^T00004FREQUENCY"_$C(30)
S OPTION=$$FIND1^DIC(19,,"X","BQI NIGHTLY BACKGROUND")
S OPTN=$O(^DIC(19.2,"B",OPTION,""))
I OPTN="" G DONE
S SCHDTM=$$GET1^DIQ(19.2,OPTN_",",2,"I")
I SCHDTM'="" S SCHDTM=$$FMTE^BQIUL1(SCHDTM)
S FREQ=$$GET1^DIQ(19.2,OPTN_",",6,"E")
I FREQ="",SCHDTM="" G DONE
S II=II+1,@DATA@(II)=SCHDTM_"^"_FREQ_$C(30)
;
DONE ;
S II=II+1,@DATA@(II)=$C(31)
Q
;
ERR ;
D ^%ZTER
NEW Y,ERRDTM
S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
S BMXSEC="Recording that an error occurred at "_ERRDTM
I $D(II),$D(DATA) S II=II+1,@DATA@(II)=$C(31)
Q
BQINRUN ;PRXM/HC/ALA - Nightly Job Status ; 20 Jul 2006 10:34 AM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
EN(DATA) ;EP -- BQI GET NIGHT STATUS
+1 ;Description
+2 ; Gets the status of the nightly job
+3 ;
+4 NEW UID,II,OPTION,FREQ,OPTN,SCHDTM,X
+5 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+6 SET DATA=$NAME(^TMP("BQINRUN",UID))
+7 KILL @DATA
+8 ;
+9 SET II=0
+10 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQINRUN D UNWIND^%ZTER"
+11 SET @DATA@(II)="D00020SCHEDULED_TO_RUN^T00004FREQUENCY"_$CHAR(30)
+12 SET OPTION=$$FIND1^DIC(19,,"X","BQI NIGHTLY BACKGROUND")
+13 SET OPTN=$ORDER(^DIC(19.2,"B",OPTION,""))
+14 IF OPTN=""
GOTO DONE
+15 SET SCHDTM=$$GET1^DIQ(19.2,OPTN_",",2,"I")
+16 IF SCHDTM'=""
SET SCHDTM=$$FMTE^BQIUL1(SCHDTM)
+17 SET FREQ=$$GET1^DIQ(19.2,OPTN_",",6,"E")
+18 IF FREQ=""
IF SCHDTM=""
GOTO DONE
+19 SET II=II+1
SET @DATA@(II)=SCHDTM_"^"_FREQ_$CHAR(30)
+20 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
ERR ;
+1 DO ^%ZTER
+2 NEW Y,ERRDTM
+3 SET Y=$$NOW^XLFDT()
XECUTE ^DD("DD")
SET ERRDTM=Y
+4 SET BMXSEC="Recording that an error occurred at "_ERRDTM
+5 IF $DATA(II)
IF $DATA(DATA)
SET II=II+1
SET @DATA@(II)=$CHAR(31)
+6 QUIT