- LEX2052 ;ISL/KER - LEX*2.0*52 Environment Check ;08/18/2007
- ;;2.0;LEXICON UTILITY;**52**;Sep 23, 1996;Build 25
- ;
- ; Global Variables
- ; None
- ;
- ; External References
- ; EN^DIQ1 DBIA 10015
- ; $$PATCH^XPDUTL DBIA 10141
- ; $$VERSION^XPDUTL DBIA 10141
- ; BMES^XPDUTL DBIA 10141
- ; MES^XPDUTL DBIA 10141
- ;
- ; Variables NEWed or KILLed elsewhere
- ; XPDABORT Kernel Systems Manual pg 454
- ; XPDQUIT Kernel Systems Manual pg 454
- ;
- ; Special Variables
- ; XPDDIQ("XPZ1") Kernel Systems Manual pg 456
- ; XPDDIQ("XPI1") FORUM Message #45828644
- ;
- ENV ; LEX*2.0*52 Environment Check
- ;
- ; General
- ;
- N LEXPTYPE,LEXLREV,LEXREQP,LEXBLDS,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXG,LEXE,LEXSTR D IMP
- K XPDDIQ("XPZ1","B"),XPDDIQ("XPI1","B") S XPDDIQ("XPZ1","B")="NO",XPDDIQ("XPI1","B")="NO"
- S LEXSTR=$G(LEXPTYPE) S:$L($G(LEXFY))&($L($G(LEXQTR))) LEXSTR=LEXSTR_" for "_$G(LEXFY)_" "_$G(LEXQTR)_" Quarter"
- D BM(LEXSTR),M("")
- S U="^"
- ; No user
- D:+($$UR)'>0 ET("User not defined (DUZ)")
- ; No IO
- D:+($$SY)'>0 ET("Undefined IO variable(s)")
- I $D(LEXE) D ABRT Q
- ;
- ; Load Distribution
- ;
- ; XPDENV = 0 Environment Check during Load
- ;
- ; Check Version (2.0)
- I $$VERSION^XPDUTL("LEX")'="2.0" D D ABRT Q
- . D ET("Version 2.0 not found. Please install Lexicon Utility v 2.0")
- ;
- ; Check Required Patches
- D:'$L($G(LEXREQP)) IMP I $L(LEXREQP) D
- . N LEXPAT,LEXI,LEXPN
- . F LEXI=1:1 Q:'$L($P(LEXREQP,";",LEXI)) S LEXPAT=$P(LEXREQP,";",LEXI) D
- . . S LEXPN=$$PATCH^XPDUTL(LEXPAT) W !," Checking for ",LEXPAT H 1 W:+LEXPN>0 ?31," installed" W:+LEXPN'>0 ?31," missing"
- . . I +LEXPN'>0 D ET((LEXPAT_" not found, please install "_LEXPAT_" before continuing"))
- I $D(LEXE) D ABRT Q
- QUIT ; Quit Passed Environment Check
- K LEXFULL D OK
- Q
- EXIT ; Exit Failed Environment Check
- D:$D(LEXE) ED S XPDQUIT=2 K LEXE,LEXFULL Q
- ABRT ; Abort Failed Environment Check, KILL the distribution
- D:$D(LEXE) ED S XPDABORT=1,XPDQUIT=1
- S (XPDQUIT("LEX*2.0*52"),XPDQUIT("ICPT*6.0*37"))=1
- K LEXE,LEXFULL
- Q
- ;
- ; Checks
- ;
- SY(X) ; Check System variables
- Q:'$D(IO)!('$D(IOF))!('$D(IOM))!('$D(ION))!('$D(IOSL))!('$D(IOST)) 0
- Q 1
- UR(X) ; Check User variables
- Q:'$L($G(DUZ(0))) 0
- Q:+($G(DUZ))=0!($$NOTDEF(+$G(DUZ))) 0
- Q 1
- ;
- ; Error messages
- ;
- ET(X) ; Error Text
- N LEXI S LEXI=+($G(LEXE(0))),LEXI=LEXI+1,LEXE(LEXI)=" "_$G(X),LEXE(0)=LEXI
- Q
- ED ; Error Display
- N LEXI,LEXC S (LEXI,LEXC)=0 F S LEXI=$O(LEXE(LEXI)) Q:+LEXI=0 S LEXC=LEXC+1 D:LEXC=1 M(" ") D M(LEXE(LEXI))
- D M(" ") K LEXE Q
- ;
- ; Miscellaneous
- ;
- NOTDEF(IEN) ; Check to see if user is defined
- N DA,DR,DIQ,LEX,DIC S DA=IEN,DR=.01,DIC=200,DIQ="LEX" D EN^DIQ1 Q '$D(LEX)
- OK ; Environment is OK
- N LEXPTYPE,LEXLREV,LEXREQP,LEXBLDS,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXT
- D IMP S LEXT=" Environment "_$S($L(LEXBLDS):("for patch/build "_LEXBLDS_" "),1:"")_"is ok"
- D BM(LEXT),M(" ")
- Q
- BM(X) ; Blank Line with Message
- D BMES^XPDUTL($G(X)) Q
- M(X) ; Message
- D MES^XPDUTL($G(X)) Q
- TRIM(X) ; Trim Spaces
- S X=$G(X) F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
- F Q:$E(X,$L(X))'=" " S X=$E(X,1,($L(X)-1))
- Q X
- IMP ; Import names
- ; Patch Type
- S LEXPTYPE="Lexicon/CPT Remedy Ticket Fixes"
- ; Revision
- S LEXLREV="52"
- ; Required Builds
- S LEXREQP="LEX*2.0*50"
- ; This Build Name
- S LEXBLDS="LEX*2.0*52/ICPT*6.0*37",LEXBUILD=$P(LEXBLDS,"/",1)
- ; This Build's Export Global Host Filename
- S LEXIGHF=""
- ; Fiscal Year
- S LEXFY=""
- ; Quarter
- S LEXQTR=""
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLEX2052 3810 printed Feb 18, 2025@23:30:24 Page 2
- LEX2052 ;ISL/KER - LEX*2.0*52 Environment Check ;08/18/2007
- +1 ;;2.0;LEXICON UTILITY;**52**;Sep 23, 1996;Build 25
- +2 ;
- +3 ; Global Variables
- +4 ; None
- +5 ;
- +6 ; External References
- +7 ; EN^DIQ1 DBIA 10015
- +8 ; $$PATCH^XPDUTL DBIA 10141
- +9 ; $$VERSION^XPDUTL DBIA 10141
- +10 ; BMES^XPDUTL DBIA 10141
- +11 ; MES^XPDUTL DBIA 10141
- +12 ;
- +13 ; Variables NEWed or KILLed elsewhere
- +14 ; XPDABORT Kernel Systems Manual pg 454
- +15 ; XPDQUIT Kernel Systems Manual pg 454
- +16 ;
- +17 ; Special Variables
- +18 ; XPDDIQ("XPZ1") Kernel Systems Manual pg 456
- +19 ; XPDDIQ("XPI1") FORUM Message #45828644
- +20 ;
- ENV ; LEX*2.0*52 Environment Check
- +1 ;
- +2 ; General
- +3 ;
- +4 NEW LEXPTYPE,LEXLREV,LEXREQP,LEXBLDS,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXG,LEXE,LEXSTR
- DO IMP
- +5 KILL XPDDIQ("XPZ1","B"),XPDDIQ("XPI1","B")
- SET XPDDIQ("XPZ1","B")="NO"
- SET XPDDIQ("XPI1","B")="NO"
- +6 SET LEXSTR=$GET(LEXPTYPE)
- if $LENGTH($GET(LEXFY))&($LENGTH($GET(LEXQTR)))
- SET LEXSTR=LEXSTR_" for "_$GET(LEXFY)_" "_$GET(LEXQTR)_" Quarter"
- +7 DO BM(LEXSTR)
- DO M("")
- +8 SET U="^"
- +9 ; No user
- +10 if +($$UR)'>0
- DO ET("User not defined (DUZ)")
- +11 ; No IO
- +12 if +($$SY)'>0
- DO ET("Undefined IO variable(s)")
- +13 IF $DATA(LEXE)
- DO ABRT
- QUIT
- +14 ;
- +15 ; Load Distribution
- +16 ;
- +17 ; XPDENV = 0 Environment Check during Load
- +18 ;
- +19 ; Check Version (2.0)
- +20 IF $$VERSION^XPDUTL("LEX")'="2.0"
- Begin DoDot:1
- +21 DO ET("Version 2.0 not found. Please install Lexicon Utility v 2.0")
- End DoDot:1
- DO ABRT
- QUIT
- +22 ;
- +23 ; Check Required Patches
- +24 if '$LENGTH($GET(LEXREQP))
- DO IMP
- IF $LENGTH(LEXREQP)
- Begin DoDot:1
- +25 NEW LEXPAT,LEXI,LEXPN
- +26 FOR LEXI=1:1
- if '$LENGTH($PIECE(LEXREQP,";",LEXI))
- QUIT
- SET LEXPAT=$PIECE(LEXREQP,";",LEXI)
- Begin DoDot:2
- +27 SET LEXPN=$$PATCH^XPDUTL(LEXPAT)
- WRITE !," Checking for ",LEXPAT
- HANG 1
- if +LEXPN>0
- WRITE ?31," installed"
- if +LEXPN'>0
- WRITE ?31," missing"
- +28 IF +LEXPN'>0
- DO ET((LEXPAT_" not found, please install "_LEXPAT_" before continuing"))
- End DoDot:2
- End DoDot:1
- +29 IF $DATA(LEXE)
- DO ABRT
- QUIT
- QUIT ; Quit Passed Environment Check
- +1 KILL LEXFULL
- DO OK
- +2 QUIT
- EXIT ; Exit Failed Environment Check
- +1 if $DATA(LEXE)
- DO ED
- SET XPDQUIT=2
- KILL LEXE,LEXFULL
- QUIT
- ABRT ; Abort Failed Environment Check, KILL the distribution
- +1 if $DATA(LEXE)
- DO ED
- SET XPDABORT=1
- SET XPDQUIT=1
- +2 SET (XPDQUIT("LEX*2.0*52"),XPDQUIT("ICPT*6.0*37"))=1
- +3 KILL LEXE,LEXFULL
- +4 QUIT
- +5 ;
- +6 ; Checks
- +7 ;
- SY(X) ; Check System variables
- +1 if '$DATA(IO)!('$DATA(IOF))!('$DATA(IOM))!('$DATA(ION))!('$DATA(IOSL))!('$DATA(IOST))
- QUIT 0
- +2 QUIT 1
- UR(X) ; Check User variables
- +1 if '$LENGTH($GET(DUZ(0)))
- QUIT 0
- +2 if +($GET(DUZ))=0!($$NOTDEF(+$GET(DUZ)))
- QUIT 0
- +3 QUIT 1
- +4 ;
- +5 ; Error messages
- +6 ;
- ET(X) ; Error Text
- +1 NEW LEXI
- SET LEXI=+($GET(LEXE(0)))
- SET LEXI=LEXI+1
- SET LEXE(LEXI)=" "_$GET(X)
- SET LEXE(0)=LEXI
- +2 QUIT
- ED ; Error Display
- +1 NEW LEXI,LEXC
- SET (LEXI,LEXC)=0
- FOR
- SET LEXI=$ORDER(LEXE(LEXI))
- if +LEXI=0
- QUIT
- SET LEXC=LEXC+1
- if LEXC=1
- DO M(" ")
- DO M(LEXE(LEXI))
- +2 DO M(" ")
- KILL LEXE
- QUIT
- +3 ;
- +4 ; Miscellaneous
- +5 ;
- NOTDEF(IEN) ; Check to see if user is defined
- +1 NEW DA,DR,DIQ,LEX,DIC
- SET DA=IEN
- SET DR=.01
- SET DIC=200
- SET DIQ="LEX"
- DO EN^DIQ1
- QUIT '$DATA(LEX)
- OK ; Environment is OK
- +1 NEW LEXPTYPE,LEXLREV,LEXREQP,LEXBLDS,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXT
- +2 DO IMP
- SET LEXT=" Environment "_$SELECT($LENGTH(LEXBLDS):("for patch/build "_LEXBLDS_" "),1:"")_"is ok"
- +3 DO BM(LEXT)
- DO M(" ")
- +4 QUIT
- BM(X) ; Blank Line with Message
- +1 DO BMES^XPDUTL($GET(X))
- QUIT
- M(X) ; Message
- +1 DO MES^XPDUTL($GET(X))
- QUIT
- TRIM(X) ; Trim Spaces
- +1 SET X=$GET(X)
- FOR
- if $EXTRACT(X,1)'=" "
- QUIT
- SET X=$EXTRACT(X,2,$LENGTH(X))
- +2 FOR
- if $EXTRACT(X,$LENGTH(X))'=" "
- QUIT
- SET X=$EXTRACT(X,1,($LENGTH(X)-1))
- +3 QUIT X
- IMP ; Import names
- +1 ; Patch Type
- +2 SET LEXPTYPE="Lexicon/CPT Remedy Ticket Fixes"
- +3 ; Revision
- +4 SET LEXLREV="52"
- +5 ; Required Builds
- +6 SET LEXREQP="LEX*2.0*50"
- +7 ; This Build Name
- +8 SET LEXBLDS="LEX*2.0*52/ICPT*6.0*37"
- SET LEXBUILD=$PIECE(LEXBLDS,"/",1)
- +9 ; This Build's Export Global Host Filename
- +10 SET LEXIGHF=""
- +11 ; Fiscal Year
- +12 SET LEXFY=""
- +13 ; Quarter
- +14 SET LEXQTR=""
- +15 QUIT