DIZ22ENV ;IHS/OIRM/DSD/AEF - ENVIRONMENT CHECK ROUTINE [ 04/02/2003 8:23 AM ]
;;22.0;VA FileMan;**1001**;APR 1, 2003
;
EN ;----- MAIN ENTRY POINT
;
D ^XBKVAR
D NOQUE
D VERSION
D PKG
D DUPES
D OK
Q
NOQUE ;----- PREVENT QUEUEING OF INSTALL
;
S XPDNOQUE=1
Q
DUPES ;----- CHECK FOR DUPLICATE ENTRIES IN THE PACKAGE FILE
;
N PKG,X
;
S PKG("VA FILEMAN")=0
S PKG("KERNEL")=0
S PKG("TOOLKIT")=0
S PKG("HEALTH LEVEL SEVEN")=0
S PKG("CAPACITY MANAGEMENT - RUM")=0
S PKG("RPC BROKER")=0
S PKG("NEW PERSON")=0
;
S PKG=""
F S PKG=$O(PKG(PKG)) Q:PKG']"" D
. S X=0
. F S X=$O(^DIC(9.4,"B",PKG,X)) Q:'X D
. . S PKG(PKG)=PKG(PKG)+1
;
S PKG=""
F S PKG=$O(PKG(PKG)) Q:PKG']"" D
. I PKG(PKG)>1 D
. . S XPDQUIT=1
. . S X="IT APPEARS THAT YOU HAVE DUPLICATE "_PKG_" PACKAGE ENTRIES"
. . D BMES^XPDUTL(X)
I $G(XPDQUIT) D
. D BMES^XPDUTL("YOU MUST CLEAN UP THE PACKAGE FILE BEFORE CONTINUING")
Q
VERSION ;
;----- CHECK VERSION NUMBER
;
;I "21.0"'=$$VERSION^XPDUTL("VA FILEMAN") D
. S XPDQUIT=1
. D BMES^XPDUTL("CURRENT VERSION IS NOT 21.0, CANNOT CONTINUE WITH INSTALL")
I 8'=+$$VERSION^XPDUTL("KERNEL") D
. S XPDQUIT=1
. D BMES^XPDUTL("CURRENT VERSION OF KERNEL IS NOT 8.0, CANNOT CONTINUE WITH INSTALL")
I "7.3"'=$$VERSION^XPDUTL("TOOLKIT") D
. S XPDQUIT=1
. D BMES^XPDUTL("CURRENT VERSION OF TOOLKIT IS NOT 7.3, CANNOT CONTINUE WITH INSTALL")
I "1.6"'=$$VERSION^XPDUTL("HEALTH LEVEL SEVEN") D
. S XPDQUIT=1
. D BMES^XPDUTL("CURRENT VERSION OF HL7 IS NOT 1.6, CANNOT CONTINUE WITH INSTALL")
Q
PKG ;----- MAKE SURE THERE ARE PKG ENTRY/VERSION FOR SAGG,RUM,RPC,A4A7
;
N DA,DIE,DIC,DLAYGO,DR,DTOUT,DUOUT,PKG,VER,X,Y
;
S PKG("SAGG PROJECT")=1.8
S PKG("CAPACITY MANAGEMENT - RUM")="1.0"
S PKG("RPC BROKER")=1.1
S PKG("NEW PERSON")=1.01
;
S PKG=""
F S PKG=$O(PKG(PKG)) Q:PKG']"" D
. S VER=PKG(PKG)
. S DIC="^DIC(9.4,"
. S DIC(0)="L"
. S DLAYGO=9.4
. S X=PKG
. D ^DIC
. Q:Y'>0!($D(DTOUT))!($D(DUOUT))
. S DA=+Y
. S DIE=DIC
. S DR="13///^S X=VER"
. D ^DIE
Q
OK ;----- OK TO INSTALL?
;
I $G(XPDQUIT) D
. D BMES^XPDUTL("INSTALL ABORTED!")
I '$G(XPDQUIT) D
. D BMES^XPDUTL("EVERYTHING LOOKS OK")
Q
DIZ22ENV ;IHS/OIRM/DSD/AEF - ENVIRONMENT CHECK ROUTINE [ 04/02/2003 8:23 AM ]
+1 ;;22.0;VA FileMan;**1001**;APR 1, 2003
+2 ;
EN ;----- MAIN ENTRY POINT
+1 ;
+2 DO ^XBKVAR
+3 DO NOQUE
+4 DO VERSION
+5 DO PKG
+6 DO DUPES
+7 DO OK
+8 QUIT
NOQUE ;----- PREVENT QUEUEING OF INSTALL
+1 ;
+2 SET XPDNOQUE=1
+3 QUIT
DUPES ;----- CHECK FOR DUPLICATE ENTRIES IN THE PACKAGE FILE
+1 ;
+2 NEW PKG,X
+3 ;
+4 SET PKG("VA FILEMAN")=0
+5 SET PKG("KERNEL")=0
+6 SET PKG("TOOLKIT")=0
+7 SET PKG("HEALTH LEVEL SEVEN")=0
+8 SET PKG("CAPACITY MANAGEMENT - RUM")=0
+9 SET PKG("RPC BROKER")=0
+10 SET PKG("NEW PERSON")=0
+11 ;
+12 SET PKG=""
+13 FOR
SET PKG=$ORDER(PKG(PKG))
IF PKG']""
QUIT
Begin DoDot:1
+14 SET X=0
+15 FOR
SET X=$ORDER(^DIC(9.4,"B",PKG,X))
IF 'X
QUIT
Begin DoDot:2
+16 SET PKG(PKG)=PKG(PKG)+1
End DoDot:2
End DoDot:1
+17 ;
+18 SET PKG=""
+19 FOR
SET PKG=$ORDER(PKG(PKG))
IF PKG']""
QUIT
Begin DoDot:1
+20 IF PKG(PKG)>1
Begin DoDot:2
+21 SET XPDQUIT=1
+22 SET X="IT APPEARS THAT YOU HAVE DUPLICATE "_PKG_" PACKAGE ENTRIES"
+23 DO BMES^XPDUTL(X)
End DoDot:2
End DoDot:1
+24 IF $GET(XPDQUIT)
Begin DoDot:1
+25 DO BMES^XPDUTL("YOU MUST CLEAN UP THE PACKAGE FILE BEFORE CONTINUING")
End DoDot:1
+26 QUIT
VERSION ;
+1 ;----- CHECK VERSION NUMBER
+2 ;
+3 ;I "21.0"'=$$VERSION^XPDUTL("VA FILEMAN") D
+4
*** ERROR ***
+5
*** ERROR ***
+6 IF 8'=+$$VERSION^XPDUTL("KERNEL")
Begin DoDot:1
+7 SET XPDQUIT=1
+8 DO BMES^XPDUTL("CURRENT VERSION OF KERNEL IS NOT 8.0, CANNOT CONTINUE WITH INSTALL")
End DoDot:1
+9 IF "7.3"'=$$VERSION^XPDUTL("TOOLKIT")
Begin DoDot:1
+10 SET XPDQUIT=1
+11 DO BMES^XPDUTL("CURRENT VERSION OF TOOLKIT IS NOT 7.3, CANNOT CONTINUE WITH INSTALL")
End DoDot:1
+12 IF "1.6"'=$$VERSION^XPDUTL("HEALTH LEVEL SEVEN")
Begin DoDot:1
+13 SET XPDQUIT=1
+14 DO BMES^XPDUTL("CURRENT VERSION OF HL7 IS NOT 1.6, CANNOT CONTINUE WITH INSTALL")
End DoDot:1
+15 QUIT
PKG ;----- MAKE SURE THERE ARE PKG ENTRY/VERSION FOR SAGG,RUM,RPC,A4A7
+1 ;
+2 NEW DA,DIE,DIC,DLAYGO,DR,DTOUT,DUOUT,PKG,VER,X,Y
+3 ;
+4 SET PKG("SAGG PROJECT")=1.8
+5 SET PKG("CAPACITY MANAGEMENT - RUM")="1.0"
+6 SET PKG("RPC BROKER")=1.1
+7 SET PKG("NEW PERSON")=1.01
+8 ;
+9 SET PKG=""
+10 FOR
SET PKG=$ORDER(PKG(PKG))
IF PKG']""
QUIT
Begin DoDot:1
+11 SET VER=PKG(PKG)
+12 SET DIC="^DIC(9.4,"
+13 SET DIC(0)="L"
+14 SET DLAYGO=9.4
+15 SET X=PKG
+16 DO ^DIC
+17 IF Y'>0!($DATA(DTOUT))!($DATA(DUOUT))
QUIT
+18 SET DA=+Y
+19 SET DIE=DIC
+20 SET DR="13///^S X=VER"
+21 DO ^DIE
End DoDot:1
+22 QUIT
OK ;----- OK TO INSTALL?
+1 ;
+2 IF $GET(XPDQUIT)
Begin DoDot:1
+3 DO BMES^XPDUTL("INSTALL ABORTED!")
End DoDot:1
+4 IF '$GET(XPDQUIT)
Begin DoDot:1
+5 DO BMES^XPDUTL("EVERYTHING LOOKS OK")
End DoDot:1
+6 QUIT