ACPTENV ; IHS/SD/SDR - Environment checker for ACPT V2.07 ; 5/7/2003 2:03:41 PM [ 02/03/2004 12:28 PM ]
;;2.07;CPT FILES;**1,2**;DEC 31,2006
;
I '$G(DUZ) W !,"DUZ UNDEFINED OR 0." D SORRY(2) Q
;
I '$L($G(DUZ(0))) W !,"DUZ(0) UNDEFINED OR NULL." D SORRY(2) Q
;
S X=$P(^VA(200,DUZ,0),U)
W !!,$$CJ^XLFSTR("Hello, "_$P(X,",",2)_" "_$P(X,","),IOM)
W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" V "_$P($T(+2),";",3)_" Patch "_$P($T(+2),";",5)_".",IOM),!
;
NEW ACPTQUIT
S ACPTQUIT=0
I '$$VCHK("XU","8",2) S ACPTQUIT=2
;
I '$$VCHK("XT","7.3",2) S ACPTQUIT=2
;
I '$$VCHK("DI","21",2) S ACPTQUIT=2
;
;I '$$VCHK("ACPT","2.06",2) S ACPTQUIT=2 ;acpt*2*07*1
I '$$VCHK("ACPT","2.07",2) S ACPTQUIT=2 ;acpt*2*07*1
;
NEW DA,DIC
S X="ACPT",DIC="^DIC(9.4,",DIC(0)="",D="C"
D IX^DIC
I Y<0,$D(^DIC(9.4,"C","ACPT")) D S ACPTQUIT=2
. W !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""ACPT"" prefix.",IOM)
. W !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
. W !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7
.Q
;
I ACPTQUIT D SORRY(ACPTQUIT) Q
;
W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
;
I '$$DIR^XBDIR("E","","","","","",1) D SORRY(2) Q
Q
;
SORRY(X) ;
KILL DIFQ
S XPDQUIT=X
W:'$D(ZTQUEUED) *7,!,$$CJ^XLFSTR("Sorry....",IOM),$$DIR^XBDIR("E","Press RETURN")
Q
;
VCHK(ACPTPRE,ACPTVER,ACPTQUIT) ; Check versions needed.
;
NEW ACPTV
S ACPTV=$$VERSION^XPDUTL(ACPTPRE)
W !,$$CJ^XLFSTR("Need at least "_ACPTPRE_" v "_ACPTVER_"....."_ACPTPRE_" v "_ACPTV_" Present",IOM)
I ACPTV<ACPTVER W *7,!,$$CJ^XLFSTR("^^^^**NEEDS FIXED**^^^^",IOM) Q 0
Q 1
;
INSTALLD(ACPTINST) ;EP - Determine if patch ACPTINST was installed, where ACPTINST is
; the name of the INSTALL. E.g "AG*6.0*10".
;;^DIC(9.4,D0,22,D1,PAH,D2,0)=
;;(#.01) PATCH APPLICATION HISTORY [1F] ^ (#.02)DATE APPLIED [2D] ^ (#.03) APPLIED BY [3P] ^
NEW DIC,X,Y
S X=$P(ACPTINST,"*",1)
S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
D IX^DIC
I Y<1 Q 0
S DIC=DIC_+Y_",22,",X=$P(ACPTINST,"*",2)
D ^DIC
I Y<1 Q 0
S DIC=DIC_+Y_",""PAH"",",X=$P(ACPTINST,"*",3)
D ^DIC
Q $S(Y<1:0,1:1)
;
ACPTENV ; IHS/SD/SDR - Environment checker for ACPT V2.07 ; 5/7/2003 2:03:41 PM [ 02/03/2004 12:28 PM ]
+1 ;;2.07;CPT FILES;**1,2**;DEC 31,2006
+2 ;
+3 IF '$GET(DUZ)
WRITE !,"DUZ UNDEFINED OR 0."
DO SORRY(2)
QUIT
+4 ;
+5 IF '$LENGTH($GET(DUZ(0)))
WRITE !,"DUZ(0) UNDEFINED OR NULL."
DO SORRY(2)
QUIT
+6 ;
+7 SET X=$PIECE(^VA(200,DUZ,0),U)
+8 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","),IOM)
+9 WRITE !!,$$CJ^XLFSTR("Checking Environment for "_$PIECE($TEXT(+2),";",4)_" V "_$PIECE($TEXT(+2),";",3)_" Patch "_$PIECE($TEXT(+2),";",5)_".",IOM),!
+10 ;
+11 NEW ACPTQUIT
+12 SET ACPTQUIT=0
+13 IF '$$VCHK("XU","8",2)
SET ACPTQUIT=2
+14 ;
+15 IF '$$VCHK("XT","7.3",2)
SET ACPTQUIT=2
+16 ;
+17 IF '$$VCHK("DI","21",2)
SET ACPTQUIT=2
+18 ;
+19 ;I '$$VCHK("ACPT","2.06",2) S ACPTQUIT=2 ;acpt*2*07*1
+20 ;acpt*2*07*1
IF '$$VCHK("ACPT","2.07",2)
SET ACPTQUIT=2
+21 ;
+22 NEW DA,DIC
+23 SET X="ACPT"
SET DIC="^DIC(9.4,"
SET DIC(0)=""
SET D="C"
+24 DO IX^DIC
+25 IF Y<0
IF $DATA(^DIC(9.4,"C","ACPT"))
Begin DoDot:1
+26 WRITE !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""ACPT"" prefix.",IOM)
+27 WRITE !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
+28 WRITE !,$$CJ^XLFSTR("FIX IT! Before Proceeding.",IOM),!!,*7,*7,*7
+29 QUIT
End DoDot:1
SET ACPTQUIT=2
+30 ;
+31 IF ACPTQUIT
DO SORRY(ACPTQUIT)
QUIT
+32 ;
+33 WRITE !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
+34 ;
+35 IF '$$DIR^XBDIR("E","","","","","",1)
DO SORRY(2)
QUIT
+36 QUIT
+37 ;
SORRY(X) ;
+1 KILL DIFQ
+2 SET XPDQUIT=X
+3 IF '$DATA(ZTQUEUED)
WRITE *7,!,$$CJ^XLFSTR("Sorry....",IOM),$$DIR^XBDIR("E","Press RETURN")
+4 QUIT
+5 ;
VCHK(ACPTPRE,ACPTVER,ACPTQUIT) ; Check versions needed.
+1 ;
+2 NEW ACPTV
+3 SET ACPTV=$$VERSION^XPDUTL(ACPTPRE)
+4 WRITE !,$$CJ^XLFSTR("Need at least "_ACPTPRE_" v "_ACPTVER_"....."_ACPTPRE_" v "_ACPTV_" Present",IOM)
+5 IF ACPTV<ACPTVER
WRITE *7,!,$$CJ^XLFSTR("^^^^**NEEDS FIXED**^^^^",IOM)
QUIT 0
+6 QUIT 1
+7 ;
INSTALLD(ACPTINST) ;EP - Determine if patch ACPTINST was installed, where ACPTINST is
+1 ; the name of the INSTALL. E.g "AG*6.0*10".
+2 ;;^DIC(9.4,D0,22,D1,PAH,D2,0)=
+3 ;;(#.01) PATCH APPLICATION HISTORY [1F] ^ (#.02)DATE APPLIED [2D] ^ (#.03) APPLIED BY [3P] ^
+4 NEW DIC,X,Y
+5 SET X=$PIECE(ACPTINST,"*",1)
+6 SET DIC="^DIC(9.4,"
SET DIC(0)="FM"
SET D="C"
+7 DO IX^DIC
+8 IF Y<1
QUIT 0
+9 SET DIC=DIC_+Y_",22,"
SET X=$PIECE(ACPTINST,"*",2)
+10 DO ^DIC
+11 IF Y<1
QUIT 0
+12 SET DIC=DIC_+Y_",""PAH"","
SET X=$PIECE(ACPTINST,"*",3)
+13 DO ^DIC
+14 QUIT $SELECT(Y<1:0,1:1)
+15 ;