KIDS Distribution saved on Aug 11, 2026@15:08:18
LEX*2.0*160
**KIDS**:LEX*2.0*160^

**INSTALL NAME**
LEX*2.0*160
"BLD",9559,0)
LEX*2.0*160^LEXICON UTILITY^0^3260811^y
"BLD",9559,1,0)
^^2^2^3260811^
"BLD",9559,1,1,0)
Please see the National Patch Module for details of the enhancements 
"BLD",9559,1,2,0)
included in this patch.
"BLD",9559,4,0)
^9.64PA^^
"BLD",9559,6)
1
"BLD",9559,6.3)
2
"BLD",9559,"ABPKG")
n
"BLD",9559,"INIT")
POST^LEX2160P
"BLD",9559,"KRN",0)
^9.67PA^1.61^23
"BLD",9559,"KRN",.4,0)
.4
"BLD",9559,"KRN",.401,0)
.401
"BLD",9559,"KRN",.402,0)
.402
"BLD",9559,"KRN",.403,0)
.403
"BLD",9559,"KRN",.5,0)
.5
"BLD",9559,"KRN",.84,0)
.84
"BLD",9559,"KRN",1.6,0)
1.6
"BLD",9559,"KRN",1.61,0)
1.61
"BLD",9559,"KRN",1.62,0)
1.62
"BLD",9559,"KRN",3.6,0)
3.6
"BLD",9559,"KRN",3.8,0)
3.8
"BLD",9559,"KRN",9.2,0)
9.2
"BLD",9559,"KRN",9.8,0)
9.8
"BLD",9559,"KRN",9.8,"NM",0)
^9.68A^2^2
"BLD",9559,"KRN",9.8,"NM",1,0)
LEX2160^^0^B91277441
"BLD",9559,"KRN",9.8,"NM",2,0)
LEX2160P^^0^B21696857
"BLD",9559,"KRN",9.8,"NM","B","LEX2160",1)

"BLD",9559,"KRN",9.8,"NM","B","LEX2160P",2)

"BLD",9559,"KRN",19,0)
19
"BLD",9559,"KRN",19.1,0)
19.1
"BLD",9559,"KRN",101,0)
101
"BLD",9559,"KRN",409.61,0)
409.61
"BLD",9559,"KRN",771,0)
771
"BLD",9559,"KRN",779.2,0)
779.2
"BLD",9559,"KRN",870,0)
870
"BLD",9559,"KRN",8989.51,0)
8989.51
"BLD",9559,"KRN",8989.52,0)
8989.52
"BLD",9559,"KRN",8994,0)
8994
"BLD",9559,"KRN","B",.4,.4)

"BLD",9559,"KRN","B",.401,.401)

"BLD",9559,"KRN","B",.402,.402)

"BLD",9559,"KRN","B",.403,.403)

"BLD",9559,"KRN","B",.5,.5)

"BLD",9559,"KRN","B",.84,.84)

"BLD",9559,"KRN","B",1.6,1.6)

"BLD",9559,"KRN","B",1.61,1.61)

"BLD",9559,"KRN","B",1.62,1.62)

"BLD",9559,"KRN","B",3.6,3.6)

"BLD",9559,"KRN","B",3.8,3.8)

"BLD",9559,"KRN","B",9.2,9.2)

"BLD",9559,"KRN","B",9.8,9.8)

"BLD",9559,"KRN","B",19,19)

"BLD",9559,"KRN","B",19.1,19.1)

"BLD",9559,"KRN","B",101,101)

"BLD",9559,"KRN","B",409.61,409.61)

"BLD",9559,"KRN","B",771,771)

"BLD",9559,"KRN","B",779.2,779.2)

"BLD",9559,"KRN","B",870,870)

"BLD",9559,"KRN","B",8989.51,8989.51)

"BLD",9559,"KRN","B",8989.52,8989.52)

"BLD",9559,"KRN","B",8994,8994)

"BLD",9559,"PRE")
LEX2160
"BLD",9559,"QDEF")
^^^^NO^^^^^^NO
"BLD",9559,"QUES",0)
^9.62^^
"BLD",9559,"REQB",0)
^9.611^1^1
"BLD",9559,"REQB",1,0)
LEX*2.0*159^2
"BLD",9559,"REQB","B","LEX*2.0*159",1)

"INIT")
POST^LEX2160P
"MBREQ")
0
"PKG",574,-1)
1^1
"PKG",574,0)
LEXICON UTILITY^LEX^Medical and Biomedical Terminology System.
"PKG",574,22,0)
^9.49I^1^1
"PKG",574,22,1,0)
2.0^2960915^2970127^520736423
"PKG",574,22,1,"PAH",1,0)
160^3260811
"PKG",574,22,1,"PAH",1,1,0)
^^2^2^3260811
"PKG",574,22,1,"PAH",1,1,1,0)
Please see the National Patch Module for details of the enhancements 
"PKG",574,22,1,"PAH",1,1,2,0)
included in this patch.
"PRE")
LEX2160
"QUES","XPF1",0)
Y
"QUES","XPF1","??")
^D REP^XPDH
"QUES","XPF1","A")
Shall I write over your |FLAG| File
"QUES","XPF1","B")
YES
"QUES","XPF1","M")
D XPF1^XPDIQ
"QUES","XPF2",0)
Y
"QUES","XPF2","??")
^D DTA^XPDH
"QUES","XPF2","A")
Want my data |FLAG| yours
"QUES","XPF2","B")
YES
"QUES","XPF2","M")
D XPF2^XPDIQ
"QUES","XPI1",0)
YO
"QUES","XPI1","??")
^D INHIBIT^XPDH
"QUES","XPI1","A")
Want KIDS to INHIBIT LOGONs during the install
"QUES","XPI1","B")
NO
"QUES","XPI1","M")
D XPI1^XPDIQ
"QUES","XPM1",0)
PO^VA(200,:EM
"QUES","XPM1","??")
^D MG^XPDH
"QUES","XPM1","A")
Enter the Coordinator for Mail Group '|FLAG|'
"QUES","XPM1","B")

