DI1019P ; IHS/OIT/FBD - FILEMAN V22.0 PATCH 1019 ENVIRONMENT CHECK/PRE-INIT/POST-INIT PROCESSES;
;;22.0;VA FILEMAN;**1019**;NOV 30,2015;Build 2
;
;
; The following line prevents the "Disable Options..." and "Move Routines..." questions from being asked during the install.
I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
F X="XPO1","XPZ1","XPZ2","XPI1" S XPDDIQ(X)=0
;KERNEL
I +$$VERSION^XPDUTL("XU")<8 D MES^XPDUTL($$CJ^XLFSTR("Version 8.0 of KERNEL is required. Not installed",80)) D SORRY(2) I 1
E D MES^XPDUTL($$CJ^XLFSTR("Requires Kernel Version 8.0....Present.",80))
;FILEMAN
I +$$VERSION^XPDUTL("DI")<22 D MES^XPDUTL($$CJ^XLFSTR("Version 22.0 of FILEMAN is required. Not installed.",80)) D SORRY(2) I 1
E D MES^XPDUTL($$CJ^XLFSTR("Requires Fileman v22....Present.",80))
;DI 22.0 PATCH 1017
I '$$INSTALLD("DI*22.0*1017") D SORRY(2)
;
Q ;END OF ENVIRONMENT CHECK
;
;
PRE ;PATCH 1019 PRE-INIT CHECKS AND PROCESSES
D MES^XPDUTL($$CJ^XLFSTR("Beginning DI v22.0 patch 1019 pre-init process.",80))
;
D MES^XPDUTL($$CJ^XLFSTR("Setting flag to prevent KIDS env check/pre-init/post-init routine deletion...",80))
S DIZFLG=+$O(^XTV(8989.2,"B","XPD NO_EPP_DELETE",0)) ;CHECK IF NO-DELETE PARAMETER ALREADY EXISTS IN KERNEL PARAMETERS FILE
I 'DIZFLG D ;IF NOT, ADD IT
. K DO
. S DIC="^XTV(8989.2,",DIC(0)="L",X="XPD NO_EPP_DELETE",DIADD=1
. D FILE^DICN S DIZFLG=+Y K DO,DIC,DIADD,X
S DIE="^XTV(8989.2,",DA=DIZFLG,DR="4///1" ;SET XPD NO_EPP_DELETE PARAMETER VALUE TO 1 (NO-DELETE = TRUE)
D ^DIE
K DIE,DA,DR
D MES^XPDUTL($$CJ^XLFSTR("Flag set complete.",80))
;
D MES^XPDUTL($$CJ^XLFSTR("DI v22.0 patch 1019 pre-init process complete.",80))
Q
;
;
POST ;PATCH 1019 POST-INIT PROCESSES
D MES^XPDUTL($$CJ^XLFSTR("Beginning DI v22.0 patch 1019 post-init process.",80))
;
D MES^XPDUTL($$CJ^XLFSTR("DI*22.0*1019 - No specific post-init activity required.",80))
;
D BMES^XPDUTL("Delivering DI v22.0 patch 1019 install message to select users...")
D MAIL
;
D MES^XPDUTL($$CJ^XLFSTR("DI v22.0 patch 1019 post-init process complete.",80))
Q
;
;
MAIL ;----- SEND INSTALL MAIL MESSAGE
;
N DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
;
K ^TMP("DI1019MS",$J)
S ^TMP("DI1019MS",$J,1)=" --- DI v22.0 patch 1019 has been installed into this namespace ---"
S ^TMP("DI1019MS",$J,2)=" "
I $G(XPDA) D
. S %=0
. F S %=$O(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%)) Q:'% D
. . S ^TMP("DI1019MS",$J,(%+2))=" "_^(%,0)
;
S XMSUB=$P($P($T(+1),";",2)," ",3,99)
S XMDUZ=$S($G(DUZ):DUZ,1:.5)
S XMTEXT="^TMP(""DI1019MS"",$J,"
S XMY(1)=""
S XMY(DUZ)=""
;
F %="XUMGR","XUPROG","XUPROGMODE" D SINGLE(%)
D ^XMD
;
K ^TMP("DI1019MS",$J)
Q
;
;
SINGLE(K) ;----- GET HOLDERS OF A SINGLE KEY K.
N Y
Q:'$D(^XUSEC(K))
S Y=0
F S Y=$O(^XUSEC(K,Y)) Q:'Y S XMY(Y)=""
Q
;
;
INSTALLD(AUTSTAL) ;EP - Determine if patch AUTSTAL was installed, where
; AUTSTAL is the name of the INSTALL. E.g "AG*6.0*11".
;
NEW AUTY,DIC,X,Y
S X=$P(AUTSTAL,"*",1)
S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
D IX^DIC
I Y<1 D IMES Q 0
S DIC=DIC_+Y_",22,",X=$P(AUTSTAL,"*",2)
D ^DIC
I Y<1 D IMES Q 0
S DIC=DIC_+Y_",""PAH"",",X=$P(AUTSTAL,"*",3)
D ^DIC
S AUTY=Y
D IMES
Q $S(AUTY<1:0,1:1)
;
;
IMES ;
D MES^XPDUTL($$CJ^XLFSTR("Patch """_AUTSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
Q
;
;
SORRY(X) ;
KILL DIFQ
I X=3 S XPDQUIT=2 Q
S XPDQUIT=X
W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
Q
DI1019P ; IHS/OIT/FBD - FILEMAN V22.0 PATCH 1019 ENVIRONMENT CHECK/PRE-INIT/POST-INIT PROCESSES;
+1 ;;22.0;VA FILEMAN;**1019**;NOV 30,2015;Build 2
+2 ;
+3 ;
+4 ; The following line prevents the "Disable Options..." and "Move Routines..." questions from being asked during the install.
+5 IF $GET(XPDENV)=1
SET (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
+6 FOR X="XPO1","XPZ1","XPZ2","XPI1"
SET XPDDIQ(X)=0
+7 ;KERNEL
+8 IF +$$VERSION^XPDUTL("XU")<8
DO MES^XPDUTL($$CJ^XLFSTR("Version 8.0 of KERNEL is required. Not installed",80))
DO SORRY(2)
IF 1
+9 IF '$TEST
DO MES^XPDUTL($$CJ^XLFSTR("Requires Kernel Version 8.0....Present.",80))
+10 ;FILEMAN
+11 IF +$$VERSION^XPDUTL("DI")<22
DO MES^XPDUTL($$CJ^XLFSTR("Version 22.0 of FILEMAN is required. Not installed.",80))
DO SORRY(2)
IF 1
+12 IF '$TEST
DO MES^XPDUTL($$CJ^XLFSTR("Requires Fileman v22....Present.",80))
+13 ;DI 22.0 PATCH 1017
+14 IF '$$INSTALLD("DI*22.0*1017")
DO SORRY(2)
+15 ;
+16 ;END OF ENVIRONMENT CHECK
QUIT
+17 ;
+18 ;
PRE ;PATCH 1019 PRE-INIT CHECKS AND PROCESSES
+1 DO MES^XPDUTL($$CJ^XLFSTR("Beginning DI v22.0 patch 1019 pre-init process.",80))
+2 ;
+3 DO MES^XPDUTL($$CJ^XLFSTR("Setting flag to prevent KIDS env check/pre-init/post-init routine deletion...",80))
+4 ;CHECK IF NO-DELETE PARAMETER ALREADY EXISTS IN KERNEL PARAMETERS FILE
SET DIZFLG=+$ORDER(^XTV(8989.2,"B","XPD NO_EPP_DELETE",0))
+5 ;IF NOT, ADD IT
IF 'DIZFLG
Begin DoDot:1
+6 KILL DO
+7 SET DIC="^XTV(8989.2,"
SET DIC(0)="L"
SET X="XPD NO_EPP_DELETE"
SET DIADD=1
+8 DO FILE^DICN
SET DIZFLG=+Y
KILL DO,DIC,DIADD,X
End DoDot:1
+9 ;SET XPD NO_EPP_DELETE PARAMETER VALUE TO 1 (NO-DELETE = TRUE)
SET DIE="^XTV(8989.2,"
SET DA=DIZFLG
SET DR="4///1"
+10 DO ^DIE
+11 KILL DIE,DA,DR
+12 DO MES^XPDUTL($$CJ^XLFSTR("Flag set complete.",80))
+13 ;
+14 DO MES^XPDUTL($$CJ^XLFSTR("DI v22.0 patch 1019 pre-init process complete.",80))
+15 QUIT
+16 ;
+17 ;
POST ;PATCH 1019 POST-INIT PROCESSES
+1 DO MES^XPDUTL($$CJ^XLFSTR("Beginning DI v22.0 patch 1019 post-init process.",80))
+2 ;
+3 DO MES^XPDUTL($$CJ^XLFSTR("DI*22.0*1019 - No specific post-init activity required.",80))
+4 ;
+5 DO BMES^XPDUTL("Delivering DI v22.0 patch 1019 install message to select users...")
+6 DO MAIL
+7 ;
+8 DO MES^XPDUTL($$CJ^XLFSTR("DI v22.0 patch 1019 post-init process complete.",80))
+9 QUIT
+10 ;
+11 ;
MAIL ;----- SEND INSTALL MAIL MESSAGE
+1 ;
+2 NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
+3 ;
+4 KILL ^TMP("DI1019MS",$JOB)
+5 SET ^TMP("DI1019MS",$JOB,1)=" --- DI v22.0 patch 1019 has been installed into this namespace ---"
+6 SET ^TMP("DI1019MS",$JOB,2)=" "
+7 IF $GET(XPDA)
Begin DoDot:1
+8 SET %=0
+9 FOR
SET %=$ORDER(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%))
IF '%
QUIT
Begin DoDot:2
+10 SET ^TMP("DI1019MS",$JOB,(%+2))=" "_^(%,0)
End DoDot:2
End DoDot:1
+11 ;
+12 SET XMSUB=$PIECE($PIECE($TEXT(+1),";",2)," ",3,99)
+13 SET XMDUZ=$SELECT($GET(DUZ):DUZ,1:.5)
+14 SET XMTEXT="^TMP(""DI1019MS"",$J,"
+15 SET XMY(1)=""
+16 SET XMY(DUZ)=""
+17 ;
+18 FOR %="XUMGR","XUPROG","XUPROGMODE"
DO SINGLE(%)
+19 DO ^XMD
+20 ;
+21 KILL ^TMP("DI1019MS",$JOB)
+22 QUIT
+23 ;
+24 ;
SINGLE(K) ;----- GET HOLDERS OF A SINGLE KEY K.
+1 NEW Y
+2 IF '$DATA(^XUSEC(K))
QUIT
+3 SET Y=0
+4 FOR
SET Y=$ORDER(^XUSEC(K,Y))
IF 'Y
QUIT
SET XMY(Y)=""
+5 QUIT
+6 ;
+7 ;
INSTALLD(AUTSTAL) ;EP - Determine if patch AUTSTAL was installed, where
+1 ; AUTSTAL is the name of the INSTALL. E.g "AG*6.0*11".
+2 ;
+3 NEW AUTY,DIC,X,Y
+4 SET X=$PIECE(AUTSTAL,"*",1)
+5 SET DIC="^DIC(9.4,"
SET DIC(0)="FM"
SET D="C"
+6 DO IX^DIC
+7 IF Y<1
DO IMES
QUIT 0
+8 SET DIC=DIC_+Y_",22,"
SET X=$PIECE(AUTSTAL,"*",2)
+9 DO ^DIC
+10 IF Y<1
DO IMES
QUIT 0
+11 SET DIC=DIC_+Y_",""PAH"","
SET X=$PIECE(AUTSTAL,"*",3)
+12 DO ^DIC
+13 SET AUTY=Y
+14 DO IMES
+15 QUIT $SELECT(AUTY<1:0,1:1)
+16 ;
+17 ;
IMES ;
+1 DO MES^XPDUTL($$CJ^XLFSTR("Patch """_AUTSTAL_""" is"_$SELECT(Y<1:" *NOT*",1:"")_" installed.",IOM))
+2 QUIT
+3 ;
+4 ;
SORRY(X) ;
+1 KILL DIFQ
+2 IF X=3
SET XPDQUIT=2
QUIT
+3 SET XPDQUIT=X
+4 WRITE *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
+5 QUIT