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

LEX2073.m

Go to the documentation of this file.
  1. LEX2073 ;ISL/KER - LEX*2.0*73 Env Check ;01/03/2011
  1. ;;2.0;LEXICON UTILITY;**73**;Sep 23, 1996;Build 10
  1. ;
  1. ; Global Variables
  1. ; ^TMP("LEXKID",$J) SACC 2.3.2.5.1
  1. ; ^TMP("LEXMSG",$J) SACC 2.3.2.5.1
  1. ;
  1. ; External References
  1. ; ^DIC ICR 10006
  1. ; $$GET1^DIQ ICR 2056
  1. ; EN^DIQ1 ICR 10015
  1. ; ^XMD ICR 10070
  1. ; $$PATCH^XPDUTL ICR 10141
  1. ; $$VERSION^XPDUTL ICR 10141
  1. ; BMES^XPDUTL ICR 10141
  1. ; MES^XPDUTL ICR 10141
  1. ;
  1. ; Local Variables NEWed or KILLed Elsewhere
  1. ; XPDABORT,XPDDIQ,XPDENV,XPDQUIT
  1. ;
  1. ENV ; LEX*2.0*73 Environment Check
  1. ; Checks
  1. N LEXPTYPE,LEXLREV,LEXREQP,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 U="^"
  1. ; User Variables
  1. D:+($$UR)'>0 ET("User not defined (DUZ)")
  1. ; System Variables
  1. D:+($$SY)'>0 ET("Undefined IO variable(s)")
  1. I $D(LEXE) D ABRT Q
  1. ; Version Number
  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. ; Required Patches
  1. D:'$L($G(LEXREQP)) IMP I $L(LEXREQP) D
  1. . N LEXPAT,LEXI,LEXPN,LEXP,LEXR,LEXC,LEXO,LEXC1,LEXC2,LEXC3 S (LEXR,LEXC)=0 S LEXC1=5,(LEXC2,LEXC3)=20
  1. . F LEXI=1:1 Q:'$L($P(LEXREQP,";",LEXI)) S LEXC=LEXC+1,LEXPAT=$P(LEXREQP,";",LEXI) S:$P(LEXPAT,"^",2)?7N LEXR=LEXR+1,LEXC3=LEXC2+13
  1. . F LEXI=1:1 Q:'$L($P(LEXREQP,";",LEXI)) S LEXPAT=$P(LEXREQP,";",LEXI) D
  1. . . N LEXREL,LEXINS,LEXINE S LEXREL=$P(LEXPAT,"^",2),LEXPAT=$P(LEXPAT,"^",1)
  1. . . S LEXPN=$$PATCH^XPDUTL(LEXPAT),LEXINS=$$INS(LEXPAT),LEXINE=$P(LEXINS,"^",2)
  1. . . W:LEXI=1 !,?3,"Checking for ",?LEXC2,$S(+($G(LEXR))>0:"Released",1:"")
  1. . . W !,?LEXC1,LEXPAT
  1. . . I LEXREL?7N W ?LEXC2,$TR($$FMTE^XLFDT(LEXREL,"5DZ"),"@"," ")
  1. . . I +LEXPN>0 H 1 S LEXO=+($G(LEXO))+1 W ?LEXC3,"Installed " W:$L($G(LEXINE)) LEXINE
  1. . . I +LEXPN'>0 D ET((" "_LEXPAT_" not found, please install "_LEXPAT_" before continuing"))
  1. . W:+($G(LEXO))'=LEXC !
  1. I $D(LEXE) D ABRT Q
  1. I '$D(LEXFULL)&(+($G(XPDENV))'=1) D QUIT Q
  1. ; Quit, Exit or Abort
  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,XPDQUIT("LEX*2.0*73")=1,XPDQUIT("ICD*18.0*40")=1,XPDQUIT("ICPT*6.0*46")=1
  1. K LEXE,LEXFULL
  1. Q
  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. 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 S LEXI=0 F S LEXI=$O(LEXE(LEXI)) Q:+LEXI=0 D M(LEXE(LEXI))
  1. D M(" ") K LEXE Q
  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,LEXBUILD,LEXIGHF,LEXFY,LEXQTR,LEXT
  1. D IMP S LEXT=" Environment "_$S($L(LEXBUILD):("for patch/build "_LEXBUILD_" "),1:"")_"is ok"
  1. D BM(LEXT),M(" ")
  1. Q
  1. MAIL ; Mail global array in message
  1. N DIFROM,LEXPRI,LEXADR,LEXI,LEXM,LEXSUB,XCNP,XMDUZ,XMSCR,XMSUB,XMTEXT,XMY,XMZ,LEXPTYPE,LEXLREV,LEXREQP,LEXBUILD,LEXIGHF,LEXFY,LEXQTR
  1. D IMP K ^TMP("LEXMSG",$J) S LEXSUB="Lexicon/ICD/CPT Installation" S:$L($G(LEXBUILD)) LEXSUB=$G(LEXBUILD)_" Installation"
  1. S LEXPRI=$$ADR G:'$L(LEXPRI) MAILQ S LEXPRI="G.LEXINS@"_LEXPRI S LEXADR=$$GET1^DIQ(200,+($G(DUZ)),.01) G:'$L(LEXADR) MAILQ
  1. S XMSUB=LEXSUB S LEXI=0 F S LEXI=$O(^TMP("LEXKID",$J,LEXI)) Q:+LEXI=0 D
  1. . S LEXM=+($O(^TMP("LEXMSG",$J," "),-1))+1,^TMP("LEXMSG",$J,LEXM,0)=$E($G(^TMP("LEXKID",$J,LEXI)),1,79),^TMP("LEXMSG",$J,0)=LEXM
  1. K ^TMP("LEXKID",$J) G:'$D(^TMP("LEXMSG",$J)) MAILQ G:+($G(^TMP("LEXMSG",$J,0)))'>0 MAILQ S XMY(LEXPRI)="",XMY(LEXADR)=""
  1. S XMTEXT="^TMP(""LEXMSG"",$J,",XMDUZ=.5 D ^XMD
  1. MAILQ ; Quit Mail
  1. D KILL K XCNP,XMSCR,XMDUZ,XMY,XMZ,XMSUB,XMY,XMTEXT,XMDUZ
  1. Q
  1. ADR(LEX) ; Mailing Address
  1. N DIC,DTOUT,DUOUT,X,Y S DIC="^DIC(4.2,",DIC(0)="M",(LEX,X)="FO-SLC.DOMAIN.EXT" D ^DIC Q:+Y>0 LEX
  1. S DIC="^DIC(4.2,",DIC(0)="M",(LEX,X)="ISC-SLC.DOMAIN.EXT" D ^DIC Q:+Y>0 LEX
  1. Q "ISC-SLC.DOMAIN.EXT"
  1. KILL ; Kill all ^TMP(
  1. K ^TMP("LEXMSG",$J),^TMP("LEXKID",$J)
  1. Q
  1. INS(X) ; Installed on
  1. N DA,LEXDA,LEXE,LEXI,LEXMSG,LEXNS,LEXOUT,LEXPI,LEXPN,LEXSCR,LEXVI,LEXVR S LEXNS=$P(X,"*",1),LEXVR=$P(X,"*",2),LEXPN=$P(X,"*",3)
  1. Q:'$L(LEXNS) "" S LEXVR=+LEXVR Q:LEXVR'>0 "" S LEXPN=+LEXPN Q:+LEXPN'>0 "" S:LEXVR'["." LEXVR=LEXVR_".0"
  1. S LEXSCR="I $G(^DIC(9.4,+($G(Y)),""VERSION""))="""_LEXVR_""""
  1. D FIND^DIC(9.4,,.01,"O",LEXNS,10,"C",LEXSCR,,"LEXOUT","LEXMSG")
  1. S LEXPI=$G(LEXOUT("DILIST",2,1)) K LEXOUT,LEXMSG Q:+LEXPI'>0 "" Q:'$D(@("^DIC(9.4,"_LEXPI_",22)")) ""
  1. K DA S DA(1)=LEXPI S LEXDA=$$IENS^DILF(.DA)
  1. D FIND^DIC(9.49,LEXDA,.01,"O",LEXVR,10,"B",,,"LEXOUT","LEXMSG")
  1. S LEXVI=$G(LEXOUT("DILIST",2,1)) K LEXOUT,LEXMSG Q:+LEXVI'>0 "" Q:'$D(@("^DIC(9.4,"_LEXPI_",22,"_LEXVI_",""PAH"")")) ""
  1. K DA S DA(2)=LEXPI,DA(1)=LEXVI S LEXDA=$$IENS^DILF(.DA)
  1. S LEXSCR="I $G(^DIC(9.4,"_LEXPI_",22,"_LEXVI_",""PAH"",+($G(Y)),0))[""SEQ #"""
  1. D FIND^DIC(9.4901,LEXDA,".01;.02I",,LEXPN,10,"B",LEXSCR,,"LEXOUT","LEXMSG")
  1. S LEXI=$G(LEXOUT("DILIST","ID",1,.02)) Q:'$L(LEXI) "" Q:$P(LEXI,".",1)'?7N ""
  1. S LEXE=$TR($$FMTE^XLFDT(LEXI,"5DZ"),"@"," ") Q:'$L(LEXE) "" S X=LEXI_"^"_LEXE
  1. Q X
  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. S LEXPTYPE="Code Set Field Deletions",LEXLREV="73"
  1. ;S LEXREL=3101006
  1. S LEXREQP="LEX*2.0*72^3101006"
  1. S LEXBUILD="LEX*2.0*73",LEXIGHF="",LEXFY="",LEXQTR=""
  1. Q