- ZIBENVCK ; IHS/HQW/JDH - NO DESCRIPTION PROVIDED ; [ 04/02/2003 8:29 AM ]
- ;;8.0;KERNEL;**1004,1005,1007**;APR 1, 2003
- ;IHS UTILITY/JDH; environment check instll routine
- ; usage S X=$$MGR^ZIBSETUP(DEV_ROUTINE)
- ;
- ;
- ENVCHK ; IHS KIDS environment check utility
- ;N ZIBOS,ZIBOSVR,ZIBMSM,ZIBUSE,ZIBUSER
- ; check user
- W !!,"THIS IS THE IHS SPECIFIC ENVIRONMENT CHECK ROUTINE."
- W !!,"START OF ENVIRONMENT CHECK"
- W !,"NOTE: THE ENVIRONMENT CHECK IS PERFORMED DURING BOTH PACKAGE INSTALL AND LOAD"
- S ZIBUSER=$P($G(^VA(200,+$G(DUZ),0)),"^") ;if valid get name
- I '$L(ZIBUSER) D G QUIT ; user not valid
- .W !!,"You are not a valid user - either your DUZ is undefined,"
- .W !,"or this is a virgin install."
- ; prevent queueing of install
- S XPDNOQUE=1
- ; write out executing option name and demographics
- S ZIBOPT=$S('XPDENV:"'LOAD A DISTRIBUTION'",1:"'KIDS INSTALL'")
- W !!,"OPTION: "_ZIBOPT
- W !,"USER: "_ZIBUSER
- W !,"PATCH: "_XPDNM
- W !,"SITE: "_$P(^XMB(1,1,0),"^")
- S ZIBKRNL=$$VERSION^XPDUTL("XU") ; kernel version
- W !,"KERNEL VERSION: "_ZIBKRNL
- S ZIBTLKT=$$VERSION^XPDUTL("XT") ; VA toolkit version
- W !,"VA TOOLKIT VERSION: "_ZIBTLKT
- S ZIBOS=$P(^%ZOSF("OS"),"^") ; mumps OS
- S ZIBOSVR=$$VERSION^%ZOSV ; mumps version number
- W !,"M SYSTEM: "_ZIBOS_" VERSION "_ZIBOSVR
- S ZIBMSM=ZIBOS["MSM" ; boolean MSM 1 or 0
- S %=$ZU(0) ; current UCI/VOL
- W !,"CURRENT UCI/VOL: "_% ; verify single user
- ;S ZIBUSE=0 ; flag for the number of users on the system
- ;S:ZIBMSM ZIBUSE=$$LIST^%ACTJOB(.ZIBJOB)
- ;W !,"NUMBER OF USERS ON THE SYSTEM: "_ZIBUSE
- ;I ZIBUSE'=1 D ;G QUIT
- .W !!,"THIS "_ZIBOPT_" REQUIRES NO OTHER USERS ON THE SYSTEM."
- ; Can I show the system users, so the user can tell the others to get off or die!!!!!!!!!!!
- ; what to do if other than MSM system
- ; verify versions
- I ZIBOSVR<4.4 D G QUIT
- .W !!,"YOUR "_ZIBOS_" VERSION MUST BE GREATER THAN 4.4 FOR THIS "_ZIBOPT
- ; check versions
- I ZIBKRNL<8.0 D G QUIT
- .W !!,"YOU NEED KERNEL VERSION 8.0 OR GREATER TO RUN THIS INSTAll."
- ; verify single user mode
- ; if TASKMAN is running, shut it down
- S %=$D(^%ZTSCH("RUN")) ; check taskman run node
- W !!,"TASKMAN IS"_$S(%:"",1:" NOT")_" RUNNING"
- I % W !,"SHUTTING DOWN TASKMAN" D STOP^ZTMKU
- ;
- Q
- ;
- QUIT ; quit the KIDS install
- W !!,"THE HELP DESK"
- S XPDABORT=1 ;abort all transport globals in the distribution and kill them from ^XTMP
- ; if ^XTMP("XPDI") exists, the install option will abort
- Q
- ;
- VA() ; execute the VA's ZTMGRSET routine in the MGR uci
- Q S POP=0
- S ZIBCURR=$V(2,$J,2) ; get the number of the current UCI
- ; V 2:$J:1:2 sets the current uci to the Volume Group MGR uci
- ; V 2:$J:ZIBCURR:2 resets the current uci
- V 2:$J:1:2 W $ZU(0) D ^ZTMGRSET V 2:$J:ZIBCURR:2 Q POP
- ;
- MGRSET() ; copy a routine from the list into the volume groups uci
- ;
- ; Usage: S X=$$MGRSET^ZIBSETUP
- ;
- N POP S POP=0
- F I=1:1 S %=$P($T(MGR+I),";;",2) Q:%="END" D
- .S ZIBRPROD=$P(%,";"),ZIBRMGR=$P(%,";",2)
- .I $L(ZIBRPROD),$D(^$ROUTINE(ZIBRPROD)) D ; does the routine exist
- ..S %=$$MGRCHG(ZIBRPROD,ZIBRMGR),POP=1
- ..W !,"Routine "_ZIBRPROD_" copied from "_$P(%,"^")_" to "_$P(%,"^",2)
- Q POP
- ;
- MGRCHG(ZIBRPROD,ZIBRMGR) ; zsave a routine from the production uci to the MGR uci of
- ; the volume group
- ;
- ; input: routine name
- ; output: uci routine copied from^uci copied to
- ; usage: S X=$$MGRCHG^ZIBSETUP("routine_name")
- ;
- ;N ZIBCURR
- S ZIBRPROD=$TR(ZIBRPROD,"^"),ZIBRMGR=$TR(ZIBRMGR,"^") ; remove any "^" characters
- S ZIBCURR=$V(2,$J,2) ; get the number of the current UCI
- ; V 2:$J:1:2 sets the current uci to the Volume Group MGR uci
- ; V 2:$J:ZIBCURR:2 resets the current uci
- S %="ZL @ZIBRPROD V 2:$J:1:2 ZS @ZIBRMGR V 2:$J:ZIBCURR:2"
- X % Q $ZU(0)_"^"_$ZU(1,0)
- ;
- MGR ; list of routines to copy into the MGR UCI of the Volume group. END marks the end of the list
- ;;ZZHAY1;%ZZHAY
- ;;END
- ;;DIDT;%DT
- ;;DIDTC;%DTC
- ;;END
- ZIBENVCK ; IHS/HQW/JDH - NO DESCRIPTION PROVIDED ; [ 04/02/2003 8:29 AM ]
- +1 ;;8.0;KERNEL;**1004,1005,1007**;APR 1, 2003
- +2 ;IHS UTILITY/JDH; environment check instll routine
- +3 ; usage S X=$$MGR^ZIBSETUP(DEV_ROUTINE)
- +4 ;
- +5 ;
- ENVCHK ; IHS KIDS environment check utility
- +1 ;N ZIBOS,ZIBOSVR,ZIBMSM,ZIBUSE,ZIBUSER
- +2 ; check user
- +3 WRITE !!,"THIS IS THE IHS SPECIFIC ENVIRONMENT CHECK ROUTINE."
- +4 WRITE !!,"START OF ENVIRONMENT CHECK"
- +5 WRITE !,"NOTE: THE ENVIRONMENT CHECK IS PERFORMED DURING BOTH PACKAGE INSTALL AND LOAD"
- +6 ;if valid get name
- SET ZIBUSER=$PIECE($GET(^VA(200,+$GET(DUZ),0)),"^")
- +7 ; user not valid
- IF '$LENGTH(ZIBUSER)
- Begin DoDot:1
- +8 WRITE !!,"You are not a valid user - either your DUZ is undefined,"
- +9 WRITE !,"or this is a virgin install."
- End DoDot:1
- GOTO QUIT
- +10 ; prevent queueing of install
- +11 SET XPDNOQUE=1
- +12 ; write out executing option name and demographics
- +13 SET ZIBOPT=$SELECT('XPDENV:"'LOAD A DISTRIBUTION'",1:"'KIDS INSTALL'")
- +14 WRITE !!,"OPTION: "_ZIBOPT
- +15 WRITE !,"USER: "_ZIBUSER
- +16 WRITE !,"PATCH: "_XPDNM
- +17 WRITE !,"SITE: "_$PIECE(^XMB(1,1,0),"^")
- +18 ; kernel version
- SET ZIBKRNL=$$VERSION^XPDUTL("XU")
- +19 WRITE !,"KERNEL VERSION: "_ZIBKRNL
- +20 ; VA toolkit version
- SET ZIBTLKT=$$VERSION^XPDUTL("XT")
- +21 WRITE !,"VA TOOLKIT VERSION: "_ZIBTLKT
- +22 ; mumps OS
- SET ZIBOS=$PIECE(^%ZOSF("OS"),"^")
- +23 ; mumps version number
- SET ZIBOSVR=$$VERSION^%ZOSV
- +24 WRITE !,"M SYSTEM: "_ZIBOS_" VERSION "_ZIBOSVR
- +25 ; boolean MSM 1 or 0
- SET ZIBMSM=ZIBOS["MSM"
- +26 ; current UCI/VOL
- SET %=$ZU(0)
- +27 ; verify single user
- WRITE !,"CURRENT UCI/VOL: "_%
- +28 ;S ZIBUSE=0 ; flag for the number of users on the system
- +29 ;S:ZIBMSM ZIBUSE=$$LIST^%ACTJOB(.ZIBJOB)
- +30 ;W !,"NUMBER OF USERS ON THE SYSTEM: "_ZIBUSE
- +31 ;I ZIBUSE'=1 D ;G QUIT
- +32
- *** ERROR ***
- +33 ; Can I show the system users, so the user can tell the others to get off or die!!!!!!!!!!!
- +34 ; what to do if other than MSM system
- +35 ; verify versions
- +36 IF ZIBOSVR<4.4
- Begin DoDot:1
- +37 WRITE !!,"YOUR "_ZIBOS_" VERSION MUST BE GREATER THAN 4.4 FOR THIS "_ZIBOPT
- End DoDot:1
- GOTO QUIT
- +38 ; check versions
- +39 IF ZIBKRNL<8.0
- Begin DoDot:1
- +40 WRITE !!,"YOU NEED KERNEL VERSION 8.0 OR GREATER TO RUN THIS INSTAll."
- End DoDot:1
- GOTO QUIT
- +41 ; verify single user mode
- +42 ; if TASKMAN is running, shut it down
- +43 ; check taskman run node
- SET %=$DATA(^%ZTSCH("RUN"))
- +44 WRITE !!,"TASKMAN IS"_$SELECT(%:"",1:" NOT")_" RUNNING"
- +45 IF %
- WRITE !,"SHUTTING DOWN TASKMAN"
- DO STOP^ZTMKU
- +46 ;
- +47 QUIT
- +48 ;
- QUIT ; quit the KIDS install
- +1 WRITE !!,"THE HELP DESK"
- +2 ;abort all transport globals in the distribution and kill them from ^XTMP
- SET XPDABORT=1
- +3 ; if ^XTMP("XPDI") exists, the install option will abort
- +4 QUIT
- +5 ;
- VA() ; execute the VA's ZTMGRSET routine in the MGR uci
- +1 QUIT
- SET POP=0
- +2 ; get the number of the current UCI
- SET ZIBCURR=$VIEW(2,$JOB,2)
- +3 ; V 2:$J:1:2 sets the current uci to the Volume Group MGR uci
- +4 ; V 2:$J:ZIBCURR:2 resets the current uci
- +5 VIEW 2:$JOB:1:2
- WRITE $ZU(0)
- DO ^ZTMGRSET
- VIEW 2:$JOB:ZIBCURR:2
- QUIT POP
- +6 ;
- MGRSET() ; copy a routine from the list into the volume groups uci
- +1 ;
- +2 ; Usage: S X=$$MGRSET^ZIBSETUP
- +3 ;
- +4 NEW POP
- SET POP=0
- +5 FOR I=1:1
- SET %=$PIECE($TEXT(MGR+I),";;",2)
- IF %="END"
- QUIT
- Begin DoDot:1
- +6 SET ZIBRPROD=$PIECE(%,";")
- SET ZIBRMGR=$PIECE(%,";",2)
- +7 ; does the routine exist
- IF $LENGTH(ZIBRPROD)