LEXXII2 ;ISL/KER - Lexicon Status (Data Status) ;04/21/2014
;;2.0;LEXICON UTILITY;**59,80**;Sep 23, 1996;Build 10
;
; Global Variables
; ^LEXM( N/A
; ^LEXM(0) N/A
; ^TMP("LEXVER") SACC 2.3.2.5.1
;
; External References
; ^DIM ICR 10016
;
; Variables NEWed or KILLed Elsewhere
; LEXSUB NEWed by LEXXII and LEXXFI sending message
;
Q
RESULTS(X) ; Get Results of Install
D SETUP^LEXXII2 N LEXR S LEXR=$$CHK S X="" S:$L($P(LEXR,"^",2)) X=$P(LEXR,"^",2) K ^TMP("LEXVER",$J)
Q X
SETUP ; Last Set/Kills (Negation)
Q:'$D(^LEXM) Q:+($O(^LEXM(0)))'>0 K ^TMP("LEXVER",$J) N LEXC1,LEXC2,LEXCK,LEXCS,LEXCT,LEXEC,LEXFI,LEXIEN,LEXKK,LEXLK,LEXLS,LEXOK,LEXSAB,LEXSK,LEXSS,LEXT,LEXTT,X
S LEXFI=9999.999 F S LEXFI=$O(^LEXM(LEXFI),-1) Q:+LEXFI=0 D LLF(LEXFI)
S LEXFI=0 F S LEXFI=$O(^LEXM(LEXFI)) Q:+LEXFI'>0 D FIR(LEXFI) Q:$L($G(LEXSK("FIR","SK")))
D VERC
Q
LLF(X) ; Last Set/Last Kill for File X
N LEXFI,LEXIEN,LEXLK,LEXLS,LEXSAB S LEXFI=$G(X),(LEXLS,LEXLK)="" Q:$O(^LEXM(LEXFI,0))'>0
S LEXSAB=$S(+($G(LEXFI))=80:"ICD",+($G(LEXFI))=80.1:"ICP",+($G(LEXFI))=81:"CPT",+($G(LEXFI))=81.3:"CPM",$E(+($G(LEXFI)),1,3)="757"&($E(+($G(LEXFI)),1,5)'="757.9"):"LEX",1:"")
Q:'$L(LEXSAB) Q:$L($G(LEXSK(LEXSAB,"LS")))&($L($G(LEXSK(LEXSAB,"LK")))) S LEXIEN=+($O(^LEXM(LEXFI," "),-1))+1
F S LEXIEN=$O(^LEXM(LEXFI,LEXIEN),-1) Q:+LEXIEN=0 D Q:$L(LEXLS)&($L(LEXLK))
. Q:$G(^LEXM(LEXFI,LEXIEN))["^DD(" Q:+LEXIEN=0
. I $E($G(^LEXM(LEXFI,LEXIEN)),1,3)="S ^",'$L(LEXLS),'$L($G(LEXSK(LEXSAB,"LS"))) D
. . S LEXLS=$G(^LEXM(LEXFI,LEXIEN)) S:'$D(LEXSK(LEXSAB,"LS")) LEXSK(LEXSAB,"LS")=$G(^LEXM(LEXFI,LEXIEN))
. I $E($G(^LEXM(LEXFI,LEXIEN)),1,3)="K ^",'$L(LEXLK),'$L($G(LEXSK(LEXSAB,"LK"))) D
. . S LEXLK=$G(^LEXM(LEXFI,LEXIEN)) S:'$D(LEXSK(LEXSAB,"LK")) LEXSK(LEXSAB,"LK")=$G(^LEXM(LEXFI,LEXIEN))
Q
FIR(X) ; First Set/Kill
N LEXFI,LEXIEN,LEXLK,LEXLS,LEXSAB S LEXFI=$G(X),(LEXLS,LEXLK)="" Q:$O(^LEXM(LEXFI,0))'>0 S LEXSAB="FIR"
Q:$L($G(LEXSK(LEXSAB,"SK"))) S LEXIEN=0 F S LEXIEN=$O(^LEXM(LEXFI,LEXIEN)) Q:+LEXIEN'>0 D Q:$L($G(LEXSK(LEXSAB,"SK")))
. Q:$L($G(LEXSK(LEXSAB,"SK"))) Q:$G(^LEXM(LEXFI,LEXIEN))["^DD("
. I $E($G(^LEXM(LEXFI,LEXIEN)),1,3)="S ^" S:'$D(LEXSK(LEXSAB,"SK")) LEXSK(LEXSAB,"SK")=$G(^LEXM(LEXFI,LEXIEN)) Q
. I $E($G(^LEXM(LEXFI,LEXIEN)),1,3)="K ^" S:'$D(LEXSK(LEXSAB,"SK")) LEXSK(LEXSAB,"SK")=$G(^LEXM(LEXFI,LEXIEN)) Q
Q
VERC ; Verification Check for file
N LEXCK,LEXCS,LEXCT,LEXKK,LEXSS,LEXTT,LEXSAB
N LEXSAB F LEXSAB="LEX","ICD","CPT","CPM","FIR" D
. S (LEXCS,LEXCK,LEXCT)="" S LEXSS=$G(LEXSK(LEXSAB,"LS")),LEXCS=$P(LEXSS,"=",1),LEXCS=$P(LEXCS," ",2,299)
. S LEXKK=$G(LEXSK(LEXSAB,"LK")),LEXCK=$P(LEXKK,"=",1),LEXCK=$P(LEXCK," ",2,299)
. S LEXTT=$G(LEXSK(LEXSAB,"SK")),LEXCT=$P(LEXTT,"=",1),LEXCT=$P(LEXCT," ",2,299)
. D:$L(LEXCS)!($L(LEXCK))!($L(LEXCT)) VERS
Q
VERS ; Verification Strings
Q:'$L(LEXSAB) I $G(LEXSAB)="FIR" D Q
. Q:'$L($G(LEXTT)) Q:'$L($G(LEXCT)) S (LEXC1,LEXC2)="" I $E(LEXTT,1,3)="S ^",LEXTT[LEXCT D
. . S LEXC1="S:"_"$D("_LEXCT_")"_" LEXOK(""FIR"",1)=1" S X=LEXC1 D ^DIM S:'$D(X) LEXC1=""
. . S LEXC2="S:"_"'$D("_LEXCT_")"_" LEXOK(""FIR"",1)=0" S X=LEXC2 D ^DIM S:'$D(X) LEXC2=""
. I $E(LEXTT,1,3)="K ^",LEXTT[LEXCT D
. . S LEXC1="S:"_"'$D("_LEXCT_")"_" LEXOK(""FIR"",1)=1" S X=LEXC1 D ^DIM S:'$D(X) LEXC1=""
. . S LEXC2="S:"_"$D("_LEXCT_")"_" LEXOK(""FIR"")1)=0" S X=LEXC2 D ^DIM S:'$D(X) LEXC2=""
. S:$L(LEXSAB)&($L(LEXC1)) ^TMP("LEXVER",$J,LEXSAB,1)=LEXC1 S:$L(LEXSAB)&($L(LEXC2)) ^TMP("LEXVER",$J,LEXSAB,2)=LEXC2
N LEXC1,LEXC2 S (LEXC1,LEXC2)="" S:$L(LEXCS) LEXC1="$D("_LEXCS_")" S:$L(LEXCK) LEXC2="'$D("_LEXCK_")" Q:'$L(LEXC1)&('$L(LEXC2))
I $L(LEXCS)&($L(LEXCK)) D
. S LEXC1="S:"_"$D("_LEXCS_")"_"&("_"'$D("_LEXCK_")"_") LEXOK("""_LEXSAB_""",2)=1" S X=LEXC1 D ^DIM S:'$D(X) LEXC1=""
. S LEXC2="S:"_"'$D("_LEXCS_")"_"!("_"$D("_LEXCK_")"_") LEXOK("""_LEXSAB_""",3)=0" S X=LEXC2 D ^DIM S:'$D(X) LEXC2=""
I $L(LEXCS)&('$L(LEXCK)) D
. S LEXC1="S:"_"$D("_LEXCS_")"_" LEXOK("""_LEXSAB_""",2)=1" S X=LEXC1 D ^DIM S:'$D(X) LEXC1=""
. S LEXC2="S:"_"'$D("_LEXCS_")"_" LEXOK("""_LEXSAB_""",3)=0" S X=LEXC2 D ^DIM S:'$D(X) LEXC2=""
I '$L(LEXCS)&($L(LEXCK)) D
. S LEXC1="S:"_"'$D("_LEXCK_")"_" LEXOK("""_LEXSAB_""",2)=1" S X=LEXC1 D ^DIM S:'$D(X) LEXC1=""
. S LEXC2="S:"_"$D("_LEXCK_")"_" LEXOK("""_LEXSAB_""",3)=0" S X=LEXC2 D ^DIM S:'$D(X) LEXC2=""
S:$L(LEXSAB)&($L(LEXC1)) ^TMP("LEXVER",$J,LEXSAB,1)=LEXC1 S:$L(LEXSAB)&($L(LEXC2)) ^TMP("LEXVER",$J,LEXSAB,2)=LEXC2
Q
;
CHECK ; Check if Data is installed
N LEXC,LEXEC,LEXFN,LEXOK,LEXSAB,LEXST,LEXT,X S LEXC=$$CHK K ^TMP("LEXVER",$J) Q:'$L($P(LEXC,"^",2))
S LEXT=" Data: "_$P(LEXC,"^",2) D TL(LEXT)
Q
CHK(X) ; Check if Data is Fully Installed
Q:'$D(^TMP("LEXVER",$J)) "" N LEXEC,LEXFN,LEXOK,LEXSAB,LEXST,LEXT S LEXST=0,LEXFN=1,LEXOK("FIR",1)=0 F LEXSAB="LEX","ICD","CPT","CPM" D
. Q:'$D(^TMP("LEXVER",$J,LEXSAB)) S LEXOK(LEXSAB,2)=0,LEXOK(LEXSAB,3)=1
F LEXSAB="FIR","LEX","ICD","CPT","CPM" D
. Q:'$D(^TMP("LEXVER",$J,LEXSAB)) S (LEXEC,X)=$G(^TMP("LEXVER",$J,LEXSAB,1)) D ^DIM X:$D(X) LEXEC
. S (LEXEC,X)=$G(^TMP("LEXVER",$J,LEXSAB,2)) D ^DIM X:$D(X) LEXEC
. Q:LEXSAB="FIR" S:+($G(LEXOK(LEXSAB,2)))'>0 LEXFN=0
S:+($G(LEXOK("FIR",1)))>0 LEXST=1
S:+($G(LEXST))>0&(+($G(LEXFN))>0) X="1^Installation of data completed successfully"
S:+($G(LEXST))>0&(+($G(LEXFN))'>0) X="0^Installation of data started but did not finish (incomplete)"
S:+($G(LEXST))'>0 X="0^Installation of data not started (incomplete)"
S:'$D(^TMP("LEXVER",$J)) X=0
Q X
;
; Miscellaneous
BL ; Blank Line
D TL("") Q
TL(X) ; Text Line
W !,$G(X) Q
S LEXSUB=$G(LEXSUB) S:'$L(LEXSUB) LEXSUB="LEXXII"
I '$D(^TMP(LEXSUB,$J,1)) S ^TMP(LEXSUB,$J,1)=" ",^TMP(LEXSUB,$J,0)=1
N LEXNX S LEXNX=$O(^TMP(LEXSUB,$J," "),-1),LEXNX=LEXNX+1
S ^TMP(LEXSUB,$J,LEXNX)=" "_$G(X),^TMP(LEXSUB,$J,0)=LEXNX
Q
LEXXII2 ;ISL/KER - Lexicon Status (Data Status) ;04/21/2014
+1 ;;2.0;LEXICON UTILITY;**59,80**;Sep 23, 1996;Build 10
+2 ;
+3 ; Global Variables
+4 ; ^LEXM( N/A
+5 ; ^LEXM(0) N/A
+6 ; ^TMP("LEXVER") SACC 2.3.2.5.1
+7 ;
+8 ; External References
+9 ; ^DIM ICR 10016
+10 ;
+11 ; Variables NEWed or KILLed Elsewhere
+12 ; LEXSUB NEWed by LEXXII and LEXXFI sending message
+13 ;
+14 QUIT
RESULTS(X) ; Get Results of Install
+1 DO SETUP^LEXXII2
NEW LEXR
SET LEXR=$$CHK
SET X=""
IF $LENGTH($PIECE(LEXR,"^",2))
SET X=$PIECE(LEXR,"^",2)
KILL ^TMP("LEXVER",$JOB)
+2 QUIT X
SETUP ; Last Set/Kills (Negation)
+1 IF '$DATA(^LEXM)
QUIT
IF +($ORDER(^LEXM(0)))'>0
QUIT
KILL ^TMP("LEXVER",$JOB)
NEW LEXC1,LEXC2,LEXCK,LEXCS,LEXCT,LEXEC,LEXFI,LEXIEN,LEXKK,LEXLK,LEXLS,LEXOK,LEXSAB,LEXSK,LEXSS,LEXT,LEXTT,X
+2 SET LEXFI=9999.999
FOR
SET LEXFI=$ORDER(^LEXM(LEXFI),-1)
IF +LEXFI=0
QUIT
DO LLF(LEXFI)
+3 SET LEXFI=0
FOR
SET LEXFI=$ORDER(^LEXM(LEXFI))
IF +LEXFI'>0
QUIT
DO FIR(LEXFI)
IF $LENGTH($GET(LEXSK("FIR","SK")))
QUIT
+4 DO VERC
+5 QUIT
LLF(X) ; Last Set/Last Kill for File X
+1 NEW LEXFI,LEXIEN,LEXLK,LEXLS,LEXSAB
SET LEXFI=$GET(X)
SET (LEXLS,LEXLK)=""
IF $ORDER(^LEXM(LEXFI,0))'>0
QUIT
+2 SET LEXSAB=$SELECT(+($GET(LEXFI))=80:"ICD",+($GET(LEXFI))=80.1:"ICP",+($GET(LEXFI))=81:"CPT",+($GET(LEXFI))=81.3:"CPM",$EXTRACT(+($GET(LEXFI)),1,3)="757"&($EXTRACT(+($GET(LEXFI)),1,5)'="757.9"):"LEX",1:"")
+3 IF '$LENGTH(LEXSAB)
QUIT
IF $LENGTH($GET(LEXSK(LEXSAB,"LS")))&($LENGTH($GET(LEXSK(LEXSAB,"LK"))))
QUIT
SET LEXIEN=+($ORDER(^LEXM(LEXFI," "),-1))+1
+4 FOR
SET LEXIEN=$ORDER(^LEXM(LEXFI,LEXIEN),-1)
IF +LEXIEN=0
QUIT
Begin DoDot:1
+5 IF $GET(^LEXM(LEXFI,LEXIEN))["^DD("
QUIT
IF +LEXIEN=0
QUIT
+6 IF $EXTRACT($GET(^LEXM(LEXFI,LEXIEN)),1,3)="S ^"
IF '$LENGTH(LEXLS)
IF '$LENGTH($GET(LEXSK(LEXSAB,"LS")))
Begin DoDot:2
+7 SET LEXLS=$GET(^LEXM(LEXFI,LEXIEN))
IF '$DATA(LEXSK(LEXSAB,"LS"))
SET LEXSK(LEXSAB,"LS")=$GET(^LEXM(LEXFI,LEXIEN))
End DoDot:2
+8 IF $EXTRACT($GET(^LEXM(LEXFI,LEXIEN)),1,3)="K ^"
IF '$LENGTH(LEXLK)
IF '$LENGTH($GET(LEXSK(LEXSAB,"LK")))
Begin DoDot:2
+9 SET LEXLK=$GET(^LEXM(LEXFI,LEXIEN))
IF '$DATA(LEXSK(LEXSAB,"LK"))
SET LEXSK(LEXSAB,"LK")=$GET(^LEXM(LEXFI,LEXIEN))
End DoDot:2
End DoDot:1
IF $LENGTH(LEXLS)&($LENGTH(LEXLK))
QUIT
+10 QUIT
FIR(X) ; First Set/Kill
+1 NEW LEXFI,LEXIEN,LEXLK,LEXLS,LEXSAB
SET LEXFI=$GET(X)
SET (LEXLS,LEXLK)=""
IF $ORDER(^LEXM(LEXFI,0))'>0
QUIT
SET LEXSAB="FIR"
+2 IF $LENGTH($GET(LEXSK(LEXSAB,"SK")))
QUIT
SET LEXIEN=0
FOR
SET LEXIEN=$ORDER(^LEXM(LEXFI,LEXIEN))
IF +LEXIEN'>0
QUIT
Begin DoDot:1
+3 IF $LENGTH($GET(LEXSK(LEXSAB,"SK")))
QUIT
IF $GET(^LEXM(LEXFI,LEXIEN))["^DD("
QUIT
+4 IF $EXTRACT($GET(^LEXM(LEXFI,LEXIEN)),1,3)="S ^"
IF '$DATA(LEXSK(LEXSAB,"SK"))
SET LEXSK(LEXSAB,"SK")=$GET(^LEXM(LEXFI,LEXIEN))
QUIT
+5 IF $EXTRACT($GET(^LEXM(LEXFI,LEXIEN)),1,3)="K ^"
IF '$DATA(LEXSK(LEXSAB,"SK"))
SET LEXSK(LEXSAB,"SK")=$GET(^LEXM(LEXFI,LEXIEN))
QUIT
End DoDot:1
IF $LENGTH($GET(LEXSK(LEXSAB,"SK")))
QUIT
+6 QUIT
VERC ; Verification Check for file
+1 NEW LEXCK,LEXCS,LEXCT,LEXKK,LEXSS,LEXTT,LEXSAB
+2 NEW LEXSAB
FOR LEXSAB="LEX","ICD","CPT","CPM","FIR"
Begin DoDot:1
+3 SET (LEXCS,LEXCK,LEXCT)=""
SET LEXSS=$GET(LEXSK(LEXSAB,"LS"))
SET LEXCS=$PIECE(LEXSS,"=",1)
SET LEXCS=$PIECE(LEXCS," ",2,299)
+4 SET LEXKK=$GET(LEXSK(LEXSAB,"LK"))
SET LEXCK=$PIECE(LEXKK,"=",1)
SET LEXCK=$PIECE(LEXCK," ",2,299)
+5 SET LEXTT=$GET(LEXSK(LEXSAB,"SK"))
SET LEXCT=$PIECE(LEXTT,"=",1)
SET LEXCT=$PIECE(LEXCT," ",2,299)
+6 IF $LENGTH(LEXCS)!($LENGTH(LEXCK))!($LENGTH(LEXCT))
DO VERS
End DoDot:1
+7 QUIT
VERS ; Verification Strings
+1 IF '$LENGTH(LEXSAB)
QUIT
IF $GET(LEXSAB)="FIR"
Begin DoDot:1
+2 IF '$LENGTH($GET(LEXTT))
QUIT
IF '$LENGTH($GET(LEXCT))
QUIT
SET (LEXC1,LEXC2)=""
IF $EXTRACT(LEXTT,1,3)="S ^"
IF LEXTT[LEXCT
Begin DoDot:2
+3 SET LEXC1="S:"_"$D("_LEXCT_")"_" LEXOK(""FIR"",1)=1"
SET X=LEXC1
DO ^DIM
IF '$DATA(X)
SET LEXC1=""
+4 SET LEXC2="S:"_"'$D("_LEXCT_")"_" LEXOK(""FIR"",1)=0"
SET X=LEXC2
DO ^DIM
IF '$DATA(X)
SET LEXC2=""
End DoDot:2
+5 IF $EXTRACT(LEXTT,1,3)="K ^"
IF LEXTT[LEXCT
Begin DoDot:2
+6 SET LEXC1="S:"_"'$D("_LEXCT_")"_" LEXOK(""FIR"",1)=1"
SET X=LEXC1
DO ^DIM
IF '$DATA(X)
SET LEXC1=""
+7 SET LEXC2="S:"_"$D("_LEXCT_")"_" LEXOK(""FIR"")1)=0"
SET X=LEXC2
DO ^DIM
IF '$DATA(X)
SET LEXC2=""
End DoDot:2
+8 IF $LENGTH(LEXSAB)&($LENGTH(LEXC1))
SET ^TMP("LEXVER",$JOB,LEXSAB,1)=LEXC1
IF $LENGTH(LEXSAB)&($LENGTH(LEXC2))
SET ^TMP("LEXVER",$JOB,LEXSAB,2)=LEXC2
End DoDot:1
QUIT
+9 NEW LEXC1,LEXC2
SET (LEXC1,LEXC2)=""
IF $LENGTH(LEXCS)
SET LEXC1="$D("_LEXCS_")"
IF $LENGTH(LEXCK)
SET LEXC2="'$D("_LEXCK_")"
IF '$LENGTH(LEXC1)&('$LENGTH(LEXC2))
QUIT
+10 IF $LENGTH(LEXCS)&($LENGTH(LEXCK))
Begin DoDot:1
+11 SET LEXC1="S:"_"$D("_LEXCS_")"_"&("_"'$D("_LEXCK_")"_") LEXOK("""_LEXSAB_""",2)=1"
SET X=LEXC1
DO ^DIM
IF '$DATA(X)
SET LEXC1=""
+12 SET LEXC2="S:"_"'$D("_LEXCS_")"_"!("_"$D("_LEXCK_")"_") LEXOK("""_LEXSAB_""",3)=0"
SET X=LEXC2
DO ^DIM
IF '$DATA(X)
SET LEXC2=""
End DoDot:1
+13 IF $LENGTH(LEXCS)&('$LENGTH(LEXCK))
Begin DoDot:1
+14 SET LEXC1="S:"_"$D("_LEXCS_")"_" LEXOK("""_LEXSAB_""",2)=1"
SET X=LEXC1
DO ^DIM
IF '$DATA(X)
SET LEXC1=""
+15 SET LEXC2="S:"_"'$D("_LEXCS_")"_" LEXOK("""_LEXSAB_""",3)=0"
SET X=LEXC2
DO ^DIM
IF '$DATA(X)
SET LEXC2=""
End DoDot:1
+16 IF '$LENGTH(LEXCS)&($LENGTH(LEXCK))
Begin DoDot:1
+17 SET LEXC1="S:"_"'$D("_LEXCK_")"_" LEXOK("""_LEXSAB_""",2)=1"
SET X=LEXC1
DO ^DIM
IF '$DATA(X)
SET LEXC1=""
+18 SET LEXC2="S:"_"$D("_LEXCK_")"_" LEXOK("""_LEXSAB_""",3)=0"
SET X=LEXC2
DO ^DIM
IF '$DATA(X)
SET LEXC2=""
End DoDot:1
+19 IF $LENGTH(LEXSAB)&($LENGTH(LEXC1))
SET ^TMP("LEXVER",$JOB,LEXSAB,1)=LEXC1
IF $LENGTH(LEXSAB)&($LENGTH(LEXC2))
SET ^TMP("LEXVER",$JOB,LEXSAB,2)=LEXC2
+20 QUIT
+21 ;
CHECK ; Check if Data is installed
+1 NEW LEXC,LEXEC,LEXFN,LEXOK,LEXSAB,LEXST,LEXT,X
SET LEXC=$$CHK
KILL ^TMP("LEXVER",$JOB)
IF '$LENGTH($PIECE(LEXC,"^",2))
QUIT
+2 SET LEXT=" Data: "_$PIECE(LEXC,"^",2)
DO TL(LEXT)
+3 QUIT
CHK(X) ; Check if Data is Fully Installed
+1 IF '$DATA(^TMP("LEXVER",$JOB))
QUIT ""
NEW LEXEC,LEXFN,LEXOK,LEXSAB,LEXST,LEXT
SET LEXST=0
SET LEXFN=1
SET LEXOK("FIR",1)=0
FOR LEXSAB="LEX","ICD","CPT","CPM"
Begin DoDot:1
+2 IF '$DATA(^TMP("LEXVER",$JOB,LEXSAB))
QUIT
SET LEXOK(LEXSAB,2)=0
SET LEXOK(LEXSAB,3)=1
End DoDot:1
+3 FOR LEXSAB="FIR","LEX","ICD","CPT","CPM"
Begin DoDot:1
+4 IF '$DATA(^TMP("LEXVER",$JOB,LEXSAB))
QUIT
SET (LEXEC,X)=$GET(^TMP("LEXVER",$JOB,LEXSAB,1))
DO ^DIM
IF $DATA(X)
XECUTE LEXEC
+5 SET (LEXEC,X)=$GET(^TMP("LEXVER",$JOB,LEXSAB,2))
DO ^DIM
IF $DATA(X)
XECUTE LEXEC
+6 IF LEXSAB="FIR"
QUIT
IF +($GET(LEXOK(LEXSAB,2)))'>0
SET LEXFN=0
End DoDot:1
+7 IF +($GET(LEXOK("FIR",1)))>0
SET LEXST=1
+8 IF +($GET(LEXST))>0&(+($GET(LEXFN))>0)
SET X="1^Installation of data completed successfully"
+9 IF +($GET(LEXST))>0&(+($GET(LEXFN))'>0)
SET X="0^Installation of data started but did not finish (incomplete)"
+10 IF +($GET(LEXST))'>0
SET X="0^Installation of data not started (incomplete)"
+11 IF '$DATA(^TMP("LEXVER",$JOB))
SET X=0
+12 QUIT X
+13 ;
+14 ; Miscellaneous
BL ; Blank Line
+1 DO TL("")
QUIT
TL(X) ; Text Line
+1 WRITE !,$GET(X)
QUIT
+2 SET LEXSUB=$GET(LEXSUB)
IF '$LENGTH(LEXSUB)
SET LEXSUB="LEXXII"
+3 IF '$DATA(^TMP(LEXSUB,$JOB,1))
SET ^TMP(LEXSUB,$JOB,1)=" "
SET ^TMP(LEXSUB,$JOB,0)=1
+4 NEW LEXNX
SET LEXNX=$ORDER(^TMP(LEXSUB,$JOB," "),-1)
SET LEXNX=LEXNX+1
+5 SET ^TMP(LEXSUB,$JOB,LEXNX)=" "_$GET(X)
SET ^TMP(LEXSUB,$JOB,0)=LEXNX
+6 QUIT