BQIGPRUN ;PRXM/HC/ALA-GPRA Run RPC ; 23 Jan 2006 1:29 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
EN(DATA,FAKE) ; EP - BQI GET LAST GPRA RUN
;
; Input
; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
; Get the beginning and ending times of the GPRA run
NEW UID,II,BDT,EDT,X,DA,BUDT,BUEDT,HDR,VER,PATCH,LAST
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIGPRUN",UID))
K @DATA
;
S II=0
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIGPRUN D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
S HDR="D00030LAST_NIGHT_RUN_START_DATETIME^D00030LAST_NIGHT_RUN_END_DATETIME^"
S HDR=HDR_"T00004CURRENT_GPRA_YEAR^D00030LAST_UPDATE_START_DATETIME^D00030LAST_UPDATE_END_DATETIME^"
S HDR=HDR_"T00025CRS_VERSION"
S @DATA@(II)=HDR_$C(30)
;
S DA=$O(^BQI(90508,0)) I 'DA G DONE
;
S VER=$$VERSION^XPDUTL("IHS CLINICAL REPORTING")
S LAST=$$LAST^XPDUTL("IHS CLINICAL REPORTING",VER)
S PATCH=$S(LAST=-1:"",1:" Patch "_$P(LAST,U,1))
S PATCH="Version "_VER_PATCH
;
S BDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",3.07,"I"))
S EDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",3.08,"I"))
S BUDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",4.04,"I"))
S BUEDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",4.05,"I"))
S II=II+1,@DATA@(II)=BDT_"^"_EDT_"^"_$$GET1^DIQ(90508,DA_",",2,"E")_"^"_BUDT_"^"_BUEDT_"^"_PATCH_$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
BQIGPRUN ;PRXM/HC/ALA-GPRA Run RPC ; 23 Jan 2006 1:29 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
EN(DATA,FAKE) ; EP - BQI GET LAST GPRA RUN
+1 ;
+2 ; Input
+3 ; FAKE - extra 'blank' parameter required by BMXNET async 'feature'
+4 ; Get the beginning and ending times of the GPRA run
+5 NEW UID,II,BDT,EDT,X,DA,BUDT,BUEDT,HDR,VER,PATCH,LAST
+6 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+7 SET DATA=$NAME(^TMP("BQIGPRUN",UID))
+8 KILL @DATA
+9 ;
+10 SET II=0
+11 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIGPRUN D UNWIND^%ZTER"
+12 ;
+13 SET HDR="D00030LAST_NIGHT_RUN_START_DATETIME^D00030LAST_NIGHT_RUN_END_DATETIME^"
+14 SET HDR=HDR_"T00004CURRENT_GPRA_YEAR^D00030LAST_UPDATE_START_DATETIME^D00030LAST_UPDATE_END_DATETIME^"
+15 SET HDR=HDR_"T00025CRS_VERSION"
+16 SET @DATA@(II)=HDR_$CHAR(30)
+17 ;
+18 SET DA=$ORDER(^BQI(90508,0))
IF 'DA
GOTO DONE
+19 ;
+20 SET VER=$$VERSION^XPDUTL("IHS CLINICAL REPORTING")
+21 SET LAST=$$LAST^XPDUTL("IHS CLINICAL REPORTING",VER)
+22 SET PATCH=$SELECT(LAST=-1:"",1:" Patch "_$PIECE(LAST,U,1))
+23 SET PATCH="Version "_VER_PATCH
+24 ;
+25 SET BDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",3.07,"I"))
+26 SET EDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",3.08,"I"))
+27 SET BUDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",4.04,"I"))
+28 SET BUEDT=$$FMTE^BQIUL1($$GET1^DIQ(90508,DA_",",4.05,"I"))
+29 SET II=II+1
SET @DATA@(II)=BDT_"^"_EDT_"^"_$$GET1^DIQ(90508,DA_",",2,"E")_"^"_BUDT_"^"_BUEDT_"^"_PATCH_$CHAR(30)
+30 ;
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