- BSTS10P7 ;GDIT/HS/BEE-Version 1.0 Patch 7 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
- ;;1.0;IHS STANDARD TERMINOLOGY;**6,7**;Sep 10, 2014;Build 34
- ;
- ENV ;EP - Environmental Checking Routine
- ;
- N VERSION,EXEC,BMWDT
- ;
- ;Check for BSTS*1.0*6
- I '$$INSTALLD("BSTS*1.0*6") D BMES^XPDUTL("Version 1.0 Patch 6 of BSTS 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 Description Id fix compile isn't running
- L +^XTMP("BSTSCFIX"):0 E D BMES^XPDUTL("A Description Id Population Utility Process is Running. Please Try later") S XPDQUIT=2 Q
- L -^XTMP("BSTSCFIX")
- ;
- ;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
- ;
- ;Load the classes
- ;
- N TRIEN,EXEC,ERR,X,VAR
- ;
- ;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
- ;
- ;Unlock installation entry
- L -^TMP("BSTSINSTALL")
- ;
- ;Pull the namespace and version
- S X=$$CODESETS^BSTSAPI("VAR")
- S X=$$VERSIONS^BSTSAPI("VAR",32779)
- S X=$$VERSIONS^BSTSAPI("VAR",32780)
- ;
- ;Fix 32772 Codeset and schedule refresh
- D 32772
- ;
- ;Kick off the Equivalency update
- ;Needed in order to pull down conditional mappings and concept default statuses
- D QUEUE^BSTSVOFL(32780) ;Put it on the queue
- D JOBNOW^BSTSVOFL ;Kick off now
- ;
- Q
- ;
- 32772 ;EP - Fix 32772 entries and kick off process
- ;
- NEW CONC,CIEN
- ;
- S CONC="" F S CONC=$O(^BSTS(9002318.4,"C",32772,CONC)) Q:CONC="" S CIEN="" F S CIEN=$O(^BSTS(9002318.4,"C",32772,CONC,CIEN)) Q:CIEN="" D
- . ;
- . NEW DTSID,DA,DIK,TIEN
- . ;
- . S DTSID=$$GET1^DIQ(9002318.4,CIEN_",",.08,"I")
- . ;
- . ;Skip valid ones
- . I DTSID>570,DTSID<1147 Q
- . ;
- . ;Remove codeset entry
- . S DA=CIEN,DIK="^BSTS(9002318.4," D ^DIK
- . ;
- . ;Remove terms
- . S TIEN="" F S TIEN=$O(^BSTS(9002318.3,"C",32772,CIEN,TIEN)) Q:TIEN="" D
- .. NEW DA,DIK
- .. S DA=TIEN,DIK="^BSTS(9002318.3," D ^DIK
- ;
- ;Put 32772 refresh task on queue
- D QUEUE^BSTSVOFL(32772)
- ;
- 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 transport global and new conversion file
- S DIU="^BSTSCLS(",DIU(0)="DST" D EN^DIU2
- ;
- Q
- ;
- INSTALLD(BSTSSTAL) ;EP - Determine if patch BSTSSTAL was installed, where
- ; BSTSSTAL is the name of the INSTALL. E.g "BSTS*1.0*1".
- ;
- NEW DIC,X,Y,D
- S X=$P(BSTSSTAL,"*",1)
- S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
- D IX^DIC
- I Y<1 Q 0
- S DIC=DIC_+Y_",22,",X=$P(BSTSSTAL,"*",2)
- D ^DIC
- I Y<1 Q 0
- S DIC=DIC_+Y_",""PAH"",",X=$P(BSTSSTAL,"*",3)
- D ^DIC
- Q $S(Y<1:0,1:1)
- BSTS10P7 ;GDIT/HS/BEE-Version 1.0 Patch 7 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
- +1 ;;1.0;IHS STANDARD TERMINOLOGY;**6,7**;Sep 10, 2014;Build 34
- +2 ;
- ENV ;EP - Environmental Checking Routine
- +1 ;
- +2 NEW VERSION,EXEC,BMWDT
- +3 ;
- +4 ;Check for BSTS*1.0*6
- +5 IF '$$INSTALLD("BSTS*1.0*6")
- DO BMES^XPDUTL("Version 1.0 Patch 6 of BSTS is required!")
- SET XPDQUIT=2
- QUIT
- +6 ;
- +7 ;Make sure a refresh is not running already
- +8 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
- +9 LOCK -^BSTS(9002318.1,0)
- +10 ;
- +11 ;Make sure an Description Id fix compile isn't running
- +12 LOCK +^XTMP("BSTSCFIX"):0
- IF '$TEST
- DO BMES^XPDUTL("A Description Id Population Utility Process is Running. Please Try later")
- SET XPDQUIT=2
- QUIT
- +13 LOCK -^XTMP("BSTSCFIX")
- +14 ;
- +15 ;Make sure an ICD9 to SNOMED compile isn't running
- +16 LOCK +^TMP("BSTSICD2SMD"):0
- IF '$TEST
- DO BMES^XPDUTL("An ICD9 to SNOMED Background Compile is Running. Please Try later")
- SET XPDQUIT=2
- QUIT
- +17 LOCK -^TMP("BSTSICD2SMD")
- +18 ;
- +19 ;Make sure another install isn't running
- +20 LOCK +^TMP("BSTSINSTALL"):3
- IF '$TEST
- DO BMES^XPDUTL("A BSTS Install is Already Running")
- SET XPDQUIT=2
- QUIT
- +21 LOCK -^TMP("BSTSINSTALL")
- +22 ;
- +23 QUIT
- +24 ;
- EN ;EP
- +1 ;
- +2 ;Load the classes
- +3 ;
- +4 NEW TRIEN,EXEC,ERR,X,VAR
- +5 ;
- +6 ;For each build, set this to the 9002318.5 entry to load
- +7 SET TRIEN=1
- +8 ;
- +9 ;Delete existing BSTS Classes
- +10 SET EXEC="DO $SYSTEM.OBJ.DeletePackage(""BSTS"")"
- XECUTE EXEC
- +11 ;
- +12 ; Import BSTS classes
- +13 KILL ERR
- +14 IF $GET(TRIEN)'=""
- DO IMPORT^BSTSCLAS(TRIEN,.ERR)
- +15 IF $GET(ERR)
- QUIT
- +16 ;
- +17 ;Unlock installation entry
- +18 LOCK -^TMP("BSTSINSTALL")
- +19 ;
- +20 ;Pull the namespace and version
- +21 SET X=$$CODESETS^BSTSAPI("VAR")
- +22 SET X=$$VERSIONS^BSTSAPI("VAR",32779)
- +23 SET X=$$VERSIONS^BSTSAPI("VAR",32780)
- +24 ;
- +25 ;Fix 32772 Codeset and schedule refresh
- +26 DO 32772
- +27 ;
- +28 ;Kick off the Equivalency update
- +29 ;Needed in order to pull down conditional mappings and concept default statuses
- +30 ;Put it on the queue
- DO QUEUE^BSTSVOFL(32780)
- +31 ;Kick off now
- DO JOBNOW^BSTSVOFL
- +32 ;
- +33 QUIT
- +34 ;
- 32772 ;EP - Fix 32772 entries and kick off process
- +1 ;
- +2 NEW CONC,CIEN
- +3 ;
- +4 SET CONC=""
- FOR
- SET CONC=$ORDER(^BSTS(9002318.4,"C",32772,CONC))
- IF CONC=""
- QUIT
- SET CIEN=""
- FOR
- SET CIEN=$ORDER(^BSTS(9002318.4,"C",32772,CONC,CIEN))
- IF CIEN=""
- QUIT
- Begin DoDot:1
- +5 ;
- +6 NEW DTSID,DA,DIK,TIEN
- +7 ;
- +8 SET DTSID=$$GET1^DIQ(9002318.4,CIEN_",",.08,"I")
- +9 ;
- +10 ;Skip valid ones
- +11 IF DTSID>570
- IF DTSID<1147
- QUIT
- +12 ;
- +13 ;Remove codeset entry
- +14 SET DA=CIEN
- SET DIK="^BSTS(9002318.4,"
- DO ^DIK
- +15 ;
- +16 ;Remove terms
- +17 SET TIEN=""
- FOR
- SET TIEN=$ORDER(^BSTS(9002318.3,"C",32772,CIEN,TIEN))
- IF TIEN=""
- QUIT
- Begin DoDot:2
- +18 NEW DA,DIK
- +19 SET DA=TIEN
- SET DIK="^BSTS(9002318.3,"
- DO ^DIK
- End DoDot:2
- End DoDot:1
- +20 ;
- +21 ;Put 32772 refresh task on queue
- +22 DO QUEUE^BSTSVOFL(32772)
- +23 ;
- +24 QUIT
- +25 ;
- 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 transport global and new conversion file
- +8 SET DIU="^BSTSCLS("
- SET DIU(0)="DST"
- DO EN^DIU2
- +9 ;
- +10 QUIT
- +11 ;
- INSTALLD(BSTSSTAL) ;EP - Determine if patch BSTSSTAL was installed, where
- +1 ; BSTSSTAL is the name of the INSTALL. E.g "BSTS*1.0*1".
- +2 ;
- +3 NEW DIC,X,Y,D
- +4 SET X=$PIECE(BSTSSTAL,"*",1)
- +5 SET DIC="^DIC(9.4,"
- SET DIC(0)="FM"
- SET D="C"
- +6 DO IX^DIC
- +7 IF Y<1
- QUIT 0
- +8 SET DIC=DIC_+Y_",22,"
- SET X=$PIECE(BSTSSTAL,"*",2)
- +9 DO ^DIC
- +10 IF Y<1
- QUIT 0
- +11 SET DIC=DIC_+Y_",""PAH"","
- SET X=$PIECE(BSTSSTAL,"*",3)
- +12 DO ^DIC
- +13 QUIT $SELECT(Y<1:0,1:1)