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

LEXU.m

Go to the documentation of this file.
  1. LEXU ;ISL/KER - Miscellaneous Lexicon Utilities ;05/23/2017
  1. ;;2.0;LEXICON UTILITY;**2,6,9,15,25,36,73,51,80,86,103**;Sep 23, 1996;Build 2
  1. ;
  1. ; Global Variables
  1. ; ^TMP("LEXSCH",$J) SACC 2.3.2.5.1
  1. ;
  1. ; External References
  1. ; $$ICDDX^ICDEX ICR 5747
  1. ; $$ICDOP^ICDEX ICR 5747
  1. ; $$CPT^ICPTCOD ICR 1995
  1. ; $$UP^XLFSTR ICR 10104
  1. ;
  1. ; Local Variables NEWed or KILLed Elsewhere
  1. ; LEXLKT Lookup Type
  1. ;
  1. HELP ; API Help
  1. D EN^LEXUH
  1. Q
  1. SC(LEX,LEXS,LEXVDT) ; Filter by Semantic Class
  1. Q $$SC^LEXU6($G(LEX),$G(LEXS),$G(LEXVDT))
  1. SO(LEX,LEXS,LEXVDT) ; Filter by Source
  1. Q $$SO^LEXU6($G(LEX),$G(LEXS),$G(LEXVDT))
  1. ICDDP(LEX,LEXT,LEXVDT) ; Filter by ICD Diagnosis/Procedure System
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01 (required)
  1. ; LEXT ICD Type (optional)
  1. ; 1 ICD Diagnosis (default)
  1. ; 2 ICD Procedures
  1. ; LEXVDT Date to use for screening by codes
  1. ; Date before Oct 1, 2013, ICD-9 assumed
  1. ; Date after Sep 30, 2013, ICD-10 assumed
  1. ; Output
  1. ;
  1. ; $$ICDDP 1/0
  1. ;
  1. N LEXEI,LEXF,LEXMC,LEXMCE,LEXSRC,LEXSRI,ICD10 S (LEXSRC,LEXSRI)=""
  1. S LEXEI=+LEX Q:'$D(^LEX(757.01,LEXEI,0)) 0 S ICD10=$$IMPDATE("10D")
  1. S LEXT=$G(LEXT) S:+LEXT<0!(LEXT>2) LEXT=1 D VDT
  1. S:LEXT=1&(LEXVDT<ICD10) LEXSRC="ICD",LEXSRI=1
  1. S:LEXT=1&(LEXVDT'<ICD10) LEXSRC="10D",LEXSRI=30
  1. S:LEXT=2&(LEXVDT<ICD10) LEXSRC="ICP",LEXSRI=2
  1. S:LEXT=2&(LEXVDT'<ICD10) LEXSRC="10P",LEXSRI=31
  1. Q:'$L(LEXSRC) 0 Q:LEXSRI'>0 0
  1. S LEXF=0,LEXMC=+($P(^LEX(757.01,LEXEI,1),U,1)) Q:LEXMC'>0 0
  1. S LEXMCE=+(^LEX(757,+($P(^LEX(757.01,LEXEI,1),U,1)),0)) Q:LEXMCE'>0 0
  1. S LEXF=0 I LEXEI+LEXMCE>0 D
  1. . N LEXSI S LEXSI=0
  1. . F S LEXSI=$O(^LEX(757.02,"AMC",LEXMC,LEXSI)) Q:+LEXSI=0!(LEXF) D Q:LEXF
  1. . . N LEXN0,LEXSAB,LEXSO,LEXSTA
  1. . . S LEXN0=$G(^LEX(757.02,LEXSI,0)),LEXSAB=+($P(LEXN0,U,3))
  1. . . Q:LEXSAB'=LEXSRI Q:"^1^2^30^31^"'[("^"_LEXSAB_"^")
  1. . . S LEXSO=$P(LEXN0,U,2)
  1. . . S LEXSTA=$$STATCHK^LEXSRC2(LEXSO,LEXVDT,,LEXSAB)
  1. . . Q:+LEXSTA'>0 S LEXF=1
  1. S LEX=$G(LEXF)
  1. Q LEX
  1. DX(LEX,LEXVDT) ; Filter by Diagnosis System
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$DX 1/0
  1. ;
  1. N LEXEI,LEXF,LEXMC,LEXMCE,LEXSRC,LEXSRI,ICD10
  1. S LEXEI=+LEX Q:'$D(^LEX(757.01,LEXEI,0)) 0
  1. D VDT S LEXSRC="ICD",LEXSRI=1 S ICD10=$$IMPDATE("10D")
  1. S:+($G(LEXVDT))'<ICD10 LEXSRC="10D",LEXSRI=30
  1. S LEXF=0,LEXMC=+($P(^LEX(757.01,LEXEI,1),U,1)) Q:LEXMC'>0 0
  1. S LEXMCE=+(^LEX(757,+($P(^LEX(757.01,LEXEI,1),U,1)),0)) Q:LEXMCE'>0 0
  1. S LEXF=0 I LEXEI+LEXMCE>0 D
  1. . N LEXSI S LEXSI=0
  1. . F S LEXSI=$O(^LEX(757.02,"AMC",LEXMC,LEXSI)) Q:+LEXSI=0!(LEXF) D
  1. . . N LEXN0,LEXSAB,LEXSO,LEXSTA
  1. . . S LEXN0=$G(^LEX(757.02,LEXSI,0)),LEXSAB=+($P(LEXN0,U,3))
  1. . . Q:LEXSAB'=LEXSRI Q:"^1^30^"'[("^"_LEXSAB_"^")
  1. . . S LEXSO=$P(LEXN0,U,2)
  1. . . S LEXSTA=$$STATCHK^LEXSRC2(LEXSO,LEXVDT,,LEXSAB)
  1. . . Q:+LEXSTA'>0 S LEXF=1
  1. K LEX S LEX=$G(LEXF)
  1. Q LEX
  1. SRC(LEX,LEXS) ; Filter by Expression Source
  1. ; LEX Expression IEN of file 757.01
  1. ; LEXS Source IEN of 757.14
  1. S LEX=+($G(LEX)),LEXS=+($G(LEXS)) Q:LEX=0 0 Q:LEXS=0 0
  1. Q:'$D(^LEX(757.01,LEX,0)) 0 Q:'$D(^LEX(757.14,LEXS,0)) 0
  1. S LEXSR=$P($G(^LEX(757.01,LEX,1)),U,12) Q:LEXSR=LEXS 1
  1. N LEXSR,LEXMC,LEXMCE S LEXMC=+($G(^LEX(757.01,LEX,1)))
  1. S LEXMCE=+($G(^LEX(757,+LEXMC,0)))
  1. S LEXSR=$P($G(^LEX(757.01,LEXMCE,1)),U,12) Q:LEXSR=LEXS 1
  1. Q 0
  1. DEF(LEX) ; Display expression definition
  1. ; LEX IEN of file 757.01
  1. I $D(^LEX(757.01,LEX,3,0)) D
  1. . N LEXLN F LEXLN=1:1:$P(^LEX(757.01,LEX,3,0),U,4) D
  1. . . I $D(^LEX(757.01,LEX,3,LEXLN,0)) W !,?2,^LEX(757.01,LEX,3,LEXLN,0)
  1. . K LEX,LEXLN W !
  1. Q
  1. ID(LEX) ; ICD Diagnosis retained - ICD procedures ignored
  1. ; LEX Code
  1. Q:'$L($G(LEX)) "" Q:$L($P(LEX,".",1))<3 ""
  1. Q:'$D(^LEX(757.02,"AVA",(LEX_" "))) ""
  1. N LEXO,LEXR S (LEXO,LEXR)=0
  1. F S LEXR=$O(^LEX(757.02,"AVA",(LEX_" "),LEXR)) Q:+LEXR=0 D Q:LEXO=1
  1. . I $D(^LEX(757.02,"AVA",(LEX_" "),LEXR,"ICD")) S LEXO=1
  1. Q:'LEXO "" Q LEX
  1. ICDONE(LEX,LEXVDT) ; Get One ICD-9 Diagnosis Code for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$ICDONE ICD-9 Code
  1. ;
  1. N LEXICD D VDT S LEXICD=$$ONE($G(LEX),$G(LEXVDT),"ICD")
  1. Q:'$L($P(LEXICD,"^",1)) "" S LEX=LEXICD
  1. Q LEX
  1. D10ONE(LEX,LEXVDT) ; Get One ICD-10 Diagosis Code for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$D10ONE ICD-10-CM Diagnosis Code or Null
  1. ;
  1. N LEXICD D VDT S LEXICD=$$ONE($G(LEX),$G(LEXVDT),"10D")
  1. Q:'$L($P(LEXICD,"^",1)) "" S LEX=LEXICD
  1. Q LEX
  1. P10ONE(LEX,LEXVDT) ; Get One ICD-10 Procedure Code for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$P10ONE ICD-10-PCS Procedure Code or Null
  1. ;
  1. N LEXICD D VDT S LEXICD=$$ONE($G(LEX),$G(LEXVDT),"10P")
  1. Q:'$L($P(LEXICD,"^",1)) "" S LEX=LEXICD
  1. Q LEX
  1. CPTONE(LEX,LEXVDT) ; Get One CPT Code for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$CPTONE CPT Code or Null
  1. ;
  1. N LEXCPT D VDT S LEXCPT=$$ONE($G(LEX),$G(LEXVDT),"CPT")
  1. Q:'$L($P(LEXCPT,"^",1)) "" S LEX=LEXCPT
  1. Q LEX
  1. CPCONE(LEX,LEXVDT) ; Get One HCPCS Code for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$CPCONE HCPCS Code or Null
  1. ;
  1. N LEXCPT D VDT S LEXCPT=$$ONE($G(LEX),$G(LEXVDT),"CPC")
  1. Q:'$L($P(LEXCPT,"^",1)) "" S LEX=LEXCPT
  1. Q LEX
  1. DSMONE(LEX,LEXVDT) ; Get One DSM Code for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$DSMONE DSM-IV Code or Null
  1. ;
  1. N LEXDSM,LEXCD,LEXDAT D VDT S LEXDSM=$$ONE^LEXSRC($G(LEX),"DS4")
  1. I LEXDSM'="" D Q LEX
  1. . S LEX=LEXDSM N LEXDAT,LEXCD S LEXCD=LEXDSM S:$L(LEXCD)=3 LEXCD=LEXCD_"."
  1. . S LEXDAT=$$ICDDX^ICDEX(LEXCD,$G(LEXVDT),1,"E")
  1. . S:$P(LEXDAT,"^",10)'>0 LEX=""
  1. S LEXDSM=$$ONE^LEXSRC($G(LEX),"DS3") I LEXDSM'="" D Q LEX
  1. . S LEX=LEXDSM N LEXDAT,LEXCD S LEXCD=LEXDSM S:$L(LEXCD)=3 LEXCD=LEXCD_"."
  1. . S LEXDAT=$$ICDDX^ICDEX(LEXCD,$G(LEXVDT),1,"E")
  1. . S:$P(LEXDAT,"^",10)'>0 LEX=""
  1. Q ""
  1. ;
  1. SCT(X,LEXVDT) ; Filter by SNOMED CT (SCT) (Human only)
  1. ;
  1. ; Input
  1. ;
  1. ; X IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$SCT Human SNOMED Code or Null
  1. ; Excludes Veterinary SNOMED codes
  1. ;
  1. N LEXEX,LEXMC,LEXD,LEXC,LEXI,LEXO,LEXPL,LEXVT S LEXEX=+($G(X)),LEXD=$G(LEXVDT) Q:LEXEX'>0 0
  1. S LEXC=$S(LEXD?7N:$$ONE^LEXU(+LEXEX,LEXD,"SCT"),1:$$ONE^LEXU(+LEXEX,,"SCT"))
  1. Q:'$L(LEXC) 0 S LEXMC=+($G(^LEX(757.01,+LEXEX,1))) Q:LEXMC'>0 0 Q:'$D(^LEX(757.1,"B",LEXMC)) 0
  1. S LEXVT=0,LEXI=0 F S LEXI=$O(^LEX(757.1,"B",LEXMC,LEXI)) Q:+LEXI'>0 D Q:LEXVT>0
  1. . N LEXT,LEXN S LEXT=$P($G(^LEX(757.1,LEXI,0)),"^",3),LEXN=$$UP^XLFSTR($P($G(^LEX(757.12,+LEXT,0)),"^",2)) S:LEXN["VETERINARY" LEXVT=1
  1. S LEXPL=0,LEXI=0 F S LEXI=$O(^LEX(757.21,"B",LEXEX,LEXI)) Q:+LEXI'>0 D Q:LEXPL>0
  1. . N LEXT,LEXN S LEXT=$P($G(^LEX(757.21,LEXI,0)),"^",2),LEXN=$P($G(^LEXT(757.2,+LEXT,0)),"^",2) S:LEXN="PLS" LEXPL=1
  1. S LEXO=1 S:LEXVT=1 LEXO=0 S:LEXPL'>0 LEXO=0
  1. S X=LEXO
  1. Q X
  1. ONE(LEX,LEXVDT,LEXSAB) ; Get One Code for a Term by Source
  1. ;
  1. ; Input
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ; LEXSAB Source Abbreviation
  1. ;
  1. ; Output
  1. ;
  1. ; $$ONE Code or Null
  1. ;
  1. N LEXDAT,LEXIEN D VDT S LEXIEN=$G(LEX) Q:+($G(LEXIEN))'>0 ""
  1. S LEXSAB=$G(LEXSAB) Q:'$L(LEXSAB) ""
  1. I LEXSAB?1N.N,'$D(^LEX(757.03,"ASAB",LEXSAB)),$D(^LEX(757.03,+LEXSAB,0)) D
  1. . S LEXSAB=$P($G(^LEX(757.03,+LEXSAB,0)),"^",1)
  1. S LEXSAB=$E($G(LEXSAB),1,3) Q:$L(LEXSAB)'=3 ""
  1. S LEX=$$ONE^LEXSRC(LEXIEN,LEXSAB,LEXVDT),LEXDAT=""
  1. S:LEXSAB="ICD"!(LEXSAB="DS4") LEXDAT=$$ICDDX^ICDEX(LEX,LEXVDT,1,"E")
  1. S:LEXSAB="10D" LEXDAT=$$ICDDX^ICDEX(LEX,LEXVDT,30,"E")
  1. S:LEXSAB="ICP" LEXDAT=$$ICDOP^ICDEX(LEX,LEXVDT,2,"E")
  1. S:LEXSAB="10P" LEXDAT=$$ICDOP^ICDEX(LEX,LEXVDT,31,"E")
  1. S:LEXSAB="CPT" LEXDAT=$$CPT^ICPTCOD(LEX,LEXVDT)
  1. S:LEXSAB="CPC" LEXDAT=$$CPT^ICPTCOD(LEX,LEXVDT)
  1. Q:"^CPT^CPC"[("^"_LEXSAB_"^")&($P(LEXDAT,"^",7)'>0) ""
  1. Q:"^ICD^ICP^10D^10P^"[("^"_LEXSAB_"^")&($P(LEXDAT,"^",10)'>0) ""
  1. S LEX="" I +LEXDAT'>0 D
  1. . N LEXSIEN S LEXSIEN=0
  1. . F S LEXSIEN=$O(^LEX(757.02,"B",LEXIEN,LEXSIEN)) Q:+LEXSIEN'>0 D Q:+LEXDAT>0
  1. . . Q:'$D(^LEX(757.02,"ASRC",LEXSAB,LEXSIEN)) N LEXEF,LEXHI,LEXST,LEXCD
  1. . . S LEXEF=$O(^LEX(757.02,LEXSIEN,4,"B",(LEXVDT+.001)),-1) Q:'$L(LEXEF)
  1. . . S LEXHI=$O(^LEX(757.02,LEXSIEN,4,"B",+LEXEF," "),-1)
  1. . . S LEXST=$P($G(^LEX(757.02,LEXSIEN,4,+LEXHI,0)),"^",2) Q:LEXST'>0
  1. . . S LEXCD=$P($G(^LEX(757.02,+LEXSIEN,0)),"^",2)
  1. . . S:$L(LEXCD)&(+LEXIEN>0) LEXDAT=LEXIEN_"^"_LEXCD
  1. Q:+LEXDAT'>0 "" S LEX=$P(LEXDAT,"^",2)
  1. I $G(LEXLKT)["BC" D
  1. . N LEXNAR S LEXNAR=$$UP^XLFSTR($G(^TMP("LEXSCH",$J,"NAR",0)))
  1. . I $L($G(LEXNAR)) S:$E(LEX,1,$L($G(LEXNAR)))'=$G(LEXNAR) LEX=""
  1. Q LEX
  1. PRF(LEX,LEXVDT,LEXSAB) ; Get One Code for a Preferred Term by Source
  1. Q $$PRF^LEXU3($G(LEX),$G(LEXVDT),$G(LEXSAB))
  1. ICD(LEX,LEXVDT) ; Get All ICD-9 Diagnosis Codes for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$ICD <ICD-9 code><ICD-9 code><etc>
  1. ;
  1. D VDT S LEX=$$ALL^LEXU($G(LEX),$G(LEXVDT),"ICD")
  1. Q LEX
  1. D10(LEX,LEXVDT) ; Get All ICD-10 Diagnosis Codes for a Term
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ;
  1. ; Output
  1. ;
  1. ; $$D10 <ICD-10 code><ICD-10 code><etc>
  1. ;
  1. D VDT S LEX=$$ALL^LEXU($G(LEX),$G(LEXVDT),"10D")
  1. Q LEX
  1. ;
  1. ALL(LEX,LEXVDT,LEXSAB) ; Get All Codes for a Term by Source
  1. ;
  1. ; Input
  1. ;
  1. ; LEX IEN of file 757.01
  1. ; LEXVDT Date to use for screening by codes
  1. ; LEXSAB Source Abbreviation
  1. ;
  1. ; Output
  1. ;
  1. ; $$ALL A ";" delimited string of codes
  1. ; of the specified coding system
  1. ; for the term
  1. ;
  1. N LEXDAT,LEXIEN,LEXSRC,LEXI,LEXT,LEXS D VDT
  1. S LEXIEN=+($G(LEX)) Q:+($G(LEXIEN))'>0 ""
  1. S LEXSAB=$E($G(LEXSAB),1,3) Q:$L(LEXSAB)'=3 ""
  1. D ALL^LEXSRC(LEX,LEXSAB,LEXVDT)
  1. Q:+$G(LEXSRC(0))'>0 "" S LEXI=0,LEXT=""
  1. F S LEXI=$O(LEXSRC(LEXI)) Q:+LEXI=0 D
  1. . S LEXS=LEXSRC(LEXI)
  1. . S:LEXSAB="ICD" LEXDAT=$$ICDDX^ICDEX(LEXS,$G(LEXVDT),1,"E")
  1. . S:LEXSAB="10D" LEXDAT=$$ICDDX^ICDEX(LEXS,$G(LEXVDT),30,"E")
  1. . S:LEXSAB="10P" LEXDAT=$$ICDOP^ICDEX(LEXS,$G(LEXVDT),31,"E")
  1. . S:LEXSAB="CPT" LEXDAT=$$CPT^ICPTCOD(LEXS,LEXVDT)
  1. . S:LEXSAB="CPC" LEXDAT=$$CPT^ICPTCOD(LEXS,LEXVDT)
  1. . Q:+($G(LEXDAT))'>0
  1. . Q:"^CPT^CPT"[("^"_LEXSAB_"^")&($P($G(LEXDAT),"^",7)'>0)
  1. . Q:"^ICD^ICP^10D^10P^"[("^"_LEXSAB_"^")&($P($G(LEXDAT),"^",10)'>0)
  1. . Q:(LEXT_";")[(";"_LEXS_";") S LEXT=LEXT_";"_LEXS
  1. S LEX="" S:$E(LEXT,1)=";" LEXT=$E(LEXT,2,$L(LEXT)) S LEX=LEXT
  1. Q LEX
  1. HIST(CODE,SYS,ARY) ; Activation History
  1. Q $$HIST^LEXU4($G(CODE),$G(SYS),.ARY)
  1. PERIOD(CODE,SYS,ARY) ; Return Activation Periods
  1. Q $$PERIOD^LEXU4($G(CODE),$G(SYS),.ARY)
  1. EXP(IEN) ; Get Expression for IEN
  1. Q $$EXP^LEXU3($G(IEN))
  1. EXPS(IEN,CDT,ARY) ; Get Expression and Codes for IEN
  1. D EXPS^LEXU3($G(IEN),$G(CDT),.ARY) Q
  1. PREF(CODE,SAB,CDT) ; Get Preferred Expression for an Active Code
  1. Q $$PREF^LEXU3($G(CODE),$G(SAB),$G(CDT))
  1. CSDATA(CODE,CSYS,CDT,ARY) ; Code Data
  1. N X S X=$$CSDATA^LEXU2($G(CODE),$G(CSYS),$G(CDT),.ARY) Q X
  1. ADR(LEX) ; Mailing Address
  1. Q $$ADR^LEXU3($G(LEX))
  1. VDT ; Resolve LEXVDT
  1. D VDT^LEXU3 Q
  1. IMPDATE(CSYS) ; Return the implementation date for a coding system
  1. Q $$IMPDATE^LEXU5($G(CSYS))
  1. CSYS(SYS) ; Coding System Info
  1. Q $$CSYS^LEXU5($G(SYS))
  1. FREQ(TXT) ; Frequency of text - ICR 5679
  1. Q $$FREQ^LEXU3($G(TXT))
  1. MAX(SYS) ; Coding System search Threshold - ICR 5679
  1. Q $$MAX^LEXU3($G(SYS))
  1. PAR(TXT,ARY) ; Parse Text into Words (for indexing)
  1. Q $$PAR^LEXU3(TXT,.ARY)
  1. CAT(CODE) ; Get Category of Dx Code - ICR 5679
  1. Q $$CAT^LEX10DU($G(CODE))
  1. ISCAT(CODE) ; Get Category of Dx Code - ICR 5679
  1. Q $$ISCAT^LEX10DU($G(CODE))
  1. PFI(FRAG,CDT,ARY) ; ICD-10 Procedure Code Fragment Information - ICR 5679
  1. Q $$PFI^LEXU4($G(FRAG),$G(CDT),.ARY)
  1. NXSAB(X,Y) ; Next Source Abbreviation
  1. Q $$NXSAB^LEXU3($G(X),$G(Y))
  1. INC(X) ; Increment Concept Usage for a term (by subscription only)
  1. D INC^LEXU3($G(X))
  1. Q
  1. PR(LEX,X) ; Parse Array LEX into X length strings
  1. D PR^LEXU5(.LEX,$G(X))
  1. Q
  1. RECENT(X) ; Recently Updated (90 day window)
  1. Q $$RECENT^LEXU3($G(X))
  1. RUPD(X) ; Recent Update Date
  1. Q $$RUPD^LEXU3($G(X))
  1. LUPD(X,Y) ; Last Update
  1. Q $$LUPD^LEXU3($G(X),$G(Y))
  1. REUSE(X,SYS) ; Is a code "re-used" (1/0)
  1. Q $$REUSE^LEXU4($G(X),$G(SYS))
  1. REVISE(X,SYS) ; Is a code "revised" (1/0)
  1. Q $$REVISE^LEXU4($G(X),$G(SYS))
  1. LAST(X,SYS,CDT) ; Last Activation ^ Last Inactivation Date
  1. Q $$LAST^LEXU4($G(X),$G(SYS),$G(CDT))
  1. IENS(CODE,ARY,CDT) ; Get Lexicon/National File IENS for a Code
  1. Q $$IENS^LEXU7($G(CODE),.ARY,$G(CDT))
  1. SOS(IEN,ARY,SYN) ; Get Codes for an Expression
  1. Q $$SOS^LEXU6($G(IEN),.ARY,$G(SYN))
  1. EXM(X,ARY,LEXD,LEXM) ; Exact Match
  1. Q $$EXM^LEXU6($G(X),.ARY,+($G(LEXD)),+($G(LEXM)))
  1. SUBSETS(CODE,SRC,LEX) ; Get Subsets for a Code
  1. Q $$SUBSETS^LEXU5($G(CODE),$G(SRC),.LEX)
  1. CODE(CODE,SRC,CDT,ARY,OUT) ;
  1. D CODE^LEXINF($G(CODE),$G(SRC),$G(CDT),.ARY,$G(OUT)) Q
  1. TERM(IEN,CDT,ARY,OUT) ;
  1. D TERM^LEXINF($G(IEN),$G(CDT),.ARY,$G(OUT)) Q