- BSTS2P01 ;GDIT/HS/BEE-Version 2.0 Patch 1 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
- ;;2.0;IHS STANDARD TERMINOLOGY;**1**;Dec 01, 2016;Build 36
- ;
- ENV ;EP - Environmental Checking Routine
- ;
- N VERSION,EXEC,BMWDT
- ;
- ;Check for BSTS v2.0
- I $$VERSION^XPDUTL("BSTS")<2 D BMES^XPDUTL("Version 2.0 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
- ;
- NEW ICONC,ICIEN,INALL,CNT,PIEN
- NEW TRIEN,EXEC,ERR,X,VAR,STS
- ;
- ;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
- ;
- ;Set up new BSTS,PROXY USER entry
- S PIEN=$O(^VA(200,"B","BSTS,PROXY USER","")) I PIEN="" D
- . NEW X,DIC,Y,VAUPD,USCLS,DIEN,DA
- . S DIC="^VA(200,",DIC(0)="LX"
- . S X="BSTS,PROXY USER"
- . D ^DIC
- . I '+Y Q
- . S DIEN=+Y
- . ;
- . ;Set up User Class
- . S USCLS=$O(^VA(201,"B","APPLICATION PROXY","")) Q:USCLS=""
- . I $D(^VA(200,DIEN,"USC3","B",USCLS)) Q
- . S DIC(0)="LX",DIC="^VA(200,"_DIEN_",""USC3"","
- . S X="APPLICATION PROXY",DA(1)=DIEN
- . D ^DIC
- ;
- ;Turn on the SEARCH STRING logging
- ;*Decision was made to leave it up to the sites to turn it on
- ;D
- ;. NEW WIEN
- ;. ;
- ;. ;Turn on each WEB SERVICE entry
- ;. S WIEN=0 F S WIEN=$O(^BSTS(9002318.2,WIEN)) Q:'WIEN D
- ;.. NEW BSTSUPD,ERROR
- ;.. S BSTSUPD(9002318.2,WIEN_",",.16)="1"
- ;.. D FILE^DIE("","BSTSUPD","ERROR")
- ;
- ;Make a log entry
- D LOG^BSTSAPIL("INST","","PATCH","BSTS*2.0*1")
- ;
- ;Unlock installation entry
- L -^TMP("BSTSINSTALL")
- ;
- ;Kick off update to pull down SNOMED Mapping Advice
- D QUEUE^BSTSVOFL(32777) ;Put it on the queue
- D JOBNOW^BSTSVOFL ;Kick off now
- ;
- 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)
- BSTS2P01 ;GDIT/HS/BEE-Version 2.0 Patch 1 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
- +1 ;;2.0;IHS STANDARD TERMINOLOGY;**1**;Dec 01, 2016;Build 36
- +2 ;
- ENV ;EP - Environmental Checking Routine
- +1 ;
- +2 NEW VERSION,EXEC,BMWDT
- +3 ;
- +4 ;Check for BSTS v2.0
- +5 IF $$VERSION^XPDUTL("BSTS")<2
- DO BMES^XPDUTL("Version 2.0 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 ICONC,ICIEN,INALL,CNT,PIEN
- +5 NEW TRIEN,EXEC,ERR,X,VAR,STS
- +6 ;
- +7 ;For each build, set this to the 9002318.5 entry to load
- +8 SET TRIEN=1
- +9 ;
- +10 ;Delete existing BSTS Classes
- +11 SET EXEC="DO $SYSTEM.OBJ.DeletePackage(""BSTS"")"
- XECUTE EXEC
- +12 ;
- +13 ; Import BSTS classes
- +14 KILL ERR
- +15 IF $GET(TRIEN)'=""
- DO IMPORT^BSTSCLAS(TRIEN,.ERR)
- +16 IF $GET(ERR)
- QUIT
- +17 ;
- +18 ;Set up new BSTS,PROXY USER entry
- +19 SET PIEN=$ORDER(^VA(200,"B","BSTS,PROXY USER",""))
- IF PIEN=""
- Begin DoDot:1
- +20 NEW X,DIC,Y,VAUPD,USCLS,DIEN,DA
- +21 SET DIC="^VA(200,"
- SET DIC(0)="LX"
- +22 SET X="BSTS,PROXY USER"
- +23 DO ^DIC
- +24 IF '+Y
- QUIT
- +25 SET DIEN=+Y
- +26 ;
- +27 ;Set up User Class
- +28 SET USCLS=$ORDER(^VA(201,"B","APPLICATION PROXY",""))
- IF USCLS=""
- QUIT
- +29 IF $DATA(^VA(200,DIEN,"USC3","B",USCLS))
- QUIT
- +30 SET DIC(0)="LX"
- SET DIC="^VA(200,"_DIEN_",""USC3"","
- +31 SET X="APPLICATION PROXY"
- SET DA(1)=DIEN
- +32 DO ^DIC
- End DoDot:1
- +33 ;
- +34 ;Turn on the SEARCH STRING logging
- +35 ;*Decision was made to leave it up to the sites to turn it on
- +36 ;D
- +37 ;. NEW WIEN
- +38 ;. ;
- +39 ;. ;Turn on each WEB SERVICE entry
- +40 ;. S WIEN=0 F S WIEN=$O(^BSTS(9002318.2,WIEN)) Q:'WIEN D
- +41 ;.. NEW BSTSUPD,ERROR
- +42 ;.. S BSTSUPD(9002318.2,WIEN_",",.16)="1"
- +43 ;.. D FILE^DIE("","BSTSUPD","ERROR")
- +44 ;
- +45 ;Make a log entry
- +46 DO LOG^BSTSAPIL("INST","","PATCH","BSTS*2.0*1")
- +47 ;
- +48 ;Unlock installation entry
- +49 LOCK -^TMP("BSTSINSTALL")
- +50 ;
- +51 ;Kick off update to pull down SNOMED Mapping Advice
- +52 ;Put it on the queue
- DO QUEUE^BSTSVOFL(32777)
- +53 ;Kick off now
- DO JOBNOW^BSTSVOFL
- +54 ;
- +55 QUIT
- +56 ;
- 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)