AGGVER ;VNGT/HS/DLS - Get AGG Version Info ; 12 Apr 2010 12:24 PM
;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
;;
;
Q
;
EN(DATA,PKG) ; EP -- AGG 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^AGGVER 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=""
I MAJIEN'="" 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(^AGG(90508,1,0)),U,8),RVER=$P($G(^AGG(90508,1,0)),U,9)
S GVER="1.0.0.45",RVER="1.0.0.45"
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
;
REG(DATA,FAKE) ;EP -- AGG CHECK DIVISION
NEW UID,II
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("AGGDUZK",UID))
K @DATA
;
S II=0
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGVER D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
S @DATA@(II)="I00010RESULT^T01024MSG"_$C(30)
S RESULT=1,MSG=""
I $G(^AGFAC(DUZ(2),0))="" D
. S RESULT=-1,MSG="The REGISTRATION PARAMETERS file has not been completed for this facility. Please contact your system support person."
F AG=2:1:26 I $P($G(^AGFAC(DUZ(2),0)),U,AG)="" D
. S RESULT=-1,MSG="The REGISTRATION PARAMETERS file has not been completed for this facility. Please contact your system support person."
S II=II+1,@DATA@(II)=RESULT_U_MSG_$C(30)
S II=II+1,@DATA@(II)=$C(31)
Q
AGGVER ;VNGT/HS/DLS - Get AGG Version Info ; 12 Apr 2010 12:24 PM
+1 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
+2 ;;
+3 ;
+4 QUIT
+5 ;
EN(DATA,PKG) ; EP -- AGG 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^AGGVER 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=""
+12 IF MAJIEN'=""
SET PTCHIEN=$ORDER(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH","A"),-1)
+13 IF PTCHIEN'=""
Begin DoDot:1
+14 SET PATCH=$PIECE(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH",PTCHIEN,0),"^",1)
+15 SET PTCHDT=$PIECE(^DIC(9.4,PKGIEN,22,MAJIEN,"PAH",PTCHIEN,0),"^",2)
End DoDot:1
+16 ;
+17 ;S GVER=$P($G(^AGG(90508,1,0)),U,8),RVER=$P($G(^AGG(90508,1,0)),U,9)
+18 SET GVER="1.0.0.45"
SET RVER="1.0.0.45"
+19 SET II=II+1
SET @DATA@(II)=PKG_"^"_$GET(MAJVER)_"^"_$GET(MAJDT)_"^"_$GET(PATCH)_"^"_$GET(PTCHDT)_"^"_GVER_"^"_RVER_$CHAR(30)
+20 ;
+21 ;Drop down to DONE
+22 ;
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
+7 ;
REG(DATA,FAKE) ;EP -- AGG CHECK DIVISION
+1 NEW UID,II
+2 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+3 SET DATA=$NAME(^TMP("AGGDUZK",UID))
+4 KILL @DATA
+5 ;
+6 SET II=0
+7 ;
+8 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^AGGVER D UNWIND^%ZTER"
+9 SET @DATA@(II)="I00010RESULT^T01024MSG"_$CHAR(30)
+10 SET RESULT=1
SET MSG=""
+11 IF $GET(^AGFAC(DUZ(2),0))=""
Begin DoDot:1
+12 SET RESULT=-1
SET MSG="The REGISTRATION PARAMETERS file has not been completed for this facility. Please contact your system support person."
End DoDot:1
+13 FOR AG=2:1:26
IF $PIECE($GET(^AGFAC(DUZ(2),0)),U,AG)=""
Begin DoDot:1
+14 SET RESULT=-1
SET MSG="The REGISTRATION PARAMETERS file has not been completed for this facility. Please contact your system support person."
End DoDot:1
+15 SET II=II+1
SET @DATA@(II)=RESULT_U_MSG_$CHAR(30)
+16 SET II=II+1
SET @DATA@(II)=$CHAR(31)
+17 QUIT