Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BQINRUN

BQINRUN.m

Go to the documentation of this file.
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