"QUES","XPM1","M")
D XPM1^XPDIQ
"QUES","XPO1",0)
Y
"QUES","XPO1","??")
^D MENU^XPDH
"QUES","XPO1","A")
Want KIDS to Rebuild Menu Trees Upon Completion of Install
"QUES","XPO1","B")
NO
"QUES","XPO1","M")
D XPO1^XPDIQ
"QUES","XPZ1",0)
Y
"QUES","XPZ1","??")
^D OPT^XPDH
"QUES","XPZ1","A")
Want to DISABLE Scheduled Options, Menu Options, and Protocols
"QUES","XPZ1","B")
NO
"QUES","XPZ1","M")
D XPZ1^XPDIQ
"QUES","XPZ2",0)
Y
"QUES","XPZ2","??")
^D RTN^XPDH
"QUES","XPZ2","A")
Want to MOVE routines to other CPUs
"QUES","XPZ2","B")
NO
"QUES","XPZ2","M")
D XPZ2^XPDIQ
"RTN")
2
"RTN","LEX2160")
0^1^B91277441
"RTN","LEX2160",1,0)
LEX2160 ;ISL/TJH - LEX*2.0*160 Env Check ; 08/07/2026
"RTN","LEX2160",2,0)
 ;;2.0;LEXICON UTILITY;**160**;Sep 23, 1996;Build 2
"RTN","LEX2160",3,0)
 ;
"RTN","LEX2160",4,0)
 ; Global Variables
"RTN","LEX2160",5,0)
 ;    ^LEXM               N/A
"RTN","LEX2160",6,0)
 ;               
"RTN","LEX2160",7,0)
 ; External References
"RTN","LEX2160",8,0)
 ; DBIA #2051
"RTN","LEX2160",9,0)
 ; DBIA #2054
"RTN","LEX2160",10,0)
 ; DBIA #10015
"RTN","LEX2160",11,0)
 ; DBIA #10103
"RTN","LEX2160",12,0)
 ; DBIA #10141
"RTN","LEX2160",13,0)
 ;               
"RTN","LEX2160",14,0)
 ; Local Variables NEWed or KILLed by Kernel Installation
"RTN","LEX2160",15,0)
 ; and Distribution System (KIDS):
"RTN","LEX2160",16,0)
 ; 
"RTN","LEX2160",17,0)
 ;     XPDABORT,XPDDIQ,XPDQUIT
"RTN","LEX2160",18,0)
 ;               
"RTN","LEX2160",19,0)
 ;     See Kernel Developer Guide, Chapter 14, 
"RTN","LEX2160",20,0)
 ;     KIDS Developer Tools, Advanced Build Techniques
"RTN","LEX2160",21,0)
 ;               
"RTN","LEX2160",22,0)
 ; The following sections must be updated with each quarterly
"RTN","LEX2160",23,0)
 ; patch
"RTN","LEX2160",24,0)
 ;        
"RTN","LEX2160",25,0)
 ;   IMP^LEX2nnn   Import names
"RTN","LEX2160",26,0)
 ;     
"RTN","LEX2160",27,0)
 ;     This section sets the following variables:
"RTN","LEX2160",28,0)
 ;         
"RTN","LEX2160",29,0)
 ;     LEXBUILD    Build Name            LEX*2.0*nnn
"RTN","LEX2160",30,0)
 ;     LEXPTYPE    Patch Type            Remedy or Quarterly
"RTN","LEX2160",31,0)
 ;     LEXIGHF     Name of Host File     LEX_2_nnn.GBL
"RTN","LEX2160",32,0)
 ;     LEXLREV     Revision Number       nnn
"RTN","LEX2160",33,0)
 ;     LEXFY       Fiscal Year           FYnn
"RTN","LEX2160",34,0)
 ;     LEXQTR      Quarter               1st, 2nd, 3rd, or 4th
"RTN","LEX2160",35,0)
 ;     LEXREQP(n)  Required Patch Array
"RTN","LEX2160",36,0)
 ;
"RTN","LEX2160",37,0)
 ;   IPL^LEX2nnnP  Informational Patch List
"RTN","LEX2160",38,0)
 ;     
"RTN","LEX2160",39,0)
 ;     This is a listing of informational patches that 
"RTN","LEX2160",40,0)
 ;     accompany this patch.  It consists of a patch name 
"RTN","LEX2160",41,0)
 ;     and a sequence number when available.  It is used
"RTN","LEX2160",42,0)
 ;     to update the package file at the site with the 
"RTN","LEX2160",43,0)
 ;     informational patches.
"RTN","LEX2160",44,0)
 ;               
"RTN","LEX2160",45,0)
ENV ; Environment Check
"RTN","LEX2160",46,0)
 ;                    
"RTN","LEX2160",47,0)
 ;   General
"RTN","LEX2160",48,0)
 ;
"RTN","LEX2160",49,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXG,LEXB,LEXE,LEXR,LEXSTR,LEXOK D IMP
"RTN","LEX2160",50,0)
 K XPDDIQ("XPZ1","B"),XPDDIQ("XPI1","B") S XPDDIQ("XPZ1","B")="NO",XPDDIQ("XPI1","B")="NO"
"RTN","LEX2160",51,0)
 S LEXSTR=$G(LEXPTYPE) S:$L($G(LEXFY))&($L($G(LEXQTR))) LEXSTR=LEXSTR_" for "_$G(LEXFY)_" "_$G(LEXQTR)_" Quarter"
"RTN","LEX2160",52,0)
 D BM(LEXSTR)
"RTN","LEX2160",53,0)
 S U="^"
"RTN","LEX2160",54,0)
 ;     No user
"RTN","LEX2160",55,0)
 D:+($$UR)'>0 ET("User not defined (DUZ)")
"RTN","LEX2160",56,0)
 ;     No IO
"RTN","LEX2160",57,0)
 D:+($$SY)'>0 ET("Undefined IO variable(s)")
"RTN","LEX2160",58,0)
 I $D(LEXE) D ABRT Q
