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

LEXRXXA.m

Go to the documentation of this file.
  1. LEXRXXA ;ISL/KER - Re-Index Ask ;08/17/2011
  1. ;;2.0;LEXICON UTILITY;**81**;Sep 23, 1996;Build 1
  1. ;
  1. ; Global Variables
  1. ; ^LEX( SACC 1.3
  1. ; ^LEXT( SACC 1.3
  1. ;
  1. ; External References
  1. ; ^DIC ICR 10006
  1. ; ^DIR ICR 10026
  1. ; $$UP^XLFSTR ICR 10104
  1. ;
  1. ; Local Variables NEWed or KILLed Elsewhere
  1. ; LEXFI File Number NEWed/KILLed by ONE^LEXRX
  1. ;
  1. Q
  1. AMSO(X) ; All, Major, Supporting or One File
  1. N LEX,DIR,DTOUT,DUOUT,DIRUT,DIROUT,LEXB,LEXN,Y K LEX
  1. D AMSOF S LEX="" S LEXB=$$BOLD^LEXRXXM,LEXN=$$NORM^LEXRXXM
  1. S DIR(0)="SAO^A:All Lexicon Files;M:Major Lexicon Files"
  1. S DIR(0)=DIR(0)_";S:Supporting Lexicon Files;O:One Lexicon File"
  1. S (DIR("?"),DIR("??"))="^D AMSOH^LEXRXXA"
  1. S DIR("PRE")="S X=$$AMSOP^LEXRXXA($G(X))"
  1. S DIR("A")=" Select "_LEXB_"A"_LEXN_"ll, "_LEXB_"M"_LEXN_"ajor, "
  1. S DIR("A")=DIR("A")_LEXB_"S"_LEXN_"upporting or "_LEXB_"O"_LEXN
  1. S DIR("A")=DIR("A")_"ne Lexicon file(s): (A/M/S/O) "
  1. W ! D ^DIR S X=Y
  1. Q X
  1. AMSOP(X) ; All, Major, Supporting or One File - Pre-process
  1. N Y Q:'$L($G(X)) "" Q:$G(X)["^" "^" S X=$G(X)
  1. S Y=$$UP^XLFSTR($E(X,1)) S:"^A^M^S^O^?^"'[("^"_Y_"^") X="??"
  1. Q X
  1. AMSOH ; All, Major, Supporting or One File - Help
  1. W:$L($G(IOF))&($D(LEX)) @IOF D:$D(LEX) AMSOH2
  1. AMSOF ; All, Major, Supporting or One File - List Files
  1. W:$L($G(IOF))&('$D(LEX)) @IOF
  1. N LEXB,LEXN,LEXC,LEXT,LEXF,LEX1,LEX2,LEX3
  1. S LEXB=$$BOLD^LEXRXXM,LEXN=$$NORM^LEXRXXM
  1. S:'$D(LEX) (LEXB,LEXN)=""
  1. S LEX1=3,LEX2=6,LEX3=24 S:$D(LEX) LEX2=LEX2-1,LEX3=LEX3-1
  1. W !," Repair/Re-Index Lexicon Cross-References",!
  1. S LEXC="",LEXT="",LEXF=""
  1. W !,?LEX1,LEXC,?LEX2,LEXT,?LEX3,LEXF
  1. S LEXC=LEXB_"A"_LEXN
  1. S LEXT="All files"
  1. S LEXF="757*"
  1. W !,?LEX1,LEXC,?LEX2,LEXT,?LEX3,LEXF
  1. S LEXC="",LEXT="",LEXF=""
  1. S LEXC=LEXB_"M"_LEXN
  1. S LEXT="Major files"
  1. S LEXF="757, 757.001, 757.01, 757.02, 757.1, 757.21 and 757.33"
  1. W !,?LEX1,LEXC,?LEX2,LEXT,?LEX3,LEXF
  1. S LEXC="",LEXT="",LEXF=""
  1. S LEXC=LEXB_"S"_LEXN
  1. S LEXT="Supporting files"
  1. S LEXF="757.011, 757.014, 757.03, 757.04, 757.05, 757.06,"
  1. W !,?LEX1,LEXC,?LEX2,LEXT,?LEX3,LEXF
  1. S LEXC=LEXB_" "_LEXN
  1. S LEXT=""
  1. S LEXF="757.11, 757.12, 757.13, 757.14, 757.2, 757.3,"
  1. W !,?LEX1,LEXC,?LEX2,LEXT,?LEX3,LEXF
  1. S LEXC=LEXB_" "_LEXN
  1. S LEXT=""
  1. S LEXF="757.31, 757.4 and 757.41"
  1. W !,?LEX1,LEXC,?LEX2,LEXT,?LEX3,LEXF
  1. S LEXC="",LEXT="",LEXF=""
  1. S LEXC=LEXB_"O"_LEXN
  1. S LEXT="One file"
  1. S LEXF="Select a single Lexicon file"
  1. W !,?LEX1,LEXC,?LEX2,LEXT,?LEX3,LEXF
  1. Q
  1. AMSOH2 ; All, Major, Supporting or One File - Help
  1. N LEXB,LEXN S LEXB=$$BOLD^LEXRXXM,LEXN=$$NORM^LEXRXXM
  1. W !," The cross-references of the Major (larger) files"
  1. W " involved with the"
  1. W !," Lexicon Lookup will be repaired. During the repair"
  1. W " process the "
  1. W !," cross-references are not deleted. Only those cross-"
  1. W "reference nodes "
  1. W !," that fail verification will be deleted. The Supporting"
  1. W " (smaller) files",!," will be re-indexed.",!,?1," "
  1. W !,?1,LEXB,"Users may remain on the system.",LEXN
  1. W !,?1," "
  1. Q
  1. ;
  1. CO(X) ; Ask to Continue
  1. S LEXTY=$G(LEXTY) N DIR,DTOUT,DUOUT,DIRUT,DIROUT,Y
  1. S DIR(0)="YAO",(DIR("?"),DIR("??"))="^D COH^LEXRXXA"
  1. S DIR("A")=" Do you wish to continue? (Y/N) "
  1. S DIR("PRE")="S:X[""?"" X=""??""" W ! D ^DIR
  1. S X=+Y S:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!($D(DIROUT)) X="^"
  1. N LEXTY
  1. Q X
  1. COH ; Continue Help
  1. N LEXFN,LEXAC S LEXAC="repair/re-index"
  1. S:+($G(LEXTY))=1 LEXAC="repair" S:+($G(LEXTY))=2 LEXAC="re-index"
  1. I +($G(LEXTY))'>0 D
  1. . W !," Answer 'Yes' to ",LEXAC," the Lexicon's cross-references"
  1. I +($G(LEXTY))=1&(+($G(LEXFI))'>0) D
  1. . W !," Answer 'Yes' to ",LEXAC," the Lexicon's cross-references"
  1. . W " of the",!," larger files"
  1. I +($G(LEXTY))=2&(+($G(LEXFI))'>0) D
  1. . W !," Answer 'Yes' to ",LEXAC," the Lexicon's cross-references"
  1. . W " of the",!," smaller files"
  1. I +($G(LEXTY))=3&(+($G(LEXFI))'>0) D
  1. . W !," Answer 'Yes' to ",LEXAC," the cross-references of all"
  1. . W !," of the Lexicon's files"
  1. I +($G(LEXTY))>0&(+($G(LEXFI))>0) D
  1. . I $D(^LEX(+($G(LEXFI))))!($D(^LEXT(+($G(LEXFI))))) D Q
  1. . . N LEXFN S LEXFN=$$FN^LEXRXXM(+($G(LEXFI)))
  1. . . I $L($G(LEXFN))&(+($G(LEXFI))>0) D
  1. . . . W !," Answer 'Yes' to ",LEXAC," the cross-references of "
  1. . . . W "the ",LEXFN,!," file #",$G(LEXFI)
  1. . . I '$L($G(LEXFN))&(+($G(LEXFI))>0) D
  1. . . . W !," Answer 'Yes' to ",LEXAC," the cross-references of "
  1. . . . W "file #",$G(LEXFI)
  1. . W !," Answer 'Yes' to ",LEXAC," the cross-references of "
  1. . W "the file(s)"
  1. Q
  1. ;
  1. FI(X) ; Select File
  1. N DIC,DTOUT,DUOUT,Y,LEX S DIC="^DIC(",DIC(0)="AEMQ"
  1. S DIC("A")=" Select Lexicon File: "
  1. S DIC("S")="I +($$FV^LEXRXXM(+Y))>0"
  1. W ! D ^DIC K DIC("S") S LEX=+($$FV^LEXRXXM(+Y))
  1. Q:$D(DTOUT)!($D(DUOUT)) "^" S X=+Y Q:LEX>0 X
  1. Q "^"
  1. ;
  1. ; Miscellaneous
  1. CLR ; Clear
  1. K LEXFI
  1. Q