BQIFLRUN ;PRXM/HC/ALA-Get Flag Run RPC ; 23 Jan 2006 1:41 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
EN(DATA,FAKE) ; EP - BQI GET LAST FLAG RUN
;
; Input
; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
;
; Get the beginning and ending times of the Flag run
NEW UID,II,BDT,EDT,X,DA
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIFLRUN",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIFLRUN D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S @DATA@(II)="D00030LAST_RUN_START_DATETIME^D00030LAST_RUN_END_DATETIME"_$C(30)
;
S DA=$O(^BQI(90508,0)) I 'DA G DONE
;
S BDT=$$GET1^DIQ(90508,DA_",",3.01,"I"),EDT=$$GET1^DIQ(90508,DA_",",3.02,"I")
S II=II+1,@DATA@(II)=$$FMTE^BQIUL1(BDT)_"^"_$$FMTE^BQIUL1(EDT)_$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
BQIFLRUN ;PRXM/HC/ALA-Get Flag Run RPC ; 23 Jan 2006 1:41 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
EN(DATA,FAKE) ; EP - BQI GET LAST FLAG RUN
+1 ;
+2 ; Input
+3 ; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
+4 ;
+5 ; Get the beginning and ending times of the Flag run
+6 NEW UID,II,BDT,EDT,X,DA
+7 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+8 SET DATA=$NAME(^TMP("BQIFLRUN",UID))
+9 KILL @DATA
+10 ;
+11 SET II=0
+12 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIFLRUN D UNWIND^%ZTER"
+13 ;
+14 SET @DATA@(II)="D00030LAST_RUN_START_DATETIME^D00030LAST_RUN_END_DATETIME"_$CHAR(30)
+15 ;
+16 SET DA=$ORDER(^BQI(90508,0))
IF 'DA
GOTO DONE
+17 ;
+18 SET BDT=$$GET1^DIQ(90508,DA_",",3.01,"I")
SET EDT=$$GET1^DIQ(90508,DA_",",3.02,"I")
+19 SET II=II+1
SET @DATA@(II)=$$FMTE^BQIUL1(BDT)_"^"_$$FMTE^BQIUL1(EDT)_$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