- BSTS10P8 ;GDIT/HS/BEE-Version 1.0 Patch 8 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
- ;;1.0;IHS STANDARD TERMINOLOGY;**8**;Sep 10, 2014;Build 35
- ;
- ENV ;EP - Environmental Checking Routine
- ;
- N VERSION,EXEC,BMWDT
- ;
- ;Check for BSTS*1.0*7
- I '$$INSTALLD("BSTS*1.0*7") D BMES^XPDUTL("Version 1.0 Patch 7 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
- N 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
- ;
- ;Populate new GALAXY SUBSET field in BSTS CONCEPT
- W !,"Populating new BSTS CONCEPT 'GALAXY SUBSET' field"
- S ICONC="" F S ICONC=$O(^BSTS(9002318.4,"C",36,ICONC)) Q:'ICONC D
- . S ICIEN="" F S ICIEN=$O(^BSTS(9002318.4,"C",36,ICONC,ICIEN)) Q:'ICIEN D
- .. ;
- .. NEW BSTSUPD,ERROR,NMID
- .. ;
- .. ;Quit on partial
- .. I $$GET1^DIQ(9002318.4,ICIEN_",",.03,"I")="P" Q
- .. ;
- .. S NMID=$$GET1^DIQ(9002318.4,"11,",.07,"E")
- .. I NMID'=1552,NMID'=36 Q
- .. ;
- .. ;Look for IHS PROBLEM ALL SNOMED or RXNO SRCH Drug Ingredients All
- .. I NMID=1552,'$D(^BSTS(9002318.4,ICIEN,4,"B","RXNO SRCH Drug Ingredients All")) Q
- .. I NMID=36,'$D(^BSTS(9002318.4,ICIEN,4,"B","IHS PROBLEM ALL SNOMED")) Q
- .. ;
- .. S BSTSUPD(9002318.4,ICIEN_",",.15)="Y"
- .. D FILE^DIE("","BSTSUPD","ERROR")
- .. S CNT=$G(CNT)+1 I CNT#1000=0 W "."
- ;
- ;Manually update 4 32772 entries
- S STS=$$DTSLKP^BSTSAPI("VAR","732^32772")
- S STS=$$DTSLKP^BSTSAPI("VAR","734^32772")
- S STS=$$DTSLKP^BSTSAPI("VAR","776^32772")
- S STS=$$DTSLKP^BSTSAPI("VAR","738^32772")
- ;
- ;Unlock installation entry
- L -^TMP("BSTSINSTALL")
- ;
- ;Queue custom codesets
- D QUEUE^BSTSVOFL(32771)
- D QUEUE^BSTSVOFL(32772)
- D QUEUE^BSTSVOFL(32773)
- D QUEUE^BSTSVOFL(32774)
- D QUEUE^BSTSVOFL(32775)
- ;
- ;Kick off RxNorm update
- D QUEUE^BSTSVOFL("S1552") ;Put it on the queue
- ;
- ;Kick off update to pull down replacement information
- D QUEUE^BSTSVOFL(32780) ;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
- S DIU="^BSTS(9002318.6,",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)
- BSTS10P8 ;GDIT/HS/BEE-Version 1.0 Patch 8 Post (and Pre) Install ; 19 Nov 2012 9:41 AM
- +1 ;;1.0;IHS STANDARD TERMINOLOGY;**8**;Sep 10, 2014;Build 35
- +2 ;
- ENV ;EP - Environmental Checking Routine
- +1 ;
- +2 NEW VERSION,EXEC,BMWDT
- +3 ;
- +4 ;Check for BSTS*1.0*7
- +5 IF '$$INSTALLD("BSTS*1.0*7")
- DO BMES^XPDUTL("Version 1.0 Patch 7 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
- +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 ;Populate new GALAXY SUBSET field in BSTS CONCEPT
- +19 WRITE !,"Populating new BSTS CONCEPT 'GALAXY SUBSET' field"
- +20 SET ICONC=""
- FOR
- SET ICONC=$ORDER(^BSTS(9002318.4,"C",36,ICONC))
- IF 'ICONC
- QUIT
- Begin DoDot:1
- +21 SET ICIEN=""
- FOR
- SET ICIEN=$ORDER(^BSTS(9002318.4,"C",36,ICONC,ICIEN))
- IF 'ICIEN
- QUIT
- Begin DoDot:2
- +22 ;
- +23 NEW BSTSUPD,ERROR,NMID
- +24 ;
- +25 ;Quit on partial
- +26 IF $$GET1^DIQ(9002318.4,ICIEN_",",.03,"I")="P"
- QUIT
- +27 ;
- +28 SET NMID=$$GET1^DIQ(9002318.4,"11,",.07,"E")
- +29 IF NMID'=1552
- IF NMID'=36
- QUIT
- +30 ;
- +31 ;Look for IHS PROBLEM ALL SNOMED or RXNO SRCH Drug Ingredients All
- +32 IF NMID=1552
- IF '$DATA(^BSTS(9002318.4,ICIEN,4,"B","RXNO SRCH Drug Ingredients All"))
- QUIT
- +33 IF NMID=36
- IF '$DATA(^BSTS(9002318.4,ICIEN,4,"B","IHS PROBLEM ALL SNOMED"))
- QUIT
- +34 ;
- +35 SET BSTSUPD(9002318.4,ICIEN_",",.15)="Y"
- +36 DO FILE^DIE("","BSTSUPD","ERROR")
- +37 SET CNT=$GET(CNT)+1
- IF CNT#1000=0
- WRITE "."
- End DoDot:2
- End DoDot:1
- +38 ;
- +39 ;Manually update 4 32772 entries
- +40 SET STS=$$DTSLKP^BSTSAPI("VAR","732^32772")
- +41 SET STS=$$DTSLKP^BSTSAPI("VAR","734^32772")
- +42 SET STS=$$DTSLKP^BSTSAPI("VAR","776^32772")
- +43 SET STS=$$DTSLKP^BSTSAPI("VAR","738^32772")
- +44 ;
- +45 ;Unlock installation entry
- +46 LOCK -^TMP("BSTSINSTALL")
- +47 ;
- +48 ;Queue custom codesets
- +49 DO QUEUE^BSTSVOFL(32771)
- +50 DO QUEUE^BSTSVOFL(32772)
- +51 DO QUEUE^BSTSVOFL(32773)
- +52 DO QUEUE^BSTSVOFL(32774)
- +53 DO QUEUE^BSTSVOFL(32775)
- +54 ;
- +55 ;Kick off RxNorm update
- +56 ;Put it on the queue
- DO QUEUE^BSTSVOFL("S1552")
- +57 ;
- +58 ;Kick off update to pull down replacement information
- +59 ;Put it on the queue
- DO QUEUE^BSTSVOFL(32780)
- +60 ;
- +61 ;Kick off now
- DO JOBNOW^BSTSVOFL
- +62 ;
- +63 QUIT
- +64 ;
- 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 SET DIU="^BSTS(9002318.6,"
- SET DIU(0)="DST"
- DO EN^DIU2
- +10 ;
- +11 QUIT
- +12 ;
- 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)