ACRFPENV ;IHS/OIRM/DSD/AEF - PATCH ENVIRONMENT CHECK ROUTINE [ 1/25/2007 2:02 PM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;**22**;NOV 05, 2001
;
EN(ACRPCHN,ACRPCHS,XPDQUIT) ;EP
;----- MAIN ENTRY POINT
;
; INPUT:
; ACRPCHN = PATCH NAME
; ACRPCHS = PREREQUISITE PATCH NUMBERS
;
; OUTPUT:
; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE
; 1 = QUIT
;
D CHK(ACRPCHN,ACRPCHS,.XPDQUIT)
;
I $G(XPDQUIT) D Q
. D BMES^XPDUTL("This patch cannot be installed on your system.")
D BMES^XPDUTL("Everything looks OK, you may continue with installation.")
Q
CHK(ACRPCHN,ACRPCHS,XPDQUIT) ;EP
;----- DETERMINES IF PATCH VERSION MATCHES PACKAGE VERSION
;
; INPUT:
; ACRPCHN = PATCH NAME
; ACRPCHS = PREREQUISITE PATCH NUMBERS
;
; OUTPUT:
; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE
; 1 = QUIT
;
N D0,D1,I,J,P,X,Y,Z
;
S Y=$$VERSION^XPDUTL("ADMIN RESOURCE MGT SYSTEM")
;
;----- CHECK TO SEE IF ARMS IS INSTALLED
;
S D0=$O(^DIC(9.4,"B","ADMIN RESOURCE MGT SYSTEM",0))
I 'D0 D Q
. S XPDQUIT=1
. D BMES^XPDUTL("Unable to find 'ADMIN RESOURCE MGT SYSTEM' package in the Package file.")
;
S D1=$O(^DIC(9.4,D0,22,"B",Y,0))
I 'D1 D Q
. S XPDQUIT=1
. S X="Unable to find 'ADMIN RESOURCE MGT SYSTEM' Version "_Y_" in the Package file"
. D BMES^XPDUTL(X)
;
;----- CHECK TO SEE IF PATCH MATCHES CURRENT VERSION
;
I Y'=$$VER^XPDUTL(ACRPCHN) D Q
. S XPDQUIT=1
. S X="This patch is for ARMS version "_$$VER^XPDUTL(ACRPCHN)_" but you are running version "_Y_"."
. D BMES^XPDUTL(X)
;
;----- CHECK FOR REQUIRED PATCHES
;
Q:$G(ACRPCHS)']""
F I=1:1:$L(ACRPCHS,",") D
. S Z=$P(ACRPCHS,",",I)
. I Z["-" D Q
. . F J=$P(Z,"-"):1:$P(Z,"-",2) D
. . . I '$D(^DIC(9.4,D0,22,D1,"PAH","B",J)) D
. . . . S XPDQUIT=1
. . . . D PMSG(Y,J)
. I '$D(^DIC(9.4,D0,22,D1,"PAH","B",Z)) D
. . S XPDQUIT=1
. . D PMSG(Y,Z)
Q
PMSG(Y,P) ;
;----- ISSUE MISSING PATCH MESSAGE
;
; Y = VERSION NUMBER
; P = PATCH NUMBER
;
N X
S X="Patch ACR*"_Y_"*"_P_" is missing"
D BMES^XPDUTL(X)
Q
ACRFPENV ;IHS/OIRM/DSD/AEF - PATCH ENVIRONMENT CHECK ROUTINE [ 1/25/2007 2:02 PM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**22**;NOV 05, 2001
+2 ;
EN(ACRPCHN,ACRPCHS,XPDQUIT) ;EP
+1 ;----- MAIN ENTRY POINT
+2 ;
+3 ; INPUT:
+4 ; ACRPCHN = PATCH NAME
+5 ; ACRPCHS = PREREQUISITE PATCH NUMBERS
+6 ;
+7 ; OUTPUT:
+8 ; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE
+9 ; 1 = QUIT
+10 ;
+11 DO CHK(ACRPCHN,ACRPCHS,.XPDQUIT)
+12 ;
+13 IF $GET(XPDQUIT)
Begin DoDot:1
+14 DO BMES^XPDUTL("This patch cannot be installed on your system.")
End DoDot:1
QUIT
+15 DO BMES^XPDUTL("Everything looks OK, you may continue with installation.")
+16 QUIT
CHK(ACRPCHN,ACRPCHS,XPDQUIT) ;EP
+1 ;----- DETERMINES IF PATCH VERSION MATCHES PACKAGE VERSION
+2 ;
+3 ; INPUT:
+4 ; ACRPCHN = PATCH NAME
+5 ; ACRPCHS = PREREQUISITE PATCH NUMBERS
+6 ;
+7 ; OUTPUT:
+8 ; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE
+9 ; 1 = QUIT
+10 ;
+11 NEW D0,D1,I,J,P,X,Y,Z
+12 ;
+13 SET Y=$$VERSION^XPDUTL("ADMIN RESOURCE MGT SYSTEM")
+14 ;
+15 ;----- CHECK TO SEE IF ARMS IS INSTALLED
+16 ;
+17 SET D0=$ORDER(^DIC(9.4,"B","ADMIN RESOURCE MGT SYSTEM",0))
+18 IF 'D0
Begin DoDot:1
+19 SET XPDQUIT=1
+20 DO BMES^XPDUTL("Unable to find 'ADMIN RESOURCE MGT SYSTEM' package in the Package file.")
End DoDot:1
QUIT
+21 ;
+22 SET D1=$ORDER(^DIC(9.4,D0,22,"B",Y,0))
+23 IF 'D1
Begin DoDot:1
+24 SET XPDQUIT=1
+25 SET X="Unable to find 'ADMIN RESOURCE MGT SYSTEM' Version "_Y_" in the Package file"
+26 DO BMES^XPDUTL(X)
End DoDot:1
QUIT
+27 ;
+28 ;----- CHECK TO SEE IF PATCH MATCHES CURRENT VERSION
+29 ;
+30 IF Y'=$$VER^XPDUTL(ACRPCHN)
Begin DoDot:1
+31 SET XPDQUIT=1
+32 SET X="This patch is for ARMS version "_$$VER^XPDUTL(ACRPCHN)_" but you are running version "_Y_"."
+33 DO BMES^XPDUTL(X)
End DoDot:1
QUIT
+34 ;
+35 ;----- CHECK FOR REQUIRED PATCHES
+36 ;
+37 IF $GET(ACRPCHS)']""
QUIT
+38 FOR I=1:1:$LENGTH(ACRPCHS,",")
Begin DoDot:1
+39 SET Z=$PIECE(ACRPCHS,",",I)
+40 IF Z["-"
Begin DoDot:2
+41 FOR J=$PIECE(Z,"-"):1:$PIECE(Z,"-",2)
Begin DoDot:3
+42 IF '$DATA(^DIC(9.4,D0,22,D1,"PAH","B",J))
Begin DoDot:4
+43 SET XPDQUIT=1
+44 DO PMSG(Y,J)
End DoDot:4
End DoDot:3
End DoDot:2
QUIT
+45 IF '$DATA(^DIC(9.4,D0,22,D1,"PAH","B",Z))
Begin DoDot:2
+46 SET XPDQUIT=1
+47 DO PMSG(Y,Z)
End DoDot:2
End DoDot:1
+48 QUIT
PMSG(Y,P) ;
+1 ;----- ISSUE MISSING PATCH MESSAGE
+2 ;
+3 ; Y = VERSION NUMBER
+4 ; P = PATCH NUMBER
+5 ;
+6 NEW X
+7 SET X="Patch ACR*"_Y_"*"_P_" is missing"
+8 DO BMES^XPDUTL(X)
+9 QUIT