BEHUENV ;MSC/IND/PLS - Environment Checker ;05-Nov-2012 16:59;PLS
;;1.2;BEH UTILITIES;**2**;Mar 20, 2007;Build 3
;=================================================================
; Patch 2 = EHR v1.1 Patch 11
ENV ;EP - Environment check
N VAL,PAT,X,PATCHK,HDR,LEHR,HDRTXT
S XPDABORT=0
S HDR=0,HDRTXT="The following are missing from the RPMS environment:"
F VAL=0:1 S X=$P($T(ENVDAT+VAL),";;",2) Q:'$L(X) D
.S PATCHK='$$PATCH^XPDUTL(X)
.I PATCHK D
..I 'HDR D
...D BMES^XPDUTL(HDRTXT)
...S HDR=1
..D BMES^XPDUTL(" "_X)
.S:PATCHK XPDABORT=1
S LEHR=$$FNDEHR("EHR*1.1*10")
I LEHR
.I 'HDR D
..D BMES^XPDUTL(HDRTXT)
..S HDR=1
.D BMES^XPDUTL(" EHR*1.1*10")
I 'XPDABORT D
.W !!,"All requirements for installation have been met...",!
E D
.W !!,"Unable to continue with the installation...",!
Q
Q
;
; Find last EHR installation
FND() ;EP
N LP,IEN,LSTDT,DAT,DATA,ERR
D FIND^DIC(9.7,"","@;.01;17I","P","EHR",,,"","","DATA","ERR")
S LP=0,IEN=0,LSTDT=0 F S LP=$O(DATA("DILIST",LP)) Q:'LP D
.S DAT=DATA("DILIST",LP,0)
.I $P(DAT,U,3)>LSTDT D
..S IEN=LP
..S LSTDT=$P(DAT,U,3)
Q $S(IEN:DATA("DILIST",IEN,0),1:"")
; Returns flag indicating lack of EHR v1.1 Patch 10
FNDEHR(X) ;
N STAT,INSTDA
S INSTDA=""
Q:'$D(^XPD(9.7,"B",X)) 1
S INSTDA=$O(^XPD(9.7,"B",X,INSTDA),-1)
S STAT=+$P($G(^XPD(9.7,INSTDA,0)),U,9)
Q STAT'=3
; To add to the list of requirements, add the info specific to the
; application after the "ENV" label, below in the form:
; Namespace*Version*Patch
; E.g., to check for Pt Reg, v 6.1, patch 2:
; AG*6.1*2
; If the application has no patches, leave the patch info blank.
;
ENVDAT ;;XU*8.0*1017
;;XT*7.3*1017
;;DI*22.0*1017
;;XWB*1.1*1017
;;BJPC*2.0*8
;;GMRA*4.0*1005
;;GMPL*2.0*1001
;;GMRV*5.0*1001
;;GMRC*3.0*1002
;;TIU*1.0*1010
;;PXRM*1.5*1009
;;APSP*7.0*1014
;;BRA*5.0*1003
;;LR*5.2*1031
;;PIMS*5.3*1015
;;
BEHUENV ;MSC/IND/PLS - Environment Checker ;05-Nov-2012 16:59;PLS
+1 ;;1.2;BEH UTILITIES;**2**;Mar 20, 2007;Build 3
+2 ;=================================================================
+3 ; Patch 2 = EHR v1.1 Patch 11
ENV ;EP - Environment check
+1 NEW VAL,PAT,X,PATCHK,HDR,LEHR,HDRTXT
+2 SET XPDABORT=0
+3 SET HDR=0
SET HDRTXT="The following are missing from the RPMS environment:"
+4 FOR VAL=0:1
SET X=$PIECE($TEXT(ENVDAT+VAL),";;",2)
IF '$LENGTH(X)
QUIT
Begin DoDot:1
+5 SET PATCHK='$$PATCH^XPDUTL(X)
+6 IF PATCHK
Begin DoDot:2
+7 IF 'HDR
Begin DoDot:3
+8 DO BMES^XPDUTL(HDRTXT)
+9 SET HDR=1
End DoDot:3
+10 DO BMES^XPDUTL(" "_X)
End DoDot:2
+11 IF PATCHK
SET XPDABORT=1
End DoDot:1
+12 SET LEHR=$$FNDEHR("EHR*1.1*10")
+13 IF LEHR
+14
*** ERROR ***
+15
*** ERROR ***
+16
*** ERROR ***
+17
*** ERROR ***
+18 IF 'XPDABORT
Begin DoDot:1
+19 WRITE !!,"All requirements for installation have been met...",!
End DoDot:1
+20 IF '$TEST
Begin DoDot:1
+21 WRITE !!,"Unable to continue with the installation...",!
End DoDot:1
+22 QUIT
+23 QUIT
+24 ;
+25 ; Find last EHR installation
FND() ;EP
+1 NEW LP,IEN,LSTDT,DAT,DATA,ERR
+2 DO FIND^DIC(9.7,"","@;.01;17I","P","EHR",,,"","","DATA","ERR")
+3 SET LP=0
SET IEN=0
SET LSTDT=0
FOR
SET LP=$ORDER(DATA("DILIST",LP))
IF 'LP
QUIT
Begin DoDot:1
+4 SET DAT=DATA("DILIST",LP,0)
+5 IF $PIECE(DAT,U,3)>LSTDT
Begin DoDot:2
+6 SET IEN=LP
+7 SET LSTDT=$PIECE(DAT,U,3)
End DoDot:2
End DoDot:1
+8 QUIT $SELECT(IEN:DATA("DILIST",IEN,0),1:"")
+9 ; Returns flag indicating lack of EHR v1.1 Patch 10
FNDEHR(X) ;
+1 NEW STAT,INSTDA
+2 SET INSTDA=""
+3 IF '$DATA(^XPD(9.7,"B",X))
QUIT 1
+4 SET INSTDA=$ORDER(^XPD(9.7,"B",X,INSTDA),-1)
+5 SET STAT=+$PIECE($GET(^XPD(9.7,INSTDA,0)),U,9)
+6 QUIT STAT'=3
+7 ; To add to the list of requirements, add the info specific to the
+8 ; application after the "ENV" label, below in the form:
+9 ; Namespace*Version*Patch
+10 ; E.g., to check for Pt Reg, v 6.1, patch 2:
+11 ; AG*6.1*2
+12 ; If the application has no patches, leave the patch info blank.
+13 ;
ENVDAT ;;XU*8.0*1017
+1 ;;XT*7.3*1017
+2 ;;DI*22.0*1017
+3 ;;XWB*1.1*1017
+4 ;;BJPC*2.0*8
+5 ;;GMRA*4.0*1005
+6 ;;GMPL*2.0*1001
+7 ;;GMRV*5.0*1001
+8 ;;GMRC*3.0*1002
+9 ;;TIU*1.0*1010
+10 ;;PXRM*1.5*1009
+11 ;;APSP*7.0*1014
+12 ;;BRA*5.0*1003
+13 ;;LR*5.2*1031
+14 ;;PIMS*5.3*1015
+15 ;;