"RTN","LEX2160",59,0)
 ;                    
"RTN","LEX2160",60,0)
 ;   Load Distribution
"RTN","LEX2160",61,0)
 ;
"RTN","LEX2160",62,0)
 ;     XPDENV = 0 Environment Check during Load
"RTN","LEX2160",63,0)
 ;
"RTN","LEX2160",64,0)
 ;       Check Version (2.0)
"RTN","LEX2160",65,0)
 I $$VERSION^XPDUTL("LEX")'="2.0" D  D ABRT Q
"RTN","LEX2160",66,0)
 . D ET("Version 2.0 not found.  Please install Lexicon Utility v 2.0")
"RTN","LEX2160",67,0)
 N LEXOK,LEXG,LEXR,LEXB
"RTN","LEX2160",68,0)
 ;       Check Required Patches
"RTN","LEX2160",69,0)
 K LEXE D:$O(LEXREQP(0))'>0 IMP I $O(LEXREQP(0))>0 D
"RTN","LEX2160",70,0)
 . W ! N LEXPAT,LEXI,LEXPN,LEXP,LEXR,LEXC,LEXO,LEXC1,LEXC2,LEXC3,LEXC4,LEX
"RTN","LEX2160",71,0)
 . S (LEXR,LEXC)=0 S LEXC1=3,LEXC2=24,LEXC3=37,LEXC4=50
"RTN","LEX2160",72,0)
 . S LEXI=0  F  S LEXI=$O(LEXREQP(LEXI)) Q:+LEXI'>0  D
"RTN","LEX2160",73,0)
 . . S LEXC=LEXC+1,LEXPAT=$G(LEXREQP(LEXI))
"RTN","LEX2160",74,0)
 . S LEXI=0  F  S LEXI=$O(LEXREQP(LEXI)) Q:+LEXI'>0  D
"RTN","LEX2160",75,0)
 . . N LEXPAT,LEXREL,LEXINS,LEXCOM,LEXINE,LEXREQ,LEXTX S LEXREQ=$G(LEXREQP(LEXI))
"RTN","LEX2160",76,0)
 . . S LEXPAT=$P(LEXREQ,"^",1),LEXREL=$P(LEXREQ,"^",2),LEXCOM=$P(LEXREQ,"^",3)
"RTN","LEX2160",77,0)
 . . S LEXPN=$$INS(LEXPAT) S LEXINS=$$INSD(LEXPAT),LEXINE=$P(LEXINS,"^",2)
"RTN","LEX2160",78,0)
 . . I LEXI=1 D
"RTN","LEX2160",79,0)
 . . . W !,?LEXC1,"Checking for ",!
"RTN","LEX2160",80,0)
 . . . W !,?LEXC1,"Patch",?LEXC2,"Released",?LEXC3,"Installed",?LEXC4,"Content"
"RTN","LEX2160",81,0)
 . . S LEXTX=$J(" ",LEXC1)_LEXPAT
"RTN","LEX2160",82,0)
 . . S LEXTX=LEXTX_$J(" ",(LEXC2-$L(LEXTX)))
"RTN","LEX2160",83,0)
 . . S:LEXREL?7N LEXTX=LEXTX_$P($$FMTE^XLFDT(LEXREL,"5DZ"),"@",1)
"RTN","LEX2160",84,0)
 . . S LEXTX=LEXTX_$J(" ",(LEXC3-$L(LEXTX)))
"RTN","LEX2160",85,0)
 . . I +LEXPN>0 D
"RTN","LEX2160",86,0)
 . . . S LEXO=+($G(LEXO))+1 S:$L($G(LEXINE)) LEXTX=LEXTX_LEXINE
"RTN","LEX2160",87,0)
 . . . S LEXTX=LEXTX_$J(" ",(LEXC4-$L(LEXTX)))
"RTN","LEX2160",88,0)
 . . . S:$L(LEXCOM) LEXTX=LEXTX_LEXCOM
"RTN","LEX2160",89,0)
 . . D M(LEXTX)
"RTN","LEX2160",90,0)
 . . I +LEXPN'>0 D
"RTN","LEX2160",91,0)
 . . . N LEXP S LEXP=$G(LEXPAT) S:LEXP[" SEQ"&($L($P(LEXP," SEQ",1))) LEXP=$P(LEXP," SEQ",1)
"RTN","LEX2160",92,0)
 . . . D ET((LEXP_" not found, please install "_LEXP_" before continuing"))
"RTN","LEX2160",93,0)
 . W:+($G(LEXO))'=LEXC !
"RTN","LEX2160",94,0)
 I $D(LEXE) D M(),ABRT Q
"RTN","LEX2160",95,0)
 I '$D(LEXFULL)&(+($G(XPDENV))'=1) D QUIT Q
"RTN","LEX2160",96,0)
 ;                    
"RTN","LEX2160",97,0)
 ;   Install Package(s)
"RTN","LEX2160",98,0)
 ;
"RTN","LEX2160",99,0)
 ;     XPDENV = 1 Environment Check during Install
"RTN","LEX2160",100,0)
 ;
"RTN","LEX2160",101,0)
 ;       Check Import Global Checksum 
"RTN","LEX2160",102,0)
 I +($G(XPDENV))=1 K LEXE D CS I $D(LEXE) D ABRT Q
"RTN","LEX2160",103,0)
 ;                    
"RTN","LEX2160",104,0)
 ;   Quit, Exit or Abort
"RTN","LEX2160",105,0)
 ;
"RTN","LEX2160",106,0)
QUIT ;     Quit   Passed Environment Check
"RTN","LEX2160",107,0)
 K LEXFULL D OK
"RTN","LEX2160",108,0)
 Q
"RTN","LEX2160",109,0)
EXIT ;     Exit   Failed Environment Check
"RTN","LEX2160",110,0)
 D:$D(LEXE) ED S XPDQUIT=2 K LEXE,LEXFULL Q
