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

BQIGPRUN.m

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