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

LEXRXS.m

Go to the documentation of this file.
LEXRXS ;ISL/KER - Re-Index - Small Files ;05/23/2017
 ;;2.0;LEXICON UTILITY;**81,103**;Sep 23, 1996;Build 2
 ;               
 ; Global Variables
 ;    ^LEX(               SACC 1.3
 ;    ^LEXT(              SACC 1.3
 ;    ^LEX(757.011,       SACC 1.3
 ;    ^LEX(757.014,       SACC 1.3
 ;    ^LEX(757.03,        SACC 1.3
 ;    ^LEX(757.04,        SACC 1.3
 ;    ^LEX(757.05,        SACC 1.3
 ;    ^LEX(757.06,        SACC 1.3
 ;    ^LEX(757.11,        SACC 1.3
 ;    ^LEX(757.12,        SACC 1.3
 ;    ^LEX(757.01,        SACC 1.3
 ;    ^LEXT(757.2,        SACC 1.3
 ;    ^TMP("LEXRX")       SACC 2.3.2.5.1
 ;               
 ; External References
 ;    FILE^DID            ICR  2052
 ;    IX1^DIK             ICR  10013
 ;    $$FMDIFF^XLFDT      ICR  10103
 ;    $$NOW^XLFDT         ICR  10103
 ;               
 ; Local Variables NEWed or KILLed Elsewhere
 ;     LEXLONG    Format flag     NEWed/KILLed by Developer
 ;     LEXNAM     Task name       NEWed/KILLed by LEXRXXT
 ;     ZTQUEUED   Task flag       NEWed/KILLed by Taskman
 ;               
EN ; Main Entry Point
 D R757011,R757014,R75703,R75704,R75705,R75706,R75707,R757071,R75711,R75712,EN^LEXRXS2
 Q
R757011 ;   Expression Type file 757.011
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP,LEXNM
 S LEXFI="757.011" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="B and C",LEXNM="Expression Type" I $D(LEXLONG) S LEXIX(1)="^LEX(757.011,""B"",TYPE,IEN)",LEXIX(2)="^LEX(757.011,""C"",UPPER,IEN)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(LEXFI,LEXNM,"00:00:01",.LEXIX)
 Q
R757014 ;   Expression Form file 757.014
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP,LEXNM
 S LEXFI="757.014" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="B",LEXNM="Expression Form" I $D(LEXLONG) S LEXIX(1)="^LEX(757.014,""B"",MNEM,IEN)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(LEXFI,LEXNM,"00:00:01",.LEXIX)
 Q
R75703 ;   Coding System file 757.03
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP
 S LEXFI="757.03" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="B, ASAB, C and D",LEXNM="Coding Systems" I $D(LEXLONG) D
 . S LEXIX(1)="^LEX(757.03,""B"",SAB,IEN)",LEXIX(2)="^LEX(757.03,""ASAB"",SAB,IEN)"
 . S LEXIX(3)="^LEX(757.03,""C"",NOM,IEN)",LEXIX(4)="^LEX(757.03,""D"",HL7,IEN)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(LEXFI,LEXNM,"00:00:01",.LEXIX)
 Q
R75704 ;   Excluded Word file 757.04
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP
 S LEXFI="757.04" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="B, AB, ACTION",LEXNM="Excluded Words" I $D(LEXLONG) D
 . S LEXIX(1)="^LEX(757.04,""B"",WORD,IEN)",LEXIX(2)="^LEX(757.04,""AB"",WORD,IEN)",LEXIX(3)="^LEX(757.04,""ACTION"",WORD,EXC,IEN)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(LEXFI,LEXNM,"00:00:03",.LEXIX)
 Q
R75705 ;   Replacement Word file 757.05
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP,LEXIEN,LEXP3,LEXP4
 S LEXFI="757.05" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT N DA,DIK,LEXEX,LEXEXP,LEXIEN,LEXWRD H 1
 D RM(LEXFI) S (LEXP3,LEXP4,LEXIEN)=0 F  S LEXIEN=$O(^LEX(757.05,LEXIEN)) Q:+LEXIEN'>0  D
 . N DA,DIK S LEXP3=LEXIEN,LEXP4=LEXP4+1
 . K ^LEX(757.05,LEXIEN,1,"B") S DA=LEXIEN,DIK="^LEX(757.05," D IX1^DIK
 S $P(^LEX(757.05,0),"^",3)=LEXP3,$P(^LEX(757.05,0),"^",4)=LEXP4
 S LEXIX(1)="B, AB, AEXP, ALINK, AWRD, and C",LEXNM="Replacement Words" I $D(LEXLONG) D
 . S LEXIX(1)="^LEX(757.05,""B"",WORD,IEN)",LEXIX(2)="^LEX(757.05,""AB"",WORD,IEN)",LEXIX(3)="^LEX(757.05,""C"",REP,IEN)"
 . S LEXIX(4)="^LEX(757.05,""AEXP"",EXP,IEN)",LEXIX(5)="^LEX(757.05,""ALINK"",WORD,EXP)",LEXIX(6)="^LEX(757.01,""AWRD"",WORD,EXP,""LINKED"")"
 . S LEXIX(7)="^LEX(757.05,IEN,1,""B"",EXP,IEN2)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(757.05,LEXNM,LEXELP,.LEXIX)
 Q
R75706 ;   Unresolved Narrative file 757.06
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP
 S LEXFI="757.06" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT K ^LEX(757.06) S ^LEX(757.06,0)="UNRESOLVED NARRATIVES^757.06^^0"
 S LEXIX(1)="B",LEXNM="Unresolved Narratives" I $D(LEXLONG) S LEXIX(1)="^LEX(757.06,""B"",NAR,IEN)"
 D REX^LEXRXXS(757.06,LEXNM,"00:00:01",.LEXIX)
 Q
R75711 ;   Semantic Class file 757.11
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP
 S LEXFI="757.11" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="B",LEXNM="Semantic Class" I $D(LEXLONG) S LEXIX(1)="^LEX(757.11,""B"",SC,IEN)",LEXIX(2)="^LEX(757.11,IEN,2,""B"",SYS,IEN2)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(757.11,LEXNM,"00:00:02",.LEXIX)
 Q
R75712 ;   Semantic Type file 757.12
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP
 S LEXFI="757.12" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="B, C, D and E",LEXNM="Semantic Type" I $D(LEXLONG) D
 . S LEXIX(1)="^LEX(757.12,""B"",TUI,IEN)",LEXIX(2)="^LEX(757.12,""D"",DT,IEN)",LEXIX(3)="^LEX(757.12,""E"",UDT,IEN)",LEXIX(4)="^LEX(757.12,""C"",SC,IEN)",LEXIX(5)="^LEX(757.12,IEN,1,""B"",SYS,IEN2)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(757.12,LEXNM,"00:00:02",.LEXIX)
 Q
R75707 ;   Tokens file 757.07
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP
 S LEXFI="757.07" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="ABBR, AED, B and D",LEXNM="Tokens" I $D(LEXLONG) D
 . S LEXIX(1)="^LEX(757.07,""ABBR"",TOKEN,IEN2,IEN1)=Abbreviation Text"
 . S LEXIX(2)="^LEX(757.07,""AED"",TOKEN,TEXT,IEN2,IEN1)"
 . S LEXIX(3)="^LEX(757.07,""B"",TOKEN,IEN2)"
 . S LEXIX(4)="^LEX(757.07,""D"",WORD,IEN2,IEN1)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(757.07,LEXNM,"00:00:02",.LEXIX)
 Q
R757071 ;   Supplemental Words file 757.071
 N LEXBEG,LEXEND,LEXDIF,LEXIX,LEXELP
 S LEXFI="757.071" W:'$D(ZTQUEUED) !,?8,"Re-Indexing file #",LEXFI
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI)) Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT D RM(LEXFI),RX(LEXFI)
 S LEXIX(1)="AD and B",LEXNM="Supplemental Words" I $D(LEXLONG) D
 . S LEXIX(1)="^LEX(757.071,""AD"",TEXT,IEN)"
 . S LEXIX(2)="^LEX(757.071,""B"",WORD,IEN)"
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REX^LEXRXXS(757.071,LEXNM,"00:00:02",.LEXIX)
 Q
 ;              
 ; Miscellaneous
RM(X) ;   Remove Main
 N LEXFI,LEXIX,LEXRT,LEXOUT,LEXMSG
 S LEXFI=+($G(X)) Q:+LEXFI'>0  Q:'$D(^LEX(LEXFI))&('$D(^LEXT(LEXFI)))
 D FILE^DID(LEXFI,"N","GLOBAL NAME","LEXOUT","LEXMSG")
 S LEXRT=$G(LEXOUT("GLOBAL NAME")) Q:LEXRT'["^LEX("&(LEXRT'["^LEXT(")
 S LEXIX=""" """  Q:'$L($O(@(LEXRT_LEXIX_")")))
 F  S LEXIX=$O(@(LEXRT_LEXIX_")")) Q:'$L(LEXIX)  D
 . S:+LEXIX'=LEXIX LEXIX=""""_LEXIX_""""
 . N LEXREF S LEXREF=LEXRT_LEXIX_")" Q:'$D(@LEXREF)  K @LEXREF
 Q
RX(X) ;   Re-Index File X
 N DA,DIK,LEXFI,LEXOUT,LEXMSG,LEXRT,LEXP3,LEXP4 H 2
 S LEXFI=+($G(X)) Q:+LEXFI'>0  Q:'$D(^LEX(LEXFI))&('$D(^LEXT(LEXFI)))
 D FILE^DID(LEXFI,"N","GLOBAL NAME","LEXOUT","LEXMSG")
 S LEXRT=$G(LEXOUT("GLOBAL NAME")) Q:LEXRT'["^LEX("&(LEXRT'["^LEXT(")
 S (LEXP3,LEXP4,DA)=0 F  S DA=$O(@(LEXRT_DA_")")) Q:+DA'>0  D
 . S LEXP3=DA,LEXP4=LEXP4+1,DIK=LEXRT D IX1^DIK
 S $P(@(LEXRT_"0)"),"^",3)=LEXP3,$P(@(LEXRT_"0)"),"^",4)=LEXP4
 Q
CLR ;   Clear
 K LEXLONG,LEXNAM,ZTQUEUED
 Q