"RTN","LEX2160",111,0)
ABRT ;     Abort  Failed Environment Check, KILL the distribution
"RTN","LEX2160",112,0)
 D:$D(LEXE) ED S XPDABORT=1,XPDQUIT=1 S:$L($G(LEXBUILD)) XPDQUIT(LEXBUILD)=1
"RTN","LEX2160",113,0)
 K LEXE,LEXFULL
"RTN","LEX2160",114,0)
 Q
"RTN","LEX2160",115,0)
 ;
"RTN","LEX2160",116,0)
T1 ; Environment Check #1 (for testing only)
"RTN","LEX2160",117,0)
 K XPDENV D ENV
"RTN","LEX2160",118,0)
 Q
"RTN","LEX2160",119,0)
T2 ; Environment Check #2 (for testing only)
"RTN","LEX2160",120,0)
 N XPDENV S XPDENV=1 D ENV
"RTN","LEX2160",121,0)
 Q
"RTN","LEX2160",122,0)
 ;               
"RTN","LEX2160",123,0)
 ; Checks
"RTN","LEX2160",124,0)
 ;
"RTN","LEX2160",125,0)
INS(X) ;   Installed
"RTN","LEX2160",126,0)
 N LEX,LEXP,LEXV,LEXI,LEXS S LEX=$P($G(X)," ",1) I $L(LEX,"*")=3 S X=$$PATCH^XPDUTL(LEX) Q X
"RTN","LEX2160",127,0)
 S LEXP=$$PKG^XPDUTL(LEX),LEXV=$$VER^XPDUTL(LEX),LEXI=$$VERSION^XPDUTL(LEXP)
"RTN","LEX2160",128,0)
 Q:+LEXV>0&(LEXV=LEXI) 1
"RTN","LEX2160",129,0)
 Q 0
"RTN","LEX2160",130,0)
INSD(X)  ;   Installed on
"RTN","LEX2160",131,0)
 N DA,LEX,LEXDA,LEXE,LEXI,LEXMSG,LEXNS,LEXOUT,LEXPI,LEXPN,LEXSCR,LEXVI,LEXVD,LEXVI,LEXVR S LEX=$G(X)
"RTN","LEX2160",132,0)
 S LEXNS=$$PKG^XPDUTL(LEX),LEXVR=$$VER^XPDUTL(LEX),LEXPN=$P(X,"*",3)
"RTN","LEX2160",133,0)
 Q:'$L(LEXNS) ""  S LEXVR=+LEXVR Q:LEXVR'>0 ""  S LEXPN=+LEXPN S:LEXVR'["." LEXVR=LEXVR_".0"
"RTN","LEX2160",134,0)
 S LEXSCR="I $G(^DIC(9.4,+($G(Y)),""VERSION""))="""_LEXVR_""""
"RTN","LEX2160",135,0)
 D FIND^DIC(9.4,,.01,"O",LEXNS,10,"C",LEXSCR,,"LEXOUT","LEXMSG")
"RTN","LEX2160",136,0)
 S LEXPI=$G(LEXOUT("DILIST",2,1)) K LEXOUT,LEXMSG Q:+LEXPI'>0 ""  Q:'$D(@("^DIC(9.4,"_LEXPI_",22)")) ""
"RTN","LEX2160",137,0)
 K DA S DA(1)=LEXPI S LEXDA=$$IENS^DILF(.DA)
"RTN","LEX2160",138,0)
 D FIND^DIC(9.49,LEXDA,".01;1I;2I","O",LEXVR,10,"B",,,"LEXOUT","LEXMSG")
"RTN","LEX2160",139,0)
 S LEXVD=$G(LEXOUT("DILIST","ID",1,2)) I $E(LEXVD,1,7)?7N&(+LEXPN'>0) D  Q X
"RTN","LEX2160",140,0)
 . S X=$E(LEXVD,1,7)_"^"_$TR($$FMTE^XLFDT($E(LEXVD,1,7),"5DZ"),"@"," ")
"RTN","LEX2160",141,0)
 S:$E(LEXVD,1,7)'?7N LEXVD=$G(LEXOUT("DILIST","ID",1,1)) I $E(LEXVD,1,7)?7N&(+LEXPN'>0) D  Q X
"RTN","LEX2160",142,0)
 . S X=$E(LEXVD,1,7)_"^"_$TR($$FMTE^XLFDT($E(LEXVD,1,7),"5DZ"),"@"," ")
"RTN","LEX2160",143,0)
 Q:+LEXPN'>0 ""  S LEXVI=$G(LEXOUT("DILIST",2,1)) K LEXOUT,LEXMSG
"RTN","LEX2160",144,0)
 Q:+LEXVI'>0 ""  Q:'$D(@("^DIC(9.4,"_LEXPI_",22,"_LEXVI_",""PAH"")")) ""
"RTN","LEX2160",145,0)
 K DA S DA(2)=LEXPI,DA(1)=LEXVI S LEXDA=$$IENS^DILF(.DA)
"RTN","LEX2160",146,0)
 S LEXSCR="I $G(^DIC(9.4,"_LEXPI_",22,"_LEXVI_",""PAH"",+($G(Y)),0))[""SEQ #"""
"RTN","LEX2160",147,0)
 D FIND^DIC(9.4901,LEXDA,".01;.02I",,LEXPN,10,"B",LEXSCR,,"LEXOUT","LEXMSG")
"RTN","LEX2160",148,0)
 S LEXI=$G(LEXOUT("DILIST","ID",1,.02)) I '$L(LEXI) D
"RTN","LEX2160",149,0)
 . S LEXSCR="" D FIND^DIC(9.4901,LEXDA,".01;.02I",,LEXPN,10,"B",LEXSCR,,"LEXOUT","LEXMSG")
"RTN","LEX2160",150,0)
 . S LEXI=$G(LEXOUT("DILIST","ID",1,.02))
"RTN","LEX2160",151,0)
 Q:'$L(LEXI) ""  Q:$P(LEXI,".",1)'?7N ""  S LEXE=$TR($$FMTE^XLFDT(LEXI,"5DZ"),"@"," ")
