XUZP8ENV ;IHS/OIRM/DSD/AEF - PATCH XU*8.0*1008 ENVIRONMENT CHECK ROUTINE [ 04/30/2003 3:59 PM ]
;;8.0;KERNEL;**1008**;APR 30, 2003
;
EN ;EP -- MAIN ENTRY POINT
;
D DUZ
D NOQUE
D KERVER
D NOASK
D TM
D P1007
D QUIT
Q
DUZ ;----- CHECK FOR VALID DUZ
;
I '$L($P($G(^VA(200,+$G(DUZ),0)),U)) D
. D BMES^XPDUTL("YOUR DUZ IS NOT SET TO A VALID DUZ")
. S XPDQUIT=2
Q:$G(XPDQUIT)
S DUZ(0)="@"
Q
NOQUE ;----- SET NOQUEUE FLAG
;
Q:$G(XPDQUIT)
S XPDNOQUE=1 ;DO NOT QUEUE
Q
KERVER ;----- CHECK KERNEL VERSION FOR VERSION 8
;
I +$$VERSION^XPDUTL("XU")'=8 D
. D BMES^XPDUTL("YOU ARE RUNNING VERSION "_$$VERSION^XPDUTL("XU")_" OF KERNEL")
. D BMES^XPDUTL("YOU MUST BE RUNNING VERSION 8.0")
. D BMES^XPDUTL("THIS PATCH CANNOT BE INSTALLED")
. S XPDQUIT=2
Q
NOASK ;----- SUPPRESS ASK 'DISABLE OPTS', 'MOVE ROUTINES' PROMPTS
;
S XPDDIQ("XPZ1")=0 ;'DISABLE OPTIONS' SET DEFAULT TO 'NO' & NOT ASK
S XPDDIQ("XPZ2")=0 ;'MOVE ROUTINES' SET DEFAULT TO 'NO' & NOT ASK
Q
TM ;----- CHECK IF TASKMAN IS RUNNING
;
I $D(^%ZTSCH("RUN")) D
. D BMES^XPDUTL("IT APPEARS THAT TASKMAN IS RUNNING")
. D BMES^XPDUTL("YOU MUST SHUT DOWN TASKMAN BEFORE INSTALLING THIS PATCH")
. S XPDQUIT=2
Q
P1007 ;----- CHECK IF PATCH XU*8.0*1007 INSTALLED
;
N X
S X="XU*8.0*1007"
I '$$CHKPAT(X) D
. S XPDQUIT=2
. D BMES^XPDUTL("IT APPEARS THAT PATCH "_X_" HAS NOT BEEN INSTALLED")
Q
CHKPAT(X) ;
;----- CHECK IF PATCH HAS BEEN INSTALLED
;
N XPDA,OK
S OK=0
S XPDA=0
F S XPDA=$O(^XPD(9.7,"B",X,XPDA)) Q:'XPDA D
. I $P($G(^XPD(9.7,XPDA,0)),U,9)=3 S OK=1
Q OK
QUIT ;----- ISSUE MESSAGES
;
I $G(XPDQUIT) D
. D BMES^XPDUTL("INSTALL ABORTED!")
I '$G(XPDQUIT) D
. D BMES^XPDUTL("EVERYTHING LOOKS OK")
Q
XUZP8ENV ;IHS/OIRM/DSD/AEF - PATCH XU*8.0*1008 ENVIRONMENT CHECK ROUTINE [ 04/30/2003 3:59 PM ]
+1 ;;8.0;KERNEL;**1008**;APR 30, 2003
+2 ;
EN ;EP -- MAIN ENTRY POINT
+1 ;
+2 DO DUZ
+3 DO NOQUE
+4 DO KERVER
+5 DO NOASK
+6 DO TM
+7 DO P1007
+8 DO QUIT
+9 QUIT
DUZ ;----- CHECK FOR VALID DUZ
+1 ;
+2 IF '$LENGTH($PIECE($GET(^VA(200,+$GET(DUZ),0)),U))
Begin DoDot:1
+3 DO BMES^XPDUTL("YOUR DUZ IS NOT SET TO A VALID DUZ")
+4 SET XPDQUIT=2
End DoDot:1
+5 IF $GET(XPDQUIT)
QUIT
+6 SET DUZ(0)="@"
+7 QUIT
NOQUE ;----- SET NOQUEUE FLAG
+1 ;
+2 IF $GET(XPDQUIT)
QUIT
+3 ;DO NOT QUEUE
SET XPDNOQUE=1
+4 QUIT
KERVER ;----- CHECK KERNEL VERSION FOR VERSION 8
+1 ;
+2 IF +$$VERSION^XPDUTL("XU")'=8
Begin DoDot:1
+3 DO BMES^XPDUTL("YOU ARE RUNNING VERSION "_$$VERSION^XPDUTL("XU")_" OF KERNEL")
+4 DO BMES^XPDUTL("YOU MUST BE RUNNING VERSION 8.0")
+5 DO BMES^XPDUTL("THIS PATCH CANNOT BE INSTALLED")
+6 SET XPDQUIT=2
End DoDot:1
+7 QUIT
NOASK ;----- SUPPRESS ASK 'DISABLE OPTS', 'MOVE ROUTINES' PROMPTS
+1 ;
+2 ;'DISABLE OPTIONS' SET DEFAULT TO 'NO' & NOT ASK
SET XPDDIQ("XPZ1")=0
+3 ;'MOVE ROUTINES' SET DEFAULT TO 'NO' & NOT ASK
SET XPDDIQ("XPZ2")=0
+4 QUIT
TM ;----- CHECK IF TASKMAN IS RUNNING
+1 ;
+2 IF $DATA(^%ZTSCH("RUN"))
Begin DoDot:1
+3 DO BMES^XPDUTL("IT APPEARS THAT TASKMAN IS RUNNING")
+4 DO BMES^XPDUTL("YOU MUST SHUT DOWN TASKMAN BEFORE INSTALLING THIS PATCH")
+5 SET XPDQUIT=2
End DoDot:1
+6 QUIT
P1007 ;----- CHECK IF PATCH XU*8.0*1007 INSTALLED
+1 ;
+2 NEW X
+3 SET X="XU*8.0*1007"
+4 IF '$$CHKPAT(X)
Begin DoDot:1
+5 SET XPDQUIT=2
+6 DO BMES^XPDUTL("IT APPEARS THAT PATCH "_X_" HAS NOT BEEN INSTALLED")
End DoDot:1
+7 QUIT
CHKPAT(X) ;
+1 ;----- CHECK IF PATCH HAS BEEN INSTALLED
+2 ;
+3 NEW XPDA,OK
+4 SET OK=0
+5 SET XPDA=0
+6 FOR
SET XPDA=$ORDER(^XPD(9.7,"B",X,XPDA))
IF 'XPDA
QUIT
Begin DoDot:1
+7 IF $PIECE($GET(^XPD(9.7,XPDA,0)),U,9)=3
SET OK=1
End DoDot:1
+8 QUIT OK
QUIT ;----- ISSUE MESSAGES
+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