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

LEXRXXT2.m

Go to the documentation of this file.
LEXRXXT2 ;ISL/KER - Repair/Re-Index - Task (cont) ;08/17/2011
 ;;2.0;LEXICON UTILITY;**81**;Sep 23, 1996;Build 10
 ;               
 ; Global Variables
 ;    ^LEX(               SACC 1.3
 ;    ^LEXT(              SACC 1.3
 ;    ^TMP("LEXRX")       SACC 2.3.2.5.1
 ;    ^XTMP("LEXRX")      SACC 2.3.2.5.2
 ;               
 ; External References
 ;    None
 ;               
 ; Local Variables NEWed or KILLed Elsewhere
 ;     LEXFI      File number     NEWed/KILLed by LEXRX
 ;     ZTQUEUED   Task flag       NEWed/KILLed by Taskman
 ;     ZTREQ      Task Request    NEWed/KILLed by Taskman
 ;     ZTSK       Task Number     NEWed/KILLed by Taskman
 ;               
 Q
ALLT ; - Tasked Repair/Re-Index all Lexicon Files
 K ^TMP("LEXRX",$J)
 N LEXDES,LEXNAM,LEXFMT,LEXS,LEXT,LEXTC,LEXTSK,LEXSUBJ,LEXSET
 S (LEXSUBJ,LEXT)="Repair/re-index all of the Lexicon files"
 S LEXSET="",LEXNAM="LEXRXALL"
 S LEXTC=$$UPD^LEXRXXT3(LEXNAM,LEXT) G:+LEXTC=1 ET
 S LEXFMT=3,LEXTSK=0
 S:+($G(ZTSK))>0 LEXTSK=+ZTSK
 D BEG^LEXRXXM,EN^LEXRXA,EN^LEXRXB,EN^LEXRXC,EN^LEXRXD
 D EN^LEXRXE,EN^LEXRXF,EN^LEXRXG,EN^LEXRXS,END^LEXRXXM
 D SEND^LEXRXXS,PRG
 G ET
 Q
MAJT ; - Tasked Repair all Lookup Related Lexicon Files
 K ^TMP("LEXRX",$J)
 N LEXDES,LEXNAM,LEXFMT,LEXS,LEXT,LEXTC,LEXTSK,LEXSUBJ,LEXSET
 S (LEXSUBJ,LEXT)="Repair the major Lexicon files"
 S LEXSET="",LEXNAM="LEXRXMAJ"
 S LEXTC=$$UPD^LEXRXXT3(LEXNAM,LEXT) G:+LEXTC=1 ET
 S LEXFMT=1,LEXTSK=0
 S:+($G(ZTSK))>0 LEXTSK=+ZTSK
 D BEG^LEXRXXM,EN^LEXRXA,EN^LEXRXB,EN^LEXRXC,EN^LEXRXD
 D EN^LEXRXE,EN^LEXRXF,EN^LEXRXG,END^LEXRXXM
 D SEND^LEXRXXS,PRG S LEXTC=$$UPD^LEXRXXT3(LEXNAM)
 G ET
 Q
SUPT ; - Tasked Re-Index all Supporting Lexicon Files
 K ^TMP("LEXRX",$J)
 N LEXDES,LEXNAM,LEXFMT,LEXS,LEXT,LEXTC,LEXTSK,LEXSUBJ,LEXSET
 S (LEXSUBJ,LEXT)="Re-indexing the supporting Lexicon files"
 S LEXSET="",LEXNAM="LEXRXSUP"
 S LEXTC=$$UPD^LEXRXXT3(LEXNAM,LEXT) G:+LEXTC=1 ET
 S LEXFMT=2,LEXTSK=0
 S:+($G(ZTSK))>0 LEXTSK=+ZTSK
 D BEG^LEXRXXM,EN^LEXRXS,END^LEXRXXM
 D SEND^LEXRXXS,PRG S LEXTC=$$UPD^LEXRXXT3(LEXNAM)
 G ET
 Q
ONET ; - Tasked Repair/Re-Index one file
 K ^TMP("LEXRX",$J)
 N LEXDES,LEXNAM,LEXFMT,LEXS,LEXT,LEXTC,LEXTY,LEXTSK,LEXFN
 N LEXSUBJ,LEXSET S LEXFI=+($G(LEXFI)) G:LEXFI'>0 ET
 G:$E(LEXFI,1,3)'=757 ET G:'$D(^LEX(+LEXFI))&('$D(^LEXT(+LEXFI))) ET
 S LEXFN=$$FN^LEXRXXM(LEXFI) G:'$L(LEXFN) ET S LEXTY=""
 S:"^757^757.001^757.01^757.02^757.1^757.21^757.33^"[("^"_LEXFI_"^") LEXTY="Repair",LEXFMT=1
 S:'$L(LEXTY) LEXTY="Re-Index",LEXFMT=2
 S LEXT=LEXTY,LEXT=LEXT_" the "_LEXFN_" file #"_LEXFI
 S LEXSET="",LEXSUBJ=LEXT,LEXNAM="LEXRXONE"
 S LEXTC=$$UPD^LEXRXXT3(LEXNAM,LEXT) G:+LEXTC=1 ET
 S LEXFMT=2,LEXTSK=0 S:+($G(ZTSK))>0 LEXTSK=+ZTSK
 I LEXFI>0 D
 . N LEXTAG,LEXENT S LEXTAG="R"_$TR(LEXFI,".","")
 . S LEXENT=$T(@LEXTAG) Q:'$L(LEXENT)
 . K LEXQ D BEG^LEXRXXM,@LEXTAG,END^LEXRXXM,SEND^LEXRXXS
 D PRG S LEXTC=$$UPD^LEXRXXT3(LEXNAM)
 G ET
 Q
SET ; - Tasked Set Logic Only
 K ^TMP("LEXRX",$J)
 N LEXDES,LEXNAM,LEXFMT,LEXS,LEXT,LEXTC,LEXTY,LEXTSK,LEXFN
 N LEXSUBJ,LEXSET,LEXFIX,LEXQ S LEXQ="" S LEXFI=+($G(LEXFI)) G:LEXFI'>0 ET
 G:$E(LEXFI,1,3)'=757 ET G:'$D(^LEX(+LEXFI))&('$D(^LEXT(+LEXFI))) ET
 S LEXFN=$$FN^LEXRXXM(LEXFI) G:'$L(LEXFN) ET
 S LEXT="Re-Index file #"_LEXFI_", Set Logic Only"
 S LEXSET="",LEXSUBJ=LEXT,LEXNAM="LEXRXSET"
 S LEXTSK=0 S:+($G(ZTSK))>0 LEXTSK=+ZTSK
 I LEXFI>0 D
 . N LEXTAG,LEXENT,LEXSET
 . S LEXTAG="S"_$TR(LEXFI,".",""),LEXENT=$T(@LEXTAG)
 . I '$L(LEXENT) S LEXTAG="R"_$TR(LEXFI,".",""),LEXENT=$T(@LEXTAG)
 . Q:'$L(LEXENT)  K LEXFIX S LEXSET="",LEXQ="" D @LEXTAG
 K ^TMP("LEXRX",$J),^XTMP(LEXNAM)
 G ET
 Q
FIX ; - Tasked Set Logic Only with Fix
 K ^TMP("LEXRX",$J)
 N LEXDES,LEXNAM,LEXFMT,LEXS,LEXT,LEXTC,LEXTY,LEXTSK,LEXFN
 N LEXSUBJ,LEXSET,LEXFIX,LEXQ S LEXQ="" S LEXFI=+($G(LEXFI)) G:LEXFI'>0 ET
 G:$E(LEXFI,1,3)'=757 ET G:'$D(^LEX(+LEXFI))&('$D(^LEXT(+LEXFI))) ET
 Q:"^757.001^757.21^757.33^"'[("^"_LEXFI_"^")
 S LEXFN=$$FN^LEXRXXM(LEXFI) G:'$L(LEXFN) ET
 S LEXT="Fix/Re-Index file #"_LEXFI_", Set Logic Only"
 S LEXSET="",LEXSUBJ=LEXT,LEXNAM="LEXRXFIX"
 S LEXTSK=0 S:+($G(ZTSK))>0 LEXTSK=+ZTSK
 I LEXFI>0 D
 . N LEXTAG,LEXENT
 . S LEXTAG="F"_$TR(LEXFI,".",""),LEXENT=$T(@LEXTAG)
 . Q:'$L(LEXENT)  K LEXFIX S LEXSET="",LEXQ="" D @LEXTAG
 K ^TMP("LEXRX",$J),^XTMP(LEXNAM)
 G ET
 Q
 ;
R ; Repair/Re-index
R757 ;   File #757
 N LEXSET S LEXSET="" K LEXQ D R757^LEXRXA Q
R757001 ;   File #757.001
 N LEXSET S LEXSET="" K LEXQ D R757001^LEXRXB Q
R75701 ;   File #757.01
 N LEXSET S LEXSET="" K LEXQ D R75701^LEXRXC Q
R75702 ;   File #757.02
 N LEXSET S LEXSET="" K LEXQ D R75702^LEXRXD Q
R7571 ;   File #757.1
 N LEXSET S LEXSET="" K LEXQ D R7571^LEXRXE Q
R75721 ;   File #757.21
 N LEXSET S LEXSET="" K LEXQ D R75721^LEXRXF Q
R75733 ;   File #757.33
 N LEXSET S LEXSET="" K LEXQ D R75733^LEXRXG Q
R757011 ;   File #757.011
 D R757011^LEXRXS Q
R757014 ;   File #757.014
 D R757014^LEXRXS Q
R75703 ;   File #757.03
 D R75703^LEXRXS Q
R75704 ;   File #757.04
 D R75704^LEXRXS Q
R75705 ;   File #757.05
 D R75705^LEXRXS Q
R75706 ;   File #757.06
 D R75706^LEXRXS Q
R75711 ;   File #757.11
 D R75711^LEXRXS Q
R75712 ;   File #757.12
 D R75712^LEXRXS Q
R75713 ;   File #757.13
 D R75713^LEXRXS2 Q
R75714 ;   File #757.14
 D R75714^LEXRXS2 Q
R7573 ;   File #757.3
 D R7573^LEXRXS2 Q
R75731 ;   File #757.31
 D R75731^LEXRXS2 Q
R75732 ;   File #757.32
 D R75732^LEXRXS2 Q
R7574 ;   File #757.4
 D R7574^LEXRXS2 Q
R75741 ;   File #757.41
 D R75741^LEXRXS2 Q
R7572 ;   File #757.2
 D R7572^LEXRXS2 Q
 ;
S ; Set Logic Only
S757 ;   File #757
 N LEXSET,LEXQ S (LEXSET,LEXQ)="" D SET^LEXRXA Q
S757001 ;   File #757.001
 N LEXSET,LEXQ S (LEXSET,LEXQ)="" D SET^LEXRXB Q
S75701 ;   File #757.01
 N LEXSET,LEXQ S (LEXSET,LEXQ)="" D SET^LEXRXC Q
S75702 ;   File #757.02
 N LEXSET,LEXQ S (LEXSET,LEXQ)="" D SET^LEXRXD Q
S7571 ;   File #757.1
 N LEXSET,LEXQ S (LEXSET,LEXQ)="" D SET^LEXRXE Q
S75721 ;   File #757.21
 N LEXSET,LEXQ S (LEXSET,LEXQ)="" D SET^LEXRXF Q
S75733 ;   File #757.33
 N LEXSET,LEXQ S (LEXSET,LEXQ)="" D SET^LEXRXG Q
 ;
F ; Repair/Re-index/Fixi
F757001 ;   File #757.001
 N LEXSET,LEXFIX,LEXQ S (LEXSET,LEXFIX,LEXQ)="" D SET^LEXRXB Q
F75721 ;   File #757.21
 N LEXSET,LEXFIX,LEXQ S (LEXSET,LEXFIX,LEXQ)="" D SET^LEXRXF Q
F75733 ;   File #757.33
 N LEXSET,LEXFIX,LEXQ S (LEXSET,LEXFIX,LEXQ)="" D SET^LEXRXG Q
 ;              
 ; Miscellaneous
ET ;   End Task
 S:$D(ZTQUEUED) ZTREQ="@"
 Q
PRG ;   Purge
 K ^TMP("LEXRX",$J,"D"),^TMP("LEXRX",$J,"E"),^TMP("LEXRX",$J,"R",1),^TMP("LEXRX",$J,"R",2)
 K ^TMP("LEXRX",$J,"T"),^TMP("LEXRX",$J,"P") K ^XTMP(LEXNAM)
 Q
SX(LEXNAM) ;   Show XTMP
 S LEXNAM=$G(LEXNAM) Q:'$L(LEXNAM)
 N LEXNN,LEXNC S LEXNN="^XTMP("""_LEXNAM_""")",LEXNC="^XTMP("""_LEXNAM_""","
 F  S LEXNN=$Q(@LEXNN)  Q:'$L(LEXNN)!(LEXNN'[LEXNC)  W !,LEXNN,"=",@LEXNN
 Q
CLR ;   Clear
 K LEXFI,ZTQUEUED,ZTREQ,ZTSK
 Q