BUSA1PRE ;GDIT/HS/ALA-Preinstallation program ; 06 Mar 2013 9:52 AM
;;1.0;IHS USER SECURITY AUDIT;;Nov 05, 2013;Build 65
;
ENV ;EP - Environmental Checking Routine
; Run pre-install checks
N VERSION,EXEC,BMWDT
;
; Verify that BMW classes exist and we have the correct version.
;was; S BMWDT=$G(^BMW("fm2class","GenDate"))
;was; S EXEC="S BMWDT=$ZDTH(BMWDT,,,,,,,,,"""")" X EXEC
;was; I BMWDT="" D BMES^XPDUTL("Cannot retrieve BMW version") S XPDQUIT=2 I 1
;was;E I BMWDT<62962 D BMES^XPDUTL("BMW version 2013-05-20 or higher required") S XPDQUIT=2
;
; Add code to check for Ensemble version greater or equal to 2012
S VERSION=$$VERSION^%ZOSV
I VERSION<2012 D BMES^XPDUTL("Ensemble 2012 or later is required!") S XPDQUIT=2
;
Q
;
PRE ;EP - Preinstallation
;
;Reset some transport files data
NEW II,DA,DIK,X1,X2,X,%H
;
S II=0 F S II=$O(^BUSACLS(II)) Q:'II S DA=II,DIK="^BUSACLS(" D ^DIK
;
;Get future date
S X1=DT,X2=7 D C^%DTC
;
;Save off current BUSA AUDIT RPC DEFINITIONS file entries
K ^XTMP("BUSARPCD")
S ^XTMP("BUSARPCD",0)=$G(X)_"^"_DT_"^BUSA VERSION 1.0 INSTALL SCRATCH GLOBALS"
S II=0 F S II=$O(^BUSA(9002319.03,II)) Q:'II M ^XTMP("BUSARPCD",II)=^BUSA(9002319.03,II)
;
;Now remove them
S II=0 F S II=$O(^BUSA(9002319.03,II)) Q:'II S DA=II,DIK="^BUSA(9002319.03," D ^DIK
;
Q
;
POS ;EP - Post Installation Code
;
NEW TYP,CURR,DIK,II
;
F TYP="M","B","C","W" D
. ;
. ;Quit if already on
. I +$$STATUS^BUSAOPT(TYP) Q
. S CURR=1
. D NREC^BUSAOPT(TYP,1)
;
;Now add the existing entries back in
S II=0 F S II=$O(^XTMP("BUSARPCD",II)) Q:'II D
. ;
. NEW RPCNAME,X,Y,DIC,IEN,DLAYGO
. ;
. S RPCNAME=$P($G(^XTMP("BUSARPCD",II,0)),U) Q:RPCNAME=""
. ;
. ;Look to see if entry exists - if it does, it is newer than the existing one
. S IEN=$O(^BUSA(9002319.03,"B",RPCNAME,"")) I IEN]"" Q
. ;
. ;Create a new entry
. S DIC="^BUSA(9002319.03,",DIC(0)="L",DLAYGO=9002319.03,X=RPCNAME
. K DO,DD D FILE^DICN
. S IEN=+Y
. I IEN<1 Q
. ;
. ;If we have an IEN file the entry
. M ^BUSA(9002319.03,IEN)=^XTMP("BUSARPCD",II)
;
;Re-Compile indices OF RPC file
S DIK(1)=".01",DIK="^BUSA(9002319.03," D ENALL^DIK
;
;Compile class process
;
N TRIEN,EXEC,ERR
;
;For each build, set this to the 9002319.05 entry to load
S TRIEN=1
;
;Delete existing BUSA Classes
S EXEC="DO $SYSTEM.OBJ.DeletePackage(""BUSA"")" X EXEC
;
; Import BUSA classes
K ERR
I $G(TRIEN)'="" D IMPORT^BUSACLAS(TRIEN,.ERR)
I $G(ERR) Q
;
;Prompt for approved reporting tool users
D USER^BUSAOPT
;
Q
;
CONV ;EP - Pre-Install - Handle previous installs
;
Q
BUSA1PRE ;GDIT/HS/ALA-Preinstallation program ; 06 Mar 2013 9:52 AM
+1 ;;1.0;IHS USER SECURITY AUDIT;;Nov 05, 2013;Build 65
+2 ;
ENV ;EP - Environmental Checking Routine
+1 ; Run pre-install checks
+2 NEW VERSION,EXEC,BMWDT
+3 ;
+4 ; Verify that BMW classes exist and we have the correct version.
+5 ;was; S BMWDT=$G(^BMW("fm2class","GenDate"))
+6 ;was; S EXEC="S BMWDT=$ZDTH(BMWDT,,,,,,,,,"""")" X EXEC
+7 ;was; I BMWDT="" D BMES^XPDUTL("Cannot retrieve BMW version") S XPDQUIT=2 I 1
+8 ;was;E I BMWDT<62962 D BMES^XPDUTL("BMW version 2013-05-20 or higher required") S XPDQUIT=2
+9 ;
+10 ; Add code to check for Ensemble version greater or equal to 2012
+11 SET VERSION=$$VERSION^%ZOSV
+12 IF VERSION<2012
DO BMES^XPDUTL("Ensemble 2012 or later is required!")
SET XPDQUIT=2
+13 ;
+14 QUIT
+15 ;
PRE ;EP - Preinstallation
+1 ;
+2 ;Reset some transport files data
+3 NEW II,DA,DIK,X1,X2,X,%H
+4 ;
+5 SET II=0
FOR
SET II=$ORDER(^BUSACLS(II))
IF 'II
QUIT
SET DA=II
SET DIK="^BUSACLS("
DO ^DIK
+6 ;
+7 ;Get future date
+8 SET X1=DT
SET X2=7
DO C^%DTC
+9 ;
+10 ;Save off current BUSA AUDIT RPC DEFINITIONS file entries
+11 KILL ^XTMP("BUSARPCD")
+12 SET ^XTMP("BUSARPCD",0)=$GET(X)_"^"_DT_"^BUSA VERSION 1.0 INSTALL SCRATCH GLOBALS"
+13 SET II=0
FOR
SET II=$ORDER(^BUSA(9002319.03,II))
IF 'II
QUIT
MERGE ^XTMP("BUSARPCD",II)=^BUSA(9002319.03,II)
+14 ;
+15 ;Now remove them
+16 SET II=0
FOR
SET II=$ORDER(^BUSA(9002319.03,II))
IF 'II
QUIT
SET DA=II
SET DIK="^BUSA(9002319.03,"
DO ^DIK
+17 ;
+18 QUIT
+19 ;
POS ;EP - Post Installation Code
+1 ;
+2 NEW TYP,CURR,DIK,II
+3 ;
+4 FOR TYP="M","B","C","W"
Begin DoDot:1
+5 ;
+6 ;Quit if already on
+7 IF +$$STATUS^BUSAOPT(TYP)
QUIT
+8 SET CURR=1
+9 DO NREC^BUSAOPT(TYP,1)
End DoDot:1
+10 ;
+11 ;Now add the existing entries back in
+12 SET II=0
FOR
SET II=$ORDER(^XTMP("BUSARPCD",II))
IF 'II
QUIT
Begin DoDot:1
+13 ;
+14 NEW RPCNAME,X,Y,DIC,IEN,DLAYGO
+15 ;
+16 SET RPCNAME=$PIECE($GET(^XTMP("BUSARPCD",II,0)),U)
IF RPCNAME=""
QUIT
+17 ;
+18 ;Look to see if entry exists - if it does, it is newer than the existing one
+19 SET IEN=$ORDER(^BUSA(9002319.03,"B",RPCNAME,""))
IF IEN]""
QUIT
+20 ;
+21 ;Create a new entry
+22 SET DIC="^BUSA(9002319.03,"
SET DIC(0)="L"
SET DLAYGO=9002319.03
SET X=RPCNAME
+23 KILL DO,DD
DO FILE^DICN
+24 SET IEN=+Y
+25 IF IEN<1
QUIT
+26 ;
+27 ;If we have an IEN file the entry
+28 MERGE ^BUSA(9002319.03,IEN)=^XTMP("BUSARPCD",II)
End DoDot:1
+29 ;
+30 ;Re-Compile indices OF RPC file
+31 SET DIK(1)=".01"
SET DIK="^BUSA(9002319.03,"
DO ENALL^DIK
+32 ;
+33 ;Compile class process
+34 ;
+35 NEW TRIEN,EXEC,ERR
+36 ;
+37 ;For each build, set this to the 9002319.05 entry to load
+38 SET TRIEN=1
+39 ;
+40 ;Delete existing BUSA Classes
+41 SET EXEC="DO $SYSTEM.OBJ.DeletePackage(""BUSA"")"
XECUTE EXEC
+42 ;
+43 ; Import BUSA classes
+44 KILL ERR
+45 IF $GET(TRIEN)'=""
DO IMPORT^BUSACLAS(TRIEN,.ERR)
+46 IF $GET(ERR)
QUIT
+47 ;
+48 ;Prompt for approved reporting tool users
+49 DO USER^BUSAOPT
+50 ;
+51 QUIT
+52 ;
CONV ;EP - Pre-Install - Handle previous installs
+1 ;
+2 QUIT