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

LEX2052.m

Go to the documentation of this file.
  1. LEX2052 ;ISL/KER - LEX*2.0*52 Environment Check ;08/18/2007
  1. ;;2.0;LEXICON UTILITY;**52**;Sep 23, 1996;Build 25
  1. ;
  1. ; Global Variables
  1. ; None
  1. ;
  1. ; External References
  1. ; EN^DIQ1 DBIA 10015
  1. ; $$PATCH^XPDUTL DBIA 10141
  1. ; $$VERSION^XPDUTL DBIA 10141
  1. ; BMES^XPDUTL DBIA 10141
  1. ; MES^XPDUTL DBIA 10141
  1. ;
  1. ; Variables NEWed or KILLed elsewhere
  1. ; XPDABORT Kernel Systems Manual pg 454
  1. ; XPDQUIT Kernel Systems Manual pg 454
  1. ;
  1. ; Special Variables
  1. ; XPDDIQ("XPZ1") Kernel Systems Manual pg 456
  1. ; XPDDIQ("XPI1") FORUM Message #45828644
  1. ;
  1. ENV ; LEX*2.0*52 Environment Check
  1. ;
  1. ; General
  1. ;
  1. N LEXPTYPE,LEXLREV,LEXREQP,LEXBLDS,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXG,LEXE,LEXSTR D IMP
  1. K XPDDIQ("XPZ1","B"),XPDDIQ("XPI1","B") S XPDDIQ("XPZ1","B")="NO",XPDDIQ("XPI1","B")="NO"
  1. S LEXSTR=$G(LEXPTYPE) S:$L($G(LEXFY))&($L($G(LEXQTR))) LEXSTR=LEXSTR_" for "_$G(LEXFY)_" "_$G(LEXQTR)_" Quarter"
  1. D BM(LEXSTR),M("")
  1. S U="^"
  1. ; No user
  1. D:+($$UR)'>0 ET("User not defined (DUZ)")
  1. ; No IO
  1. D:+($$SY)'>0 ET("Undefined IO variable(s)")
  1. I $D(LEXE) D ABRT Q
  1. ;
  1. ; Load Distribution
  1. ;
  1. ; XPDENV = 0 Environment Check during Load
  1. ;
  1. ; Check Version (2.0)
  1. I $$VERSION^XPDUTL("LEX")'="2.0" D D ABRT Q
  1. . D ET("Version 2.0 not found. Please install Lexicon Utility v 2.0")
  1. ;
  1. ; Check Required Patches
  1. D:'$L($G(LEXREQP)) IMP I $L(LEXREQP) D
  1. . N LEXPAT,LEXI,LEXPN
  1. . F LEXI=1:1 Q:'$L($P(LEXREQP,";",LEXI)) S LEXPAT=$P(LEXREQP,";",LEXI) D
  1. . . S LEXPN=$$PATCH^XPDUTL(LEXPAT) W !," Checking for ",LEXPAT H 1 W:+LEXPN>0 ?31," installed" W:+LEXPN'>0 ?31," missing"
  1. . . I +LEXPN'>0 D ET((LEXPAT_" not found, please install "_LEXPAT_" before continuing"))
  1. I $D(LEXE) D ABRT Q
  1. QUIT ; Quit Passed Environment Check
  1. K LEXFULL D OK
  1. Q
  1. EXIT ; Exit Failed Environment Check
  1. D:$D(LEXE) ED S XPDQUIT=2 K LEXE,LEXFULL Q
  1. ABRT ; Abort Failed Environment Check, KILL the distribution
  1. D:$D(LEXE) ED S XPDABORT=1,XPDQUIT=1
  1. S (XPDQUIT("LEX*2.0*52"),XPDQUIT("ICPT*6.0*37"))=1
  1. K LEXE,LEXFULL
  1. Q
  1. ;
  1. ; Checks
  1. ;
  1. SY(X) ; Check System variables
  1. Q:'$D(IO)!('$D(IOF))!('$D(IOM))!('$D(ION))!('$D(IOSL))!('$D(IOST)) 0
  1. Q 1
  1. UR(X) ; Check User variables
  1. Q:'$L($G(DUZ(0))) 0
  1. Q:+($G(DUZ))=0!($$NOTDEF(+$G(DUZ))) 0
  1. Q 1
  1. ;
  1. ; Error messages
  1. ;
  1. ET(X) ; Error Text
  1. N LEXI S LEXI=+($G(LEXE(0))),LEXI=LEXI+1,LEXE(LEXI)=" "_$G(X),LEXE(0)=LEXI
  1. Q
  1. ED ; Error Display
  1. 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))
  1. D M(" ") K LEXE Q
  1. ;
  1. ; Miscellaneous
  1. ;
  1. NOTDEF(IEN) ; Check to see if user is defined
  1. N DA,DR,DIQ,LEX,DIC S DA=IEN,DR=.01,DIC=200,DIQ="LEX" D EN^DIQ1 Q '$D(LEX)
  1. OK ; Environment is OK
  1. N LEXPTYPE,LEXLREV,LEXREQP,LEXBLDS,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXT
  1. D IMP S LEXT=" Environment "_$S($L(LEXBLDS):("for patch/build "_LEXBLDS_" "),1:"")_"is ok"
  1. D BM(LEXT),M(" ")
  1. Q
  1. BM(X) ; Blank Line with Message
  1. D BMES^XPDUTL($G(X)) Q
  1. M(X) ; Message
  1. D MES^XPDUTL($G(X)) Q
  1. TRIM(X) ; Trim Spaces
  1. S X=$G(X) F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
  1. F Q:$E(X,$L(X))'=" " S X=$E(X,1,($L(X)-1))
  1. Q X
  1. IMP ; Import names
  1. ; Patch Type
  1. S LEXPTYPE="Lexicon/CPT Remedy Ticket Fixes"
  1. ; Revision
  1. S LEXLREV="52"
  1. ; Required Builds
  1. S LEXREQP="LEX*2.0*50"
  1. ; This Build Name
  1. S LEXBLDS="LEX*2.0*52/ICPT*6.0*37",LEXBUILD=$P(LEXBLDS,"/",1)
  1. ; This Build's Export Global Host Filename
  1. S LEXIGHF=""
  1. ; Fiscal Year
  1. S LEXFY=""
  1. ; Quarter
  1. S LEXQTR=""
  1. Q