ACRF22EN ;IHS/OIRM/DSD/AEF - PATCH 22 ENVIRONMENT CHECK ROUTINE [ 1/25/2007 3:52 PM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;**22**;NOV 05, 2001
;
EN ;EP -- MAIN ENTRY POINT
;
;CALL GENERIC EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT) ENVIRONMENT
;CHECK ROUTINE
;
; WHERE:
; ACRPCHN = PATCH NAME
; ACRPCHS = PREREQUISITE PATCH NUMBERS
; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE OUTPUT
; 1 = QUIT
;
K XPDQUIT
;
;USE TO PERFORM ENVIRONMENT CHECK ON THE AUT PACKAGE. COMMENT OUT IF NOT NEEDED.
K ACRAUTCK
S ACRAUTCK=""
I $D(ACRAUTCK) D
.S ACRPCHN="AUT*98.1*21"
.S ACRPCHS="21" ;LATEST RELEASED AUT PATCH #
.D CHKAUT(ACRPCHN,ACRPCHS,.XPDQUIT)
K ACRAUTCK
;END OF AUT CHECK
;BEGINNING OF ACR VERSION AND PATCH CHECKS
S ACRPCHN="ACR*2.1*22"
S ACRPCHS="1,2,3,4,5,6,7,8,12,13,14,15,16,17,18,19,20,21" ;REQUIRED PATCHES
D EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT)
;END OF ACR VERSION AND PATCH CHECKS
Q
;FROM HERE DOWN WAS ADDED TO GIVE THE ABILITY TO
; DO AN ENVIRONMENT CHECK ON THE AUT PACKAGE
CHKAUT(ACRPCHN,ACRPCHS,XPDQUIT) ;EP ENVIRONMENT CHECK FOR AUT
;----- MAIN ENTRY POINT
;
; INPUT:
; ACRPCHN = PATCH NAME
; ACRPCHS = PREREQUISITE PATCH NUMBERS
;
; OUTPUT:
; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE
; 1 = QUIT
;
K XPDQUIT
;
D CHK(ACRPCHN,ACRPCHS,.XPDQUIT)
;
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("IHS DICTIONARIES (POINTERS)")
;
;----- CHECK TO SEE IF AUT IS INSTALLED
;
S D0=$O(^DIC(9.4,"B","IHS DICTIONARIES (POINTERS)",0))
I 'D0 D Q
. S XPDQUIT=1
. D BMES^XPDUTL("Unable to find 'IHS DICTIONARIES (POINTERS)' 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 'IHS DICTIONARIES (POINTERS)' 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 AUT 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 AUT*"_Y_"*"_P_" is missing"
D BMES^XPDUTL(X)
Q
ACRF22EN ;IHS/OIRM/DSD/AEF - PATCH 22 ENVIRONMENT CHECK ROUTINE [ 1/25/2007 3:52 PM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**22**;NOV 05, 2001
+2 ;
EN ;EP -- MAIN ENTRY POINT
+1 ;
+2 ;CALL GENERIC EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT) ENVIRONMENT
+3 ;CHECK ROUTINE
+4 ;
+5 ; WHERE:
+6 ; ACRPCHN = PATCH NAME
+7 ; ACRPCHS = PREREQUISITE PATCH NUMBERS
+8 ; XPDQUIT = KIDS INSTALL TERMINATOR VARIABLE OUTPUT
+9 ; 1 = QUIT
+10 ;
+11 KILL XPDQUIT
+12 ;
+13 ;USE TO PERFORM ENVIRONMENT CHECK ON THE AUT PACKAGE. COMMENT OUT IF NOT NEEDED.
+14 KILL ACRAUTCK
+15 SET ACRAUTCK=""
+16 IF $DATA(ACRAUTCK)
Begin DoDot:1
+17 SET ACRPCHN="AUT*98.1*21"
+18 ;LATEST RELEASED AUT PATCH #
SET ACRPCHS="21"
+19 DO CHKAUT(ACRPCHN,ACRPCHS,.XPDQUIT)
End DoDot:1
+20 KILL ACRAUTCK
+21 ;END OF AUT CHECK
+22 ;BEGINNING OF ACR VERSION AND PATCH CHECKS
+23 SET ACRPCHN="ACR*2.1*22"
+24 ;REQUIRED PATCHES
SET ACRPCHS="1,2,3,4,5,6,7,8,12,13,14,15,16,17,18,19,20,21"
+25 DO EN^ACRFPENV(ACRPCHN,ACRPCHS,.XPDQUIT)
+26 ;END OF ACR VERSION AND PATCH CHECKS
+27 QUIT
+28 ;FROM HERE DOWN WAS ADDED TO GIVE THE ABILITY TO
+29 ; DO AN ENVIRONMENT CHECK ON THE AUT PACKAGE
CHKAUT(ACRPCHN,ACRPCHS,XPDQUIT) ;EP ENVIRONMENT CHECK FOR AUT
+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 KILL XPDQUIT
+12 ;
+13 DO CHK(ACRPCHN,ACRPCHS,.XPDQUIT)
+14 ;
+15 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("IHS DICTIONARIES (POINTERS)")
+14 ;
+15 ;----- CHECK TO SEE IF AUT IS INSTALLED
+16 ;
+17 SET D0=$ORDER(^DIC(9.4,"B","IHS DICTIONARIES (POINTERS)",0))
+18 IF 'D0
Begin DoDot:1
+19 SET XPDQUIT=1
+20 DO BMES^XPDUTL("Unable to find 'IHS DICTIONARIES (POINTERS)' 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 'IHS DICTIONARIES (POINTERS)' 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 AUT 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 AUT*"_Y_"*"_P_" is missing"
+8 DO BMES^XPDUTL(X)
+9 QUIT