Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BSTS10P7

BSTS10P7.m

Go to the documentation of this file.
  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
  1. ;
  1. ENV ;EP - Environmental Checking Routine
  1. ;
  1. N VERSION,EXEC,BMWDT
  1. ;
  1. ;Check for BSTS*1.0*6
  1. I '$$INSTALLD("BSTS*1.0*6") D BMES^XPDUTL("Version 1.0 Patch 6 of BSTS is required!") S XPDQUIT=2 Q
  1. ;
  1. ;Make sure a refresh is not running already
  1. 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
  1. L -^BSTS(9002318.1,0)
  1. ;
  1. ;Make sure an Description Id fix compile isn't running
  1. L +^XTMP("BSTSCFIX"):0 E D BMES^XPDUTL("A Description Id Population Utility Process is Running. Please Try later") S XPDQUIT=2 Q
  1. L -^XTMP("BSTSCFIX")
  1. ;
  1. ;Make sure an ICD9 to SNOMED compile isn't running
  1. L +^TMP("BSTSICD2SMD"):0 E D BMES^XPDUTL("An ICD9 to SNOMED Background Compile is Running. Please Try later") S XPDQUIT=2 Q
  1. L -^TMP("BSTSICD2SMD")
  1. ;
  1. ;Make sure another install isn't running
  1. L +^TMP("BSTSINSTALL"):3 E D BMES^XPDUTL("A BSTS Install is Already Running") S XPDQUIT=2 Q
  1. L -^TMP("BSTSINSTALL")
  1. ;
  1. Q
  1. ;
  1. EN ;EP
  1. ;
  1. ;Load the classes
  1. ;
  1. N TRIEN,EXEC,ERR,X,VAR
  1. ;
  1. ;For each build, set this to the 9002318.5 entry to load
  1. S TRIEN=1
  1. ;
  1. ;Delete existing BSTS Classes
  1. S EXEC="DO $SYSTEM.OBJ.DeletePackage(""BSTS"")" X EXEC
  1. ;
  1. ; Import BSTS classes
  1. K ERR
  1. I $G(TRIEN)'="" D IMPORT^BSTSCLAS(TRIEN,.ERR)
  1. I $G(ERR) Q
  1. ;
  1. ;Unlock installation entry
  1. L -^TMP("BSTSINSTALL")
  1. ;
  1. ;Pull the namespace and version
  1. S X=$$CODESETS^BSTSAPI("VAR")
  1. S X=$$VERSIONS^BSTSAPI("VAR",32779)
  1. S X=$$VERSIONS^BSTSAPI("VAR",32780)
  1. ;
  1. ;Fix 32772 Codeset and schedule refresh
  1. D 32772
  1. ;
  1. ;Kick off the Equivalency update
  1. ;Needed in order to pull down conditional mappings and concept default statuses
  1. D QUEUE^BSTSVOFL(32780) ;Put it on the queue
  1. D JOBNOW^BSTSVOFL ;Kick off now
  1. ;
  1. Q
  1. ;
  1. 32772 ;EP - Fix 32772 entries and kick off process
  1. ;
  1. NEW CONC,CIEN
  1. ;
  1. 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
  1. . ;
  1. . NEW DTSID,DA,DIK,TIEN
  1. . ;
  1. . S DTSID=$$GET1^DIQ(9002318.4,CIEN_",",.08,"I")
  1. . ;
  1. . ;Skip valid ones
  1. . I DTSID>570,DTSID<1147 Q
  1. . ;
  1. . ;Remove codeset entry
  1. . S DA=CIEN,DIK="^BSTS(9002318.4," D ^DIK
  1. . ;
  1. . ;Remove terms
  1. . S TIEN="" F S TIEN=$O(^BSTS(9002318.3,"C",32772,CIEN,TIEN)) Q:TIEN="" D
  1. .. NEW DA,DIK
  1. .. S DA=TIEN,DIK="^BSTS(9002318.3," D ^DIK
  1. ;
  1. ;Put 32772 refresh task on queue
  1. D QUEUE^BSTSVOFL(32772)
  1. ;
  1. Q
  1. ;
  1. PRE ;Pre-Install Front End
  1. ;
  1. ;Perform Lock so only one install can run and DTS calls will be switched to local
  1. L +^TMP("BSTSINSTALL"):3 E D BMES^XPDUTL("A BSTS Install is Already Running - Aborting Installation") S XPDABORT=1 Q
  1. ;
  1. N DIU
  1. ;
  1. ;Clear out existing transport global and new conversion file
  1. S DIU="^BSTSCLS(",DIU(0)="DST" D EN^DIU2
  1. ;
  1. Q
  1. ;
  1. INSTALLD(BSTSSTAL) ;EP - Determine if patch BSTSSTAL was installed, where
  1. ; BSTSSTAL is the name of the INSTALL. E.g "BSTS*1.0*1".
  1. ;
  1. NEW DIC,X,Y,D
  1. S X=$P(BSTSSTAL,"*",1)
  1. S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
  1. D IX^DIC
  1. I Y<1 Q 0
  1. S DIC=DIC_+Y_",22,",X=$P(BSTSSTAL,"*",2)
  1. D ^DIC
  1. I Y<1 Q 0
  1. S DIC=DIC_+Y_",""PAH"",",X=$P(BSTSSTAL,"*",3)
  1. D ^DIC
  1. Q $S(Y<1:0,1:1)