BXPA1PST ;IHS/OIT/FBD -Environment Check and Pre/Post Init Process 21 Nov 2013 7:45 AM ;
;;1.0;IHS EXTENSIONS TO KERNEL TOOLKIT;;Dec 19, 2013;Build 12
;
;
; 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))
;XT
I $$VERSION^XPDUTL("XT")'="7.3" D MES^XPDUTL($$CJ^XLFSTR("Version 7.3 of the TOOLKIT is required. Not installed",80)) D SORRY(2) I 1
E D MES^XPDUTL($$CJ^XLFSTR("Requires TOOLKIT Version 7.3 ....Present.",80))
;XT 7.3 PATCH 1017
I '$$INSTALLD("XT*7.3*1017") D SORRY(2)
;
;
Q ;END OF ENVIRONMENT CHECK
;
PRE ;PATCH 26 PRE-INIT CHECKS AND PROCESSES
D MES^XPDUTL($$CJ^XLFSTR("Beginning BXPA v1.0 pre-init process.",80))
;
I '$D(^BXPA(9002026.01,"ABASE")) D
.NEW BXIEN,BXDATA,OPER,PNAME,ENT,INST
.S BXIEN=0
.F S BXIEN=$O(^BXPA(9002026.01,BXIEN)) Q:'BXIEN D
..S BXDATA=$G(^BXPA(9002026.01,BXIEN,0)) I BXDATA="" Q
..S OPER=$P(BXDATA,U,4),PNAME=$P(BXDATA,U,5),ENT=$P(BXDATA,U,6),INST=$P(BXDATA,U,7)
..I PNAME=""!(ENT="")!(INST="")!(OPER="") Q
..S ^BXPA(9002026.01,"ABASE",PNAME,ENT,INST,OPER,BXIEN)=""
D MES^XPDUTL($$CJ^XLFSTR("BXPA v1.0 pre-init process complete.",80))
Q
;
;
POST ;BXPA v1.0 POST-INIT PROCESSES
D MES^XPDUTL($$CJ^XLFSTR("Beginning BXPA v1.0 post-init process.",80))
;
D PDPOP ;POPULATE PARAMETER AUDIT LIST WITH MINIMUM AUDIT SET
D BASELINE ;ESTABLISH PARAMETER AUDIT LIST FILE'S BASELINE LOAD
; Add the main menu to AKMOCORE
S X=$$ADD^XPDMENU("AKMOCORE","BXPAMENU","BXT")
;
D MES^XPDUTL($$CJ^XLFSTR("BXPA v1.0 post-init process complete.",80))
Q
;
;
PDPOP ;PARAMETER AUDIT LIST FILE POPULATION
D MES^XPDUTL($$CJ^XLFSTR("Populating PARAMETER AUDIT LIST file...",80))
N PTR,PDIDX,PDNAME
F PDIDX=1:1 D Q:PDNAME="END OF PDLIST"
.S PDNAME=$P($T(PDLIST+PDIDX),";",3) Q:PDNAME="END OF PDLIST"
.I $D(^BXPA(9002026.02,"B",PDNAME)) D ;SKIP IF ALREADY IN PARAMETER AUDIT LIST
..D MES^XPDUTL($$LJ^XLFSTR(PDNAME_" already in PARAMETER AUDIT LIST - skipped.",80))
..I 1
.E D ;NOT ALREADY IN PARAMETER AUDIT LIST - PROCEED
..I $D(^XTV(8989.51,"B",PDNAME)) D ;SAFETY CHECK - MATCHING ENTRY IN PARAMETER DEFINITION FILE?
...S PTR=$O(^XTV(8989.51,"B",PDNAME,""))
...K DA,DIC
...S DIC="^BXPA(9002026.02,",DIC(0)="ML",DLAYGO=9002026.02
...S DIC("DR")="3///`"_PTR
...S X=PDNAME
...D FILE^DICN K DIC
...D HIST^BXPAUDIT(+Y,"ENABLE")
...D MES^XPDUTL($$LJ^XLFSTR(PDNAME_" added to PARAMETER AUDIT LIST file.",80))
...I 1
..E D ;FAILED PARAMETER DEFINITION FILE SAFETY CHECK - NO MATCH
...D MES^XPDUTL($$LJ^XLFSTR(PDNAME_" not found in PARAMETER DEFINITION file - skipped.",80))
D MES^XPDUTL($$CJ^XLFSTR("PARAMETER AUDIT LIST file population complete.",80))
Q
;
PDLIST ;;
;;ORB PROCESSING FLAG
;;ORB SYSTEM ENABLE/DISABLE
;;ORK PROCESSING FLAG
;;ORK SYSTEM ENABLE/DISABLE
;;ORQQPX COVER SHEET REMINDERS
;;END OF PDLIST
;
;
BASELINE ;ESTABLISH INITIAL BASELINE
D MES^XPDUTL($$CJ^XLFSTR("Establishing initial baseline for PARAMETER AUDIT LIST file...",80))
D BASE^BXPAUDIT
D MES^XPDUTL($$CJ^XLFSTR("PARAMETER AUDIT LIST file baseline procedure complete.",80))
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
BXPA1PST ;IHS/OIT/FBD -Environment Check and Pre/Post Init Process 21 Nov 2013 7:45 AM ;
+1 ;;1.0;IHS EXTENSIONS TO KERNEL TOOLKIT;;Dec 19, 2013;Build 12
+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 ;XT
+14 IF $$VERSION^XPDUTL("XT")'="7.3"
DO MES^XPDUTL($$CJ^XLFSTR("Version 7.3 of the TOOLKIT is required. Not installed",80))
DO SORRY(2)
IF 1
+15 IF '$TEST
DO MES^XPDUTL($$CJ^XLFSTR("Requires TOOLKIT Version 7.3 ....Present.",80))
+16 ;XT 7.3 PATCH 1017
+17 IF '$$INSTALLD("XT*7.3*1017")
DO SORRY(2)
+18 ;
+19 ;
+20 ;END OF ENVIRONMENT CHECK
QUIT
+21 ;
PRE ;PATCH 26 PRE-INIT CHECKS AND PROCESSES
+1 DO MES^XPDUTL($$CJ^XLFSTR("Beginning BXPA v1.0 pre-init process.",80))
+2 ;
+3 IF '$DATA(^BXPA(9002026.01,"ABASE"))
Begin DoDot:1
+4 NEW BXIEN,BXDATA,OPER,PNAME,ENT,INST
+5 SET BXIEN=0
+6 FOR
SET BXIEN=$ORDER(^BXPA(9002026.01,BXIEN))
IF 'BXIEN
QUIT
Begin DoDot:2
+7 SET BXDATA=$GET(^BXPA(9002026.01,BXIEN,0))
IF BXDATA=""
QUIT
+8 SET OPER=$PIECE(BXDATA,U,4)
SET PNAME=$PIECE(BXDATA,U,5)
SET ENT=$PIECE(BXDATA,U,6)
SET INST=$PIECE(BXDATA,U,7)
+9 IF PNAME=""!(ENT="")!(INST="")!(OPER="")
QUIT
+10 SET ^BXPA(9002026.01,"ABASE",PNAME,ENT,INST,OPER,BXIEN)=""
End DoDot:2
End DoDot:1
+11 DO MES^XPDUTL($$CJ^XLFSTR("BXPA v1.0 pre-init process complete.",80))
+12 QUIT
+13 ;
+14 ;
POST ;BXPA v1.0 POST-INIT PROCESSES
+1 DO MES^XPDUTL($$CJ^XLFSTR("Beginning BXPA v1.0 post-init process.",80))
+2 ;
+3 ;POPULATE PARAMETER AUDIT LIST WITH MINIMUM AUDIT SET
DO PDPOP
+4 ;ESTABLISH PARAMETER AUDIT LIST FILE'S BASELINE LOAD
DO BASELINE
+5 ; Add the main menu to AKMOCORE
+6 SET X=$$ADD^XPDMENU("AKMOCORE","BXPAMENU","BXT")
+7 ;
+8 DO MES^XPDUTL($$CJ^XLFSTR("BXPA v1.0 post-init process complete.",80))
+9 QUIT
+10 ;
+11 ;
PDPOP ;PARAMETER AUDIT LIST FILE POPULATION
+1 DO MES^XPDUTL($$CJ^XLFSTR("Populating PARAMETER AUDIT LIST file...",80))
+2 NEW PTR,PDIDX,PDNAME
+3 FOR PDIDX=1:1
Begin DoDot:1
+4 SET PDNAME=$PIECE($TEXT(PDLIST+PDIDX),";",3)
IF PDNAME="END OF PDLIST"
QUIT
+5 ;SKIP IF ALREADY IN PARAMETER AUDIT LIST
IF $DATA(^BXPA(9002026.02,"B",PDNAME))
Begin DoDot:2
+6 DO MES^XPDUTL($$LJ^XLFSTR(PDNAME_" already in PARAMETER AUDIT LIST - skipped.",80))
+7 IF 1
End DoDot:2
+8 ;NOT ALREADY IN PARAMETER AUDIT LIST - PROCEED
IF '$TEST
Begin DoDot:2
+9 ;SAFETY CHECK - MATCHING ENTRY IN PARAMETER DEFINITION FILE?
IF $DATA(^XTV(8989.51,"B",PDNAME))
Begin DoDot:3
+10 SET PTR=$ORDER(^XTV(8989.51,"B",PDNAME,""))
+11 KILL DA,DIC
+12 SET DIC="^BXPA(9002026.02,"
SET DIC(0)="ML"
SET DLAYGO=9002026.02
+13 SET DIC("DR")="3///`"_PTR
+14 SET X=PDNAME
+15 DO FILE^DICN
KILL DIC
+16 DO HIST^BXPAUDIT(+Y,"ENABLE")
+17 DO MES^XPDUTL($$LJ^XLFSTR(PDNAME_" added to PARAMETER AUDIT LIST file.",80))
+18 IF 1
End DoDot:3
+19 ;FAILED PARAMETER DEFINITION FILE SAFETY CHECK - NO MATCH
IF '$TEST
Begin DoDot:3
+20 DO MES^XPDUTL($$LJ^XLFSTR(PDNAME_" not found in PARAMETER DEFINITION file - skipped.",80))
End DoDot:3
End DoDot:2
End DoDot:1
IF PDNAME="END OF PDLIST"
QUIT
+21 DO MES^XPDUTL($$CJ^XLFSTR("PARAMETER AUDIT LIST file population complete.",80))
+22 QUIT
+23 ;
PDLIST ;;
+1 ;;ORB PROCESSING FLAG
+2 ;;ORB SYSTEM ENABLE/DISABLE
+3 ;;ORK PROCESSING FLAG
+4 ;;ORK SYSTEM ENABLE/DISABLE
+5 ;;ORQQPX COVER SHEET REMINDERS
+6 ;;END OF PDLIST
+7 ;
+8 ;
BASELINE ;ESTABLISH INITIAL BASELINE
+1 DO MES^XPDUTL($$CJ^XLFSTR("Establishing initial baseline for PARAMETER AUDIT LIST file...",80))
+2 DO BASE^BXPAUDIT
+3 DO MES^XPDUTL($$CJ^XLFSTR("PARAMETER AUDIT LIST file baseline procedure complete.",80))
+4 QUIT
+5 ;
+6 ;
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)
IMES ;
+1 DO MES^XPDUTL($$CJ^XLFSTR("Patch """_AUTSTAL_""" is"_$SELECT(Y<1:" *NOT*",1:"")_" installed.",IOM))
+2 QUIT
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