Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRF22EN

ACRF22EN.m

Go to the documentation of this file.
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