"RTN","LEX2160",152,0)
 Q:'$L(LEXE) ""  S X=LEXI_"^"_LEXE
"RTN","LEX2160",153,0)
 Q X
"RTN","LEX2160",154,0)
 ;                    
"RTN","LEX2160",155,0)
 ;   Checksums
"RTN","LEX2160",156,0)
CHECKSUM ;     Checksum Check
"RTN","LEX2160",157,0)
 D CS I $D(LEXE) D ED Q
"RTN","LEX2160",158,0)
 D BM("  OK"),M(" ")
"RTN","LEX2160",159,0)
 Q
"RTN","LEX2160",160,0)
CS ;     Checksum for import global
"RTN","LEX2160",161,0)
 K LEXE D BM("   Running checksum routine on the ^LEXM import global, please wait")
"RTN","LEX2160",162,0)
 N LEXCK,LEXND,LEXV S LEXCK=+($G(^LEXM(0,"CHECKSUM")))
"RTN","LEX2160",163,0)
 S LEXND=+($G(^LEXM(0,"NODES"))),LEXV=+($$CV(LEXCK,LEXND))
"RTN","LEX2160",164,0)
 D:'$D(LEXE) M(" ") D:'$D(LEXE)&(LEXV>0) M("     Checksum is ok"),M(" ")
"RTN","LEX2160",165,0)
 D:LEXV=0 CM D:LEXV=-1 CW D:LEXV=-2 CU D:LEXV=-3 CF
"RTN","LEX2160",166,0)
 Q
"RTN","LEX2160",167,0)
CV(X,Y) ;     Checksum Verify for import global
"RTN","LEX2160",168,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR Q:'$D(^LEXM) 0
"RTN","LEX2160",169,0)
 D IMP I $G(^LEXM(0,"BUILD"))'=$G(LEXBUILD) Q -1
"RTN","LEX2160",170,0)
 N LEXCK,LEXND,LEXCNT,LEXLC,LEXL,LEXS,LEXNC,LEXD,LEXN,LEXC,LEXGCS,LEXP,LEXT
"RTN","LEX2160",171,0)
 S LEXCK=+($G(X)),LEXND=+($G(Y))
"RTN","LEX2160",172,0)
 Q:LEXCK'>0!(LEXND'>0) -2
"RTN","LEX2160",173,0)
 S LEXL=64,(LEXCNT,LEXLC)=0,LEXS=(+(LEXND\LEXL))
"RTN","LEX2160",174,0)
 S:LEXS=0 LEXS=1 D:+($O(^LEXM(0)))>0 M("")
"RTN","LEX2160",175,0)
 S (LEXC,LEXN)="^LEXM",(LEXNC,LEXGCS)=0 W "   "
"RTN","LEX2160",176,0)
 F  S LEXN=$Q(@LEXN) Q:LEXN=""!(LEXN'[LEXC)  D
"RTN","LEX2160",177,0)
 . Q:LEXN="^LEXM(0,""CHECKSUM"")"
"RTN","LEX2160",178,0)
 . Q:LEXN="^LEXM(0,""NODES"")"
"RTN","LEX2160",179,0)
 . S LEXCNT=LEXCNT+1
"RTN","LEX2160",180,0)
 . I LEXCNT'<LEXS S LEXLC=LEXLC+1 W:LEXLC'>LEXL "." S LEXCNT=0
"RTN","LEX2160",181,0)
 . S LEXNC=LEXNC+1,LEXD=@LEXN,LEXT=LEXN_"="_LEXD
"RTN","LEX2160",182,0)
 . F LEXP=1:1:$L(LEXT) S LEXGCS=$A(LEXT,LEXP)*LEXP+LEXGCS
"RTN","LEX2160",183,0)
 Q:LEXNC'=LEXND -3
"RTN","LEX2160",184,0)
 Q:LEXGCS'=LEXCK -3
"RTN","LEX2160",185,0)
 Q 1
"RTN","LEX2160",186,0)
CM ;     Checksum Error - Missing ^LEXM
"RTN","LEX2160",187,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR D IMP D ET("Missing import global ^LEXM.") D CO
"RTN","LEX2160",188,0)
 Q
"RTN","LEX2160",189,0)
CW ;     Checksum Error - Wrong ^LEXM
"RTN","LEX2160",190,0)
 N LEXB,LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR D IMP S LEXB=$G(^LEXM(0,"BUILD"))
"RTN","LEX2160",191,0)
 I $L(LEXBUILD),$L(LEXB),LEXBUILD'=LEXB D  Q
"RTN","LEX2160",192,0)
 . D ET(("Incorrect import global ^LEXM found ("_LEXB_" global).")) D CKO
"RTN","LEX2160",193,0)
 D ET("Incorrect import global ^LEXM found.") D CKO
"RTN","LEX2160",194,0)
 Q
"RTN","LEX2160",195,0)
CU ;     Checksum Error - Unable to verify
"RTN","LEX2160",196,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR D IMP D ET(""),ET("Unable to verify checksum for import global ^LEXM (possibly corrupt).") D CKO
"RTN","LEX2160",197,0)
 Q
"RTN","LEX2160",198,0)
CF ;     Checksum Error - Failed checksum
"RTN","LEX2160",199,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR D IMP D ET("") D ET("Import global ^LEXM failed checksum.") D CKO
"RTN","LEX2160",200,0)
 Q
"RTN","LEX2160",201,0)
CO ;     Checksum Failure Fix - Obtain new global
"RTN","LEX2160",202,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR D IMP
"RTN","LEX2160",203,0)
 D ET(""),ET("    Please obtain a copy of the import global ^LEXM contained in the ")
"RTN","LEX2160",204,0)
 D ET(("    global host file "_LEXIGHF_" before continuing with the "_LEXBUILD))
"RTN","LEX2160",205,0)
 D ET(("    installation."))
"RTN","LEX2160",206,0)
 Q
"RTN","LEX2160",207,0)
CKO ;     Checksum Failure Fix - Kill and Obtain new global
"RTN","LEX2160",208,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR D IMP D ET("")
"RTN","LEX2160",209,0)
 D ET(("    Use the entry point KALL^LEXXGI2 to safely KILL the existing "))
