BQIVER ;PRXM/HC/DLS - Get BQI Version Info ; 02 Mar 2006 12:03 PM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
EN(DATA,PKG) ; EP -- BQI VERSION INFO
;Description
; Get the package version number and the distribution date.
;
;Input
; PKG - Namespace
;
;Output
; DATA - Name of global in which data is stored(^TMP(PROCNM,UID))
;
N UID,II,DA,X,IENS,PROCNM,GVER,RVER
N PKGIEN,MAJVER,MAJDT,MAJIEN,PATCH,PTCHDT,PTCHIEN,FIND
;
S PROCNM=$G(PKG)_"VER"
;
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP(PROCNM,UID))
K @DATA
;
S II=0
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIVER D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
I PKG="" G DONE
D HDR
;
GETDATA ;
D FIND^DIC(9.4,"","","",PKG,"","C","","","FIND")
S PKGIEN=$G(FIND("DILIST",2,1))
I PKGIEN="" G DONE
S MAJVER=$G(^DIC(9.4,PKGIEN,"VERSION"))
S MAJIEN=$O(^DIC(9.4,PKGIEN,22,"B",MAJVER,""))
S DA(1)=PKGIEN,DA=MAJIEN,IENS=$$IENS^DILF(.DA)
S MAJDT=$$GET1^DIQ(9.49,IENS,1,"I")
;
; Minor version information commented.
; Not sure if this will be necessary.
S PTCHIEN=$O(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH","A"),-1)
I PTCHIEN'="" D
. S PATCH=$P(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH",PTCHIEN,0),"^",1)
. S PTCHDT=$P(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH",PTCHIEN,0),"^",2)
;
S GVER=$P($G(^BQI(90508,1,0)),U,8),RVER=$P($G(^BQI(90508,1,0)),U,9)
S II=II+1,@DATA@(II)=PKG_"^"_$G(MAJVER)_"^"_$G(MAJDT)_"^"_$G(PATCH)_"^"_$G(PTCHDT)_"^"_GVER_"^"_RVER_$C(30)
;
;Drop down to DONE
;
DONE ;
S II=II+1,@DATA@(II)=$C(31)
Q
;
HDR ;
S II=II+1,@DATA@(II)="T00010PKG^T00010MAJ_VER^D00015MAJ_DT^T00010PATCH_LAST^D00015PATCH_DT^T00006GUI_TEST_VERSION^T00006RPMS_TEST_VERSION"_$C(30)
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
BQIVER ;PRXM/HC/DLS - Get BQI Version Info ; 02 Mar 2006 12:03 PM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
EN(DATA,PKG) ; EP -- BQI VERSION INFO
+1 ;Description
+2 ; Get the package version number and the distribution date.
+3 ;
+4 ;Input
+5 ; PKG - Namespace
+6 ;
+7 ;Output
+8 ; DATA - Name of global in which data is stored(^TMP(PROCNM,UID))
+9 ;
+10 NEW UID,II,DA,X,IENS,PROCNM,GVER,RVER
+11 NEW PKGIEN,MAJVER,MAJDT,MAJIEN,PATCH,PTCHDT,PTCHIEN,FIND
+12 ;
+13 SET PROCNM=$GET(PKG)_"VER"
+14 ;
+15 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+16 SET DATA=$NAME(^TMP(PROCNM,UID))
+17 KILL @DATA
+18 ;
+19 SET II=0
+20 ;
+21 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIVER D UNWIND^%ZTER"
+22 ;
+23 IF PKG=""
GOTO DONE
+24 DO HDR
+25 ;
GETDATA ;
+1 DO FIND^DIC(9.4,"","","",PKG,"","C","","","FIND")
+2 SET PKGIEN=$GET(FIND("DILIST",2,1))
+3 IF PKGIEN=""
GOTO DONE
+4 SET MAJVER=$GET(^DIC(9.4,PKGIEN,"VERSION"))
+5 SET MAJIEN=$ORDER(^DIC(9.4,PKGIEN,22,"B",MAJVER,""))
+6 SET DA(1)=PKGIEN
SET DA=MAJIEN
SET IENS=$$IENS^DILF(.DA)
+7 SET MAJDT=$$GET1^DIQ(9.49,IENS,1,"I")
+8 ;
+9 ; Minor version information commented.
+10 ; Not sure if this will be necessary.
+11 SET PTCHIEN=$ORDER(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH","A"),-1)
+12 IF PTCHIEN'=""
Begin DoDot:1
+13 SET PATCH=$PIECE(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH",PTCHIEN,0),"^",1)
+14 SET PTCHDT=$PIECE(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH",PTCHIEN,0),"^",2)
End DoDot:1
+15 ;
+16 SET GVER=$PIECE($GET(^BQI(90508,1,0)),U,8)
SET RVER=$PIECE($GET(^BQI(90508,1,0)),U,9)
+17 SET II=II+1
SET @DATA@(II)=PKG_"^"_$GET(MAJVER)_"^"_$GET(MAJDT)_"^"_$GET(PATCH)_"^"_$GET(PTCHDT)_"^"_GVER_"^"_RVER_$CHAR(30)
+18 ;
+19 ;Drop down to DONE
+20 ;
DONE ;
+1 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+2 QUIT
+3 ;
HDR ;
+1 SET II=II+1
SET @DATA@(II)="T00010PKG^T00010MAJ_VER^D00015MAJ_DT^T00010PATCH_LAST^D00015PATCH_DT^T00006GUI_TEST_VERSION^T00006RPMS_TEST_VERSION"_$CHAR(30)
+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