Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BXPA1PST

BXPA1PST.m

Go to the documentation of this file.
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