"RTN","LEX2160",210,0)
 D ET(("    import global ^LEXM from your system.  Then obtain a new copy"))
"RTN","LEX2160",211,0)
 D ET(("    of ^LEXM contained in the global host file "_LEXIGHF_" before"))
"RTN","LEX2160",212,0)
 D ET(("    continuing with the "_LEXBUILD_" installation."))
"RTN","LEX2160",213,0)
 Q
"RTN","LEX2160",214,0)
 ;
"RTN","LEX2160",215,0)
SY(X) ;   Check System variables
"RTN","LEX2160",216,0)
 Q:'$D(IO)!('$D(IOF))!('$D(IOM))!('$D(ION))!('$D(IOSL))!('$D(IOST)) 0
"RTN","LEX2160",217,0)
 Q 1
"RTN","LEX2160",218,0)
UR(X) ;   Check User variables
"RTN","LEX2160",219,0)
 Q:'$L($G(DUZ(0))) 0
"RTN","LEX2160",220,0)
 Q:+($G(DUZ))=0!($$NOTDEF(+$G(DUZ))) 0
"RTN","LEX2160",221,0)
 Q 1
"RTN","LEX2160",222,0)
 ;               
"RTN","LEX2160",223,0)
 ; Error messages
"RTN","LEX2160",224,0)
 ;
"RTN","LEX2160",225,0)
ET(X) ;   Error Text
"RTN","LEX2160",226,0)
 N LEXI S LEXI=+($G(LEXE(0))),LEXI=LEXI+1,LEXE(LEXI)="   "_$G(X),LEXE(0)=LEXI
"RTN","LEX2160",227,0)
 Q
"RTN","LEX2160",228,0)
ED ;   Error Display
"RTN","LEX2160",229,0)
 N LEXI S LEXI=0 F  S LEXI=$O(LEXE(LEXI)) Q:+LEXI=0  D M(LEXE(LEXI))
"RTN","LEX2160",230,0)
 D M(" ") K LEXE Q
"RTN","LEX2160",231,0)
 ;                   
"RTN","LEX2160",232,0)
 ; Miscellaneous 
"RTN","LEX2160",233,0)
 ;
"RTN","LEX2160",234,0)
NOTDEF(IEN) ;   Check to see if user is defined
"RTN","LEX2160",235,0)
 N DA,DR,DIQ,LEX,DIC S DA=IEN,DR=.01,DIC=200,DIQ="LEX" D EN^DIQ1 Q '$D(LEX)
"RTN","LEX2160",236,0)
OK ;   Environment is OK
"RTN","LEX2160",237,0)
 N LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXT
"RTN","LEX2160",238,0)
 D IMP S LEXT="  Environment "_$S($L(LEXBUILD):("for patch/build "_LEXBUILD_" "),1:"")_"is ok"
"RTN","LEX2160",239,0)
 D BM(LEXT),M(" ")
"RTN","LEX2160",240,0)
 Q
"RTN","LEX2160",241,0)
BM(X) ;   Blank Line with Message
"RTN","LEX2160",242,0)
 S X=$G(X) S:$E(X,1)'=" " X=" "_X D BMES^XPDUTL(X) Q
"RTN","LEX2160",243,0)
M(X) ;   Message
"RTN","LEX2160",244,0)
 S X=$G(X) S:$E(X,1)'=" " X=" "_X D MES^XPDUTL(X) Q
"RTN","LEX2160",245,0)
TRIM(X) ;   Trim Spaces
"RTN","LEX2160",246,0)
 S X=$G(X) F  Q:$E(X,1)'=" "  S X=$E(X,2,$L(X))
"RTN","LEX2160",247,0)
 F  Q:$E(X,$L(X))'=" "  S X=$E(X,1,($L(X)-1))
"RTN","LEX2160",248,0)
 Q X
"RTN","LEX2160",249,0)
IMP ;   Import names
"RTN","LEX2160",250,0)
 ;S LEXPTYPE="Code Set SDM Ticket Fixes"
"RTN","LEX2160",251,0)
 S LEXPTYPE="Code Set Update"
"RTN","LEX2160",252,0)
 ;     Revision
"RTN","LEX2160",253,0)
 S LEXLREV=1
"RTN","LEX2160",254,0)
 ;     Required Builds Array
"RTN","LEX2160",255,0)
 ;        LEX(1)=build SEQ #^released date^subject
"RTN","LEX2160",256,0)
 ;        LEX(n)=build SEQ #^released date^subject
"RTN","LEX2160",257,0)
 S LEXREQP(1)="LEX*2.0*159 SEQ #150^3260713^CODE SET FY26 4TH QTR UPDATE"  ;seq # from FORUM ; date is release date ; patch subject
"RTN","LEX2160",258,0)
  ;     This Build Name
"RTN","LEX2160",259,0)
 S LEXBUILD="LEX*2.0*160"
"RTN","LEX2160",260,0)
 ;     This Build's Export Global Host Filename
"RTN","LEX2160",261,0)
 S LEXIGHF="LEX_2_160.GBL"
"RTN","LEX2160",262,0)
 ;     Fiscal Year
"RTN","LEX2160",263,0)
 S LEXFY="FY26"
"RTN","LEX2160",264,0)
 ;     Quarter
"RTN","LEX2160",265,0)
 S LEXQTR="4th"
"RTN","LEX2160",266,0)
 Q
"RTN","LEX2160P")
0^2^B21696857
"RTN","LEX2160P",1,0)
LEX2160P ;ISL/TJH - LEX*2.0*160 Pre/Post Install ; 08/07/2026
"RTN","LEX2160P",2,0)
 ;;2.0;LEXICON UTILITY;**160**;Sep 23, 1996;Build 2
"RTN","LEX2160P",3,0)
 ;               
"RTN","LEX2160P",4,0)
 ; Global Variables 
