BSTS1POS ;GDIT/HS/BEE-Version 1.0 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
;;1.0;IHS STANDARD TERMINOLOGY;;Sep 10, 2014;Build 101
;
ENV ;EP - Environmental Checking Routine
; Run pre-install checks
N VERSION,EXEC,BMWDT
;
;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
;
;Make sure a refresh is not running already
L +^BSTS(9002318.1,0):0 E D BMES^XPDUTL("A Local BSTS Cache Refresh is Already Running. Please Try Later") S XPDQUIT=2 Q
L -^BSTS(9002318.1,0)
;
;Make sure an ICD9 to SNOMED compile isn't running
L +^TMP("BSTSICD2SMD"):0 E D BMES^XPDUTL("An ICD9 to SNOMED Background Compile is Running. Please Try later") S XPDQUIT=2 Q
L -^TMP("BSTSICD2SMD")
;
;Make sure another install isn't running
L +^TMP("BSTSINSTALL"):3 E D BMES^XPDUTL("A BSTS Install is Already Running") S XPDQUIT=2 Q
L -^TMP("BSTSINSTALL")
;
Q
;
EN ;EP
NEW DA,DIC,X,Y,ZTRTN,ZTDESC,ZTIO,ZTSAVE,DLAYGO,NMID,NMIEN
S DIC(0)="LNZ",DIC="^BSTS(9002318,",DLAYGO=9002318,X=$P($G(^AUTTSITE(1,0)),U,1)
I X="" S X=$O(^BGPSITE(0))
I X'="" S X=$P(^DIC(4,X,0),U,1)
D ^DIC
;
;Load the classes
;
N TRIEN,EXEC,ERR
;
;For each build, set this to the 9002318.5 entry to load
S TRIEN=1
;
;Delete existing BSTS Classes
S EXEC="DO $SYSTEM.OBJ.DeletePackage(""BSTS"")" X EXEC
;
; Import BSTS classes
K ERR
I $G(TRIEN)'="" D IMPORT^BSTSCLAS(TRIEN,.ERR)
I $G(ERR) Q
;
;Update LAST SUBSET CHECK now so process won't keep getting called
D
. NEW BSTS,ERROR,NMIEN
. S NMIEN=$O(^BSTS(9002318.1,"B",36,"")) Q:NMIEN=""
. S BSTS(9002318.1,NMIEN_",",.06)=DT
. D FILE^DIE("","BSTS","ERROR")
;
;Unlock installation entry
L -^TMP("BSTSINSTALL")
;
Q
;
PRE ;Pre-Install Front End
;
;Perform Lock so only one install can run and DTS calls will be switched to local
L +^TMP("BSTSINSTALL"):3 E D BMES^XPDUTL("A BSTS Install is Already Running - Aborting Installation") S XPDABORT=1 Q
;
N DIU
;
;Clear out existing entries
S DIU="^BSTS(9002318.1,",DIU(0)="DST" D EN^DIU2
S DIU="^BSTS(9002318.3,",DIU(0)="DST" D EN^DIU2
S DIU="^BSTS(9002318.4,",DIU(0)="DST" D EN^DIU2
S DIU="^BSTSCLS(",DIU(0)="DST" D EN^DIU2
;
Q
BSTS1POS ;GDIT/HS/BEE-Version 1.0 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
+1 ;;1.0;IHS STANDARD TERMINOLOGY;;Sep 10, 2014;Build 101
+2 ;
ENV ;EP - Environmental Checking Routine
+1 ; Run pre-install checks
+2 NEW VERSION,EXEC,BMWDT
+3 ;
+4 ;Check for Ensemble version greater or equal to 2012
+5 SET VERSION=$$VERSION^%ZOSV
+6 IF VERSION<2012
DO BMES^XPDUTL("Ensemble 2012 or later is required!")
SET XPDQUIT=2
QUIT
+7 ;
+8 ;Make sure a refresh is not running already
+9 LOCK +^BSTS(9002318.1,0):0
IF '$TEST
DO BMES^XPDUTL("A Local BSTS Cache Refresh is Already Running. Please Try Later")
SET XPDQUIT=2
QUIT
+10 LOCK -^BSTS(9002318.1,0)
+11 ;
+12 ;Make sure an ICD9 to SNOMED compile isn't running
+13 LOCK +^TMP("BSTSICD2SMD"):0
IF '$TEST
DO BMES^XPDUTL("An ICD9 to SNOMED Background Compile is Running. Please Try later")
SET XPDQUIT=2
QUIT
+14 LOCK -^TMP("BSTSICD2SMD")
+15 ;
+16 ;Make sure another install isn't running
+17 LOCK +^TMP("BSTSINSTALL"):3
IF '$TEST
DO BMES^XPDUTL("A BSTS Install is Already Running")
SET XPDQUIT=2
QUIT
+18 LOCK -^TMP("BSTSINSTALL")
+19 ;
+20 QUIT
+21 ;
EN ;EP
+1 NEW DA,DIC,X,Y,ZTRTN,ZTDESC,ZTIO,ZTSAVE,DLAYGO,NMID,NMIEN
+2 SET DIC(0)="LNZ"
SET DIC="^BSTS(9002318,"
SET DLAYGO=9002318
SET X=$PIECE($GET(^AUTTSITE(1,0)),U,1)
+3 IF X=""
SET X=$ORDER(^BGPSITE(0))
+4 IF X'=""
SET X=$PIECE(^DIC(4,X,0),U,1)
+5 DO ^DIC
+6 ;
+7 ;Load the classes
+8 ;
+9 NEW TRIEN,EXEC,ERR
+10 ;
+11 ;For each build, set this to the 9002318.5 entry to load
+12 SET TRIEN=1
+13 ;
+14 ;Delete existing BSTS Classes
+15 SET EXEC="DO $SYSTEM.OBJ.DeletePackage(""BSTS"")"
XECUTE EXEC
+16 ;
+17 ; Import BSTS classes
+18 KILL ERR
+19 IF $GET(TRIEN)'=""
DO IMPORT^BSTSCLAS(TRIEN,.ERR)
+20 IF $GET(ERR)
QUIT
+21 ;
+22 ;Update LAST SUBSET CHECK now so process won't keep getting called
+23 Begin DoDot:1
+24 NEW BSTS,ERROR,NMIEN
+25 SET NMIEN=$ORDER(^BSTS(9002318.1,"B",36,""))
IF NMIEN=""
QUIT
+26 SET BSTS(9002318.1,NMIEN_",",.06)=DT
+27 DO FILE^DIE("","BSTS","ERROR")
End DoDot:1
+28 ;
+29 ;Unlock installation entry
+30 LOCK -^TMP("BSTSINSTALL")
+31 ;
+32 QUIT
+33 ;
PRE ;Pre-Install Front End
+1 ;
+2 ;Perform Lock so only one install can run and DTS calls will be switched to local
+3 LOCK +^TMP("BSTSINSTALL"):3
IF '$TEST
DO BMES^XPDUTL("A BSTS Install is Already Running - Aborting Installation")
SET XPDABORT=1
QUIT
+4 ;
+5 NEW DIU
+6 ;
+7 ;Clear out existing entries
+8 SET DIU="^BSTS(9002318.1,"
SET DIU(0)="DST"
DO EN^DIU2
+9 SET DIU="^BSTS(9002318.3,"
SET DIU(0)="DST"
DO EN^DIU2
+10 SET DIU="^BSTS(9002318.4,"
SET DIU(0)="DST"
DO EN^DIU2
+11 SET DIU="^BSTSCLS("
SET DIU(0)="DST"
DO EN^DIU2
+12 ;
+13 QUIT