INHPRE ;JSH; 13 Sep 1999 15:22;Interface - PreInit routine
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
;
EN ;Pre-init for subsystem
S X="ERR^INHPRE",@^%ZOSF("TRAP")
N INTITLE
W !!,"Running Generic Interface Pre-Init..."
D ENV^UTIL,ROU
D BACKUP("4604 Inst")
W !!
;
Q
;
BACKUP(INTITLE) ;Backup control files
;
I $D(^UTILITY("INSAVE",INTITLE)) D
. W !,"Backing up previous save of GIS environmental data for ",INTITLE,!
. N TTLSUB S TTLSUB=INTITLE_" PREV"
. M ^UTILITY("INSAVE",TTLSUB)=^UTILITY("INSAVE",INTITLE)
K ^UTILITY("INSAVE",INTITLE)
W !!,"Backing up GIS environmental data",!
I '$$BACKUP^INHSYSUL(INTITLE) W !!,"Backup of GIS control files not complete!!!",!!
Q
;
ROU ;Load routines in non CHCS v4.2 systems
Q
;
;see if installing on non CHCS v4.2 system
Q:$$SC^INHUTIL1
W !!,"Performing non CHCS v4.2 initialization"
N %S,%D,I,%S1,%D1
S %S="INHUTSRD^INHUTDT^INHUTIL^INHDIPZ3^INHDWPR"
S %D="UTSRD^UTDT^UTIL^DIPZ3^DWPR"
W !!,"I will save the following routines:",!
F I=1:1:$L(%S,"^") S %S1=$P(%S,"^",I),%D1=$P(%D,"^",I) W !,%S1_" ... will be saved as ... "_%D1
W !!,"Do you wish to do this" S %="" D YN^DICN Q:%'=1
F I=1:1:$L(%S,"^") S %S1=$P(%S,"^",I),%D1=$P(%D,"^",I) X "ZL @%S1 ZS @%D1" W !,%S1_" ... saved as ... "_%D1
Q
;
ERR ;Error exit point
W !,"Unexpected error occured in GIS Pre-Init routine:"
W !,?5,$$GETERR^%ZTOS,!
Q
INHPRE ;JSH; 13 Sep 1999 15:22;Interface - PreInit routine
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 ;
EN ;Pre-init for subsystem
+1 SET X="ERR^INHPRE"
SET @^%ZOSF("TRAP")
+2 NEW INTITLE
+3 WRITE !!,"Running Generic Interface Pre-Init..."
+4 DO ENV^UTIL
DO ROU
+5 DO BACKUP("4604 Inst")
+6 WRITE !!
+7 ;
+8 QUIT
+9 ;
BACKUP(INTITLE) ;Backup control files
+1 ;
+2 IF $DATA(^UTILITY("INSAVE",INTITLE))
Begin DoDot:1
+3 WRITE !,"Backing up previous save of GIS environmental data for ",INTITLE,!
+4 NEW TTLSUB
SET TTLSUB=INTITLE_" PREV"
+5 MERGE ^UTILITY("INSAVE",TTLSUB)=^UTILITY("INSAVE",INTITLE)
End DoDot:1
+6 KILL ^UTILITY("INSAVE",INTITLE)
+7 WRITE !!,"Backing up GIS environmental data",!
+8 IF '$$BACKUP^INHSYSUL(INTITLE)
WRITE !!,"Backup of GIS control files not complete!!!",!!
+9 QUIT
+10 ;
ROU ;Load routines in non CHCS v4.2 systems
+1 QUIT
+2 ;
+3 ;see if installing on non CHCS v4.2 system
+4 IF $$SC^INHUTIL1
QUIT
+5 WRITE !!,"Performing non CHCS v4.2 initialization"
+6 NEW %S,%D,I,%S1,%D1
+7 SET %S="INHUTSRD^INHUTDT^INHUTIL^INHDIPZ3^INHDWPR"
+8 SET %D="UTSRD^UTDT^UTIL^DIPZ3^DWPR"
+9 WRITE !!,"I will save the following routines:",!
+10 FOR I=1:1:$LENGTH(%S,"^")
SET %S1=$PIECE(%S,"^",I)
SET %D1=$PIECE(%D,"^",I)
WRITE !,%S1_" ... will be saved as ... "_%D1
+11 WRITE !!,"Do you wish to do this"
SET %=""
DO YN^DICN
IF %'=1
QUIT
+12 FOR I=1:1:$LENGTH(%S,"^")
SET %S1=$PIECE(%S,"^",I)
SET %D1=$PIECE(%D,"^",I)
XECUTE "ZL @%S1 ZS @%D1"
WRITE !,%S1_" ... saved as ... "_%D1
+13 QUIT
+14 ;
ERR ;Error exit point
+1 WRITE !,"Unexpected error occured in GIS Pre-Init routine:"
+2 WRITE !,?5,$$GETERR^%ZTOS,!
+3 QUIT