"RTN","LEX2160P",5,0)
 ;    ^LEXM(              N/A
"RTN","LEX2160P",6,0)
 ;               
"RTN","LEX2160P",7,0)
 ; External References
"RTN","LEX2160P",8,0)
 ; DBIA #10006
"RTN","LEX2160P",9,0)
 ; DBIA #10103
"RTN","LEX2160P",10,0)
 ; DBIA #2067
"RTN","LEX2160P",11,0)
 ; DBIA #10141
"RTN","LEX2160P",12,0)
 ; DBIA #10112
"RTN","LEX2160P",13,0)
 ; DBIA #2729
"RTN","LEX2160P",14,0)
 ; DBIA #2171   
"RTN","LEX2160P",15,0)
 ; DBIA #4440 
"RTN","LEX2160P",16,0)
 ;               
"RTN","LEX2160P",17,0)
 Q
"RTN","LEX2160P",18,0)
POST ; Post-Install
"RTN","LEX2160P",19,0)
 ;            
"RTN","LEX2160P",20,0)
 ; From IMP in the Environment Check 
"RTN","LEX2160P",21,0)
 ;            
"RTN","LEX2160P",22,0)
 ;      LEXBUILD   Build Name - LEX*2.0*nnn
"RTN","LEX2160P",23,0)
 ;      LEXPTYPE   Patch Type - Remedy or Quarterly
"RTN","LEX2160P",24,0)
 ;      LEXFY      Fiscal Year - FYnn
"RTN","LEX2160P",25,0)
 ;      LEXQTR     Quarter - 1st, 2nd, 3rd, or 4th
"RTN","LEX2160P",26,0)
 ;      LEXIGHF    Name of Host File - LEX_2_nnn.GBL
"RTN","LEX2160P",27,0)
 ;      LEXLREV    Revision - nnn
"RTN","LEX2160P",28,0)
 ;      LEXREQP    Required Builds - build;build;build
"RTN","LEX2160P",29,0)
 ;      
"RTN","LEX2160P",30,0)
 ; Note:  All references to the patch number should be
"RTN","LEX2160P",31,0)
 ;        checked and updated as necessary.
"RTN","LEX2160P",32,0)
 ;   
"RTN","LEX2160P",33,0)
 ;        The sub-routine (Informational Patch List) must
"RTN","LEX2160P",34,0)
 ;        be updated with each patch.  It should include
"RTN","LEX2160P",35,0)
 ;        (as a minimum) the patch names of all of the 
"RTN","LEX2160P",36,0)
 ;        informational patches associated with the Lexicon
"RTN","LEX2160P",37,0)
 ;        Patch.  This will update the Package file at the
"RTN","LEX2160P",38,0)
 ;        site.
"RTN","LEX2160P",39,0)
 ;
"RTN","LEX2160P",40,0)
 N LEXEDT,LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXB,LEXCD,LEXSTR,LEXLAST,LEXOK,X,Y S LEXOK=0 D IMP
"RTN","LEX2160P",41,0)
 S LEXEDT=$G(^LEXM(0,"CREATED")) D:LEXOK>0 LOAD,CON,IP
"RTN","LEX2160P",42,0)
 Q
"RTN","LEX2160P",43,0)
LOAD ; Load Data
"RTN","LEX2160P",44,0)
 ;             
"RTN","LEX2160P",45,0)
 ;      LEXSHORT   Send Short Message
"RTN","LEX2160P",46,0)
 ;      LEXMSG     Flag to send Message
"RTN","LEX2160P",47,0)
 ;            
"RTN","LEX2160P",48,0)
 N LEXSHORT,LEXMSG S LEXSHORT="",LEXMSG=""
"RTN","LEX2160P",49,0)
 S LEXSTR=$G(LEXPTYPE) S:$L($G(LEXFY))&($L($G(LEXQTR))) LEXSTR=LEXSTR_" for "_$G(LEXFY)_" "_$G(LEXQTR)_" Quarter"
"RTN","LEX2160P",50,0)
 S U="^",LEXB=$G(^LEXM(0,"BUILD")) Q:LEXB=""  Q:$G(LEXBUILD)=""
"RTN","LEX2160P",51,0)
 D:LEXB=LEXBUILD EN^LEXXGI
"RTN","LEX2160P",52,0)
LQ ; Load Quit
"RTN","LEX2160P",53,0)
 D KLEXM
"RTN","LEX2160P",54,0)
 Q
"RTN","LEX2160P",55,0)
 ;             
"RTN","LEX2160P",56,0)
KLEXM ; Subscripted Kill of ^LEXM
"RTN","LEX2160P",57,0)
 H 2 N DA S DA=0 F  S DA=$O(^LEXM(DA)) Q:+DA=0  K ^LEXM(DA)
"RTN","LEX2160P",58,0)
 N LEX S LEX=$G(^LEXM(0,"PRO")) K ^LEXM(0)
"RTN","LEX2160P",59,0)
 Q
"RTN","LEX2160P",60,0)
 ;
"RTN","LEX2160P",61,0)
IP ; Informational Patches
"RTN","LEX2160P",62,0)
 N LEX,LEXP,LEXPS,LEXSQ,LEXT,LEXI,LEXE,LEXX,LEXC,LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXSUB,LEXOK D IMP S LEXSUB=""
"RTN","LEX2160P",63,0)
 I $G(LEXPTYPE)="Code Set Update",$G(LEXFY)["FY",$L($G(LEXQTR)) S LEXSUB="Code Set "_LEXFY_" "_LEXQTR_" Qtr Update"
"RTN","LEX2160P",64,0)
 S LEXC=0 F LEXI=1:1 D  Q:'$L(LEXX)
"RTN","LEX2160P",65,0)
 . S LEXX="" S LEXE="S LEXX=$T(IPL+"_LEXI_")" X LEXE S:'$L($TR($G(LEXX),";","")) LEXX="" Q:'$L(LEXX)  S LEXPS=$P(LEXX,";;",2) S:$L(LEXPS,"*")=3 LEXC=LEXC+1
"RTN","LEX2160P",66,0)
 I LEXC>0 S LEXT=" Informational Patch"_$S(+($G(LEXC))>1:"es",1:"") S:$L(LEXSUB) LEXT=LEXT_" for the "_LEXSUB S LEXT=LEXT_":" D MES^XPDUTL(LEXT)
"RTN","LEX2160P",67,0)
 S LEXC=0 F LEXI=1:1 D  Q:'$L(LEXX)
"RTN","LEX2160P",68,0)
 . S LEXX="" S LEXE="S LEXX=$T(IPL+"_LEXI_")" X LEXE S:'$L($TR($G(LEXX),";","")) LEXX="" Q:'$L(LEXX)  S LEXPS=$P(LEXX,";;",2) S:'$L(LEXPS) LEXX="" Q:'$L(LEXX)
"RTN","LEX2160P",69,0)
 . S LEXSQ=+($P(LEXX,";;",3)) S:+LEXSQ>0 LEXPS=LEXPS_" SEQ #"_LEXSQ S LEXC=LEXC+1 D:LEXC=1 MES^XPDUTL(" ")
"RTN","LEX2160P",70,0)
 . W:$D(LEXTEST) !,?5,LEXPS D:'$D(LEXTEST) IPU(LEXPS)
"RTN","LEX2160P",71,0)
 D:LEXC>0 MES^XPDUTL(" ") N LEXTEST
"RTN","LEX2160P",72,0)
 Q
"RTN","LEX2160P",73,0)
IPU(X) ;   Patch Update
"RTN","LEX2160P",74,0)
 N LEXID,LEXOP,LEXPC,LEXPK,LEXPKI,LEXPN,LEXPTI,LEXSQ,LEXT,LEXVR,LEXVRI,LEXAR
"RTN","LEX2160P",75,0)
 S LEXPC=$G(X),LEXSQ=$P(LEXPC," ",2,299),LEXID=$P(LEXPC," ",1),LEXOP=""
"RTN","LEX2160P",76,0)
 S LEXPK=$S($P(LEXPC,"*",1)="ICD":"DRG GROUPER",$P(LEXPC,"*",1)="ICPT":"CPT/HCPCS CODES",$P(LEXPC,"*",1)="LEX":"LEXICON UTILITY",1:"") Q:'$L(LEXPK)
"RTN","LEX2160P",77,0)
 S LEXPKI=$$PIEN(LEXPK) Q:+LEXPKI'>0  S LEXVR=$P(LEXPC,"*",2) Q:'$L(LEXVR)  Q:LEXVR'["."  S LEXPN=$P(LEXPC,"*",3) Q:'$L(LEXPN)  Q:+LEXPN'>0
"RTN","LEX2160P",78,0)
 S LEXAR=LEXPN_"^"_$$NOW^XLFDT_"^"_$G(DUZ)
"RTN","LEX2160P",79,0)
 I $L($G(LEXBUILD)) S LEXOP=$$PKGPAT^XPDIP(LEXPKI,LEXVR,.LEXAR)
"RTN","LEX2160P",80,0)
 S LEXVRI=$P(LEXOP,"^",1),LEXPTI=$P(LEXOP,"^",2)
"RTN","LEX2160P",81,0)
 S LEXT="   "_LEXID,LEXT=LEXT_$J(" ",(17-$L(LEXT)))_LEXSQ,LEXT=LEXT_$J(" ",(28-$L(LEXT)))_LEXPK
"RTN","LEX2160P",82,0)
 I $L(LEXOP),LEXPTI>0 S LEXT=LEXT_$J(" ",(46-$L(LEXT)))_"Patch History updated" D MES^XPDUTL(LEXT)
"RTN","LEX2160P",83,0)
 I $L(LEXOP),LEXPTI'>0 S LEXT=LEXT_$J(" ",(46-$L(LEXT)))_"Patch History not updated" D MES^XPDUTL(LEXT)
"RTN","LEX2160P",84,0)
 I '$L(LEXOP) D MES^XPDUTL(LEXT)
"RTN","LEX2160P",85,0)
 Q
"RTN","LEX2160P",86,0)
IPL ;   Patch List  ;;Patch;;Sequence # This is also where you would include the ICPT/ICD patch number(s).
"RTN","LEX2160P",87,0)
 ;;ICPT*6.0*125;;
"RTN","LEX2160P",88,0)
 ;;;;
"RTN","LEX2160P",89,0)
 ;;;;;;
"RTN","LEX2160P",90,0)
 Q
"RTN","LEX2160P",91,0)
PRE ; Pre-Install              (N/A for this patch)
"RTN","LEX2160P",92,0)
 Q
"RTN","LEX2160P",93,0)
CON ; Conversion of data       (N/A for this patch)
"RTN","LEX2160P",94,0)
 Q
"RTN","LEX2160P",95,0)
 ;            
"RTN","LEX2160P",96,0)
 ; Miscellaneous
"RTN","LEX2160P",97,0)
PIEN(X) ;   Package IEN
"RTN","LEX2160P",98,0)
 N DIC,DTOUT,DTOUT,Y S X=$G(X),DIC="^DIC(9.4,",DIC(0)="B" D ^DIC S X=+Y
"RTN","LEX2160P",99,0)
 Q X
"RTN","LEX2160P",100,0)
IMP ;   Call IMP in Environment Check
"RTN","LEX2160P",101,0)
 K LEXBUILD,LEXFY,LEXIGHF,LEXLREV,LEXPTYPE,LEXQTR,LEXREQP N LEXF
"RTN","LEX2160P",102,0)
 S LEXF=$P($T(+1)," ",1) S:$E(LEXF,$L(LEXF))="P" LEXF=$E(LEXF,1,($L(LEXF)-1)) Q:'$L(LEXF)
"RTN","LEX2160P",103,0)
 S LEXF="IMP^"_LEXF Q:'$L($T(@LEXF))  D @LEXF S:$L(LEXBUILD) LEXOK=1
"RTN","LEX2160P",104,0)
 Q
"VER")
8.0^22.2
**END**
**END**
