LEX2051P ;ISL/FJF - Pre/Post Install ; 30 Aug 2011 11:25 PM
;;2.0;LEXICON UTILITY;**51**;Sep 23, 1996;Build 10
;
; External References
; DBIA 10086 HOME^%ZIS
; DBIA 2052 $$GET1^DID
; DBIA 2055 PRD^DILFD
; DBIA 10014 EN^DIU2
; DBIA 10141 BMES^XPDUTL
; DBIA 10141 MES^XPDUTL
; DBIA 10013 ^DIK
;
Q
;
POST ; LEX*2.0*51 Post-Install
N LEXEDT,LEXMUMPS
S LEXEDT=$G(^LEXM(0,"CREATED"))
;
;-----------------------------
; Save Changes
D SCHG
;
;-----------------------------
; Load Data into Files
D LOAD
;
;-----------------------------
; Data Conversion
D CON
;
;-----------------------------
; Re-Index Files
D IND
;
;-----------------------------
; Send a Install Message
D MSG
;
Q
;-----------------------------
;
LOAD ; Load Data
;
; LEXSHORT Send Short Message
; LEXMSG Flag to send Message
;
N LEXSHORT,LEXMSG,LEXB,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF
S LEXSHORT="",LEXMSG=""
D IMP^LEX2051
S U="^",LEXB=$G(^LEXM(0,"BUILD")) Q:LEXB="" Q:$G(LEXBUILD)=""
D:LEXB=LEXBUILD EN^LEXXGI
LQ ; Load Quit
D KLEXM
Q
;
MSG ; Send Installation Message to G.LEXICON
Q:+($G(DUZ))=0!($$NOTDEF^LEX2051($G(DUZ)))
D HOME^%ZIS
N DIFROM,LEXLREV,LEXLAST,LEXBUILD,LEXIGHF,LEXSHORT
S LEXSHORT=1
D IMP^LEX2051 ;,POST^LEXXFI
Q
;
SCHG ; Save Change File Changes
N LEXI,LEXFI,LEXFIL,LEXRT
S LEXFI=0 F S LEXFI=$O(^LEXM(LEXFI)) Q:+LEXFI=0 D
.S LEXI=0 F S LEXI=$O(^LEXM(LEXFI,LEXI)) Q:+LEXI=0 D
..N LEXCF,LEXIEN,LEXMUMPS
..S LEXMUMPS=$G(^LEXM(LEXFI,LEXI)),LEXRT=$P(LEXMUMPS,"^",2)
..S:LEXMUMPS["^LEX("!(LEXMUMPS["^LEXT(") LEXFIL=+($P(LEXRT,"(",2))
Q
;
KLEXM ; Subscripted Kill of ^LEXM
N DA S DA=0 F S DA=$O(^LEXM(DA)) Q:+DA=0 K ^LEXM(DA)
K ^LEXM(0)
Q
PRE ; LEX*2.0*51 Pre-Install
; Kill all cross-references
N DIK S DIK="^LEX(757.33," D IXALL2^DIK
; Delete the old DD
N DIU S DIU="^LEX(757.33,",DIU(0)="T" D EN^DIU2
Q
;
CON ; Conversion of data
N LEXLOUD S LEXLOUD="" D:$L($T(AWRD^LEXXGI4)) AWRD^LEXXGI4
Q
IND ; Rebuild indices
; Rebuild indices for 757.33
N DIK
D BMES^XPDUTL("Rebuilding indices")
D BMES^XPDUTL("")
S DIK="^LEX(757.33," D IXALL^DIK
D BMES^XPDUTL("Index rebuild complete")
Q
LEX2051P ;ISL/FJF - Pre/Post Install ; 30 Aug 2011 11:25 PM
+1 ;;2.0;LEXICON UTILITY;**51**;Sep 23, 1996;Build 10
+2 ;
+3 ; External References
+4 ; DBIA 10086 HOME^%ZIS
+5 ; DBIA 2052 $$GET1^DID
+6 ; DBIA 2055 PRD^DILFD
+7 ; DBIA 10014 EN^DIU2
+8 ; DBIA 10141 BMES^XPDUTL
+9 ; DBIA 10141 MES^XPDUTL
+10 ; DBIA 10013 ^DIK
+11 ;
+12 QUIT
+13 ;
POST ; LEX*2.0*51 Post-Install
+1 NEW LEXEDT,LEXMUMPS
+2 SET LEXEDT=$GET(^LEXM(0,"CREATED"))
+3 ;
+4 ;-----------------------------
+5 ; Save Changes
+6 DO SCHG
+7 ;
+8 ;-----------------------------
+9 ; Load Data into Files
+10 DO LOAD
+11 ;
+12 ;-----------------------------
+13 ; Data Conversion
+14 DO CON
+15 ;
+16 ;-----------------------------
+17 ; Re-Index Files
+18 DO IND
+19 ;
+20 ;-----------------------------
+21 ; Send a Install Message
+22 DO MSG
+23 ;
+24 QUIT
+25 ;-----------------------------
+26 ;
LOAD ; Load Data
+1 ;
+2 ; LEXSHORT Send Short Message
+3 ; LEXMSG Flag to send Message
+4 ;
+5 NEW LEXSHORT,LEXMSG,LEXB,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF
+6 SET LEXSHORT=""
SET LEXMSG=""
+7 DO IMP^LEX2051
+8 SET U="^"
SET LEXB=$GET(^LEXM(0,"BUILD"))
IF LEXB=""
QUIT
IF $GET(LEXBUILD)=""
QUIT
+9 IF LEXB=LEXBUILD
DO EN^LEXXGI
LQ ; Load Quit
+1 DO KLEXM
+2 QUIT
+3 ;
MSG ; Send Installation Message to G.LEXICON
+1 IF +($GET(DUZ))=0!($$NOTDEF^LEX2051($GET(DUZ)))
QUIT
+2 DO HOME^%ZIS
+3 NEW DIFROM,LEXLREV,LEXLAST,LEXBUILD,LEXIGHF,LEXSHORT
+4 SET LEXSHORT=1
+5 ;,POST^LEXXFI
DO IMP^LEX2051
+6 QUIT
+7 ;
SCHG ; Save Change File Changes
+1 NEW LEXI,LEXFI,LEXFIL,LEXRT
+2 SET LEXFI=0
FOR
SET LEXFI=$ORDER(^LEXM(LEXFI))
IF +LEXFI=0
QUIT
Begin DoDot:1
+3 SET LEXI=0
FOR
SET LEXI=$ORDER(^LEXM(LEXFI,LEXI))
IF +LEXI=0
QUIT
Begin DoDot:2
+4 NEW LEXCF,LEXIEN,LEXMUMPS
+5 SET LEXMUMPS=$GET(^LEXM(LEXFI,LEXI))
SET LEXRT=$PIECE(LEXMUMPS,"^",2)
+6 IF LEXMUMPS["^LEX("!(LEXMUMPS["^LEXT(")
SET LEXFIL=+($PIECE(LEXRT,"(",2))
End DoDot:2
End DoDot:1
+7 QUIT
+8 ;
KLEXM ; Subscripted Kill of ^LEXM
+1 NEW DA
SET DA=0
FOR
SET DA=$ORDER(^LEXM(DA))
IF +DA=0
QUIT
KILL ^LEXM(DA)
+2 KILL ^LEXM(0)
+3 QUIT
PRE ; LEX*2.0*51 Pre-Install
+1 ; Kill all cross-references
+2 NEW DIK
SET DIK="^LEX(757.33,"
DO IXALL2^DIK
+3 ; Delete the old DD
+4 NEW DIU
SET DIU="^LEX(757.33,"
SET DIU(0)="T"
DO EN^DIU2
+5 QUIT
+6 ;
CON ; Conversion of data
+1 NEW LEXLOUD
SET LEXLOUD=""
IF $LENGTH($TEXT(AWRD^LEXXGI4))
DO AWRD^LEXXGI4
+2 QUIT
IND ; Rebuild indices
+1 ; Rebuild indices for 757.33
+2 NEW DIK
+3 DO BMES^XPDUTL("Rebuilding indices")
+4 DO BMES^XPDUTL("")
+5 SET DIK="^LEX(757.33,"
DO IXALL^DIK
+6 DO BMES^XPDUTL("Index rebuild complete")
+7 QUIT