source: FOIAVistA/trunk/r/LEXICON_UTILITY-LEX-GMPT/LEXXII.m@ 1354

Last change on this file since 1354 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 6.1 KB
Line 
1LEXXII ;ISL/KER - Lexicon Status (Install Info) ;06/06/2007
2 ;;2.0;LEXICON UTILITY;**32,46,49,50,41**;Sep 23, 1996;Build 34
3 ;
4 ; Variables NEWed or KILLed Elsewhere
5 ; LEXACCT NEWed by LEXXFI sending message
6 ; LEXID NEWed by LEXXFI sending message
7 ; LEXCRE NEWed by LEXXGI loading data
8 ; LEXIGHF NEWed by Post Install routine LEX20nnP
9 ; XPDA NEWed by KIDS during Install
10 ;
11 ; Global Variables
12 ; DBIA 10096 ^%ZOSF("PROD"
13 ; DBIA 10096 ^%ZOSF("UCI"
14 ; DBIA 10060 ^VA(200
15 ; ^LEXM(0
16 ; ^TMP("LEX*",$J SACC 2.3.2.5.1
17 ;
18 ; External References
19 ; DBIA 10103 $$FMTE^XLFDT
20 ; DBIA 10103 $$NOW^XLFDT
21 ; DBIA 10103 $$FMDIFF^XLFDT
22 ; DBIA 2056 $$GET1^DIQ (file #200)
23 ; DBIA 2051 FIND^DIC
24 ; DBIA 2056 GETS^DIQ
25 ;
26EN ; Main Entry
27 N LEXSUB S LEXSUB=$G(LEXID) S:LEXSUB="" LEXSUB="LEXXII" K ^TMP(LEXSUB,$J) D II
28 Q
29 ;
30II ; Install Information
31 N LEXT,LEXA,LEXACT,LEXB,LEXD,LEXE,LEXL,LEXU,LEXN,LEXP,LEXPROF,LEXDA H 2
32 S LEXA="",LEXACT=$G(LEXACCT),LEXPRO=$G(LEXPRO),LEXPRON=$G(LEXPRON)
33 S:'$L(LEXPRON) LEXPRON="LEXICAL SERVICES UPDATE" S:'$L(LEXPRO) LEXPRO=$G(^LEXM(0,"PRO")) S:+LEXPRO>0 LEXPRO=$$ED(LEXPRO)
34 S LEXT="Lexicon/ICD/CPT Installation" D TL(LEXT)
35 S LEXT="============================" D TL(LEXT),BL
36 S LEXD=$$ASOF,LEXA=$$UCI,LEXU=$$USR,LEXN=$P(LEXU,"^",1)
37 S:$L($P(LEXACT,"^",1))&($L($P(LEXACT,"^",1))) LEXA=LEXACT
38 S LEXP=$P(LEXU,"^",2),LEXN=$$PM^LEXXFI7(LEXN)
39 S:$L(LEXD) LEXT=" As of: "_LEXD
40 D:$L(LEXD) TL(LEXT)
41 S LEXT="" S:$L(LEXA) LEXT=" In Account: "_$S($L($P(LEXA,"^",1)):"[",1:"")_$P(LEXA,"^",1)_$S($L($P(LEXA,"^",2)):"]",1:"")
42 S:$L(LEXT)&($L($P(LEXA,"^",2))) LEXT=LEXT_" "_$P(LEXA,"^",2)
43 D:$L(LEXA) TL(LEXT)
44 S LEXT="" S:$L(LEXU) LEXT=" Maint By: "
45 S:$L(LEXN) LEXT=LEXT_LEXN
46 S:$L(LEXP)&($L(LEXN)) LEXT=LEXT_" "_LEXP
47 D:$L(LEXT)&(LEXT'["UNKNOWN") TL(LEXT)
48 S LEXT="" S:$L($G(LEXBUILD)) LEXT=" Build: "_$G(LEXBUILD)
49 D:$L(LEXT) TL(LEXT)
50 S LEXT="" S:$L($G(LEXIGHF)) LEXT=" Host File: "_$G(LEXIGHF)
51 S:$L(LEXT)&($L($G(LEXCRE)))&($P($G(LEXCRE),".",1)?7N) LEXT=LEXT_" (Created "_$$ED($G(LEXCRE))_")"
52 S:'$L(LEXT)&($L($G(LEXCRE)))&($P($G(LEXCRE),".",1)?7N) LEXT=" Created: "_$$ED($G(LEXCRE))
53 D:$L(LEXT) TL(LEXT)
54 S LEXT="" I $L($G(LEXPRO))&($L($G(LEXPRON))) D
55 . S LEXT=" Protocol: "_LEXPRON D BL,TL(LEXT)
56 . S LEXT=" Invoked: "_LEXPRO D TL(LEXT)
57 . K LEXPRO,LEXPRON,^LEXM(0,"PRO")
58 S LEXB=$$SS($G(LEXBUILD)),LEXE=$P(LEXB,"^",2),LEXL=$P(LEXB,"^",3),LEXB=$P(LEXB,"^",1)
59 I $P(LEXB,".",1)?7N!($P(LEXB,".",2)?7N)!($P(LEXB,".",3)[":") D
60 . D BL
61 . I $P(LEXB,".",1)?7N D
62 . . S LEXT="" S LEXT=" Started: "_$$ED($G(LEXB)) D TL(LEXT)
63 . I $P(LEXE,".",1)?7N D
64 . . S LEXT="" S LEXT=" Finished: "_$$ED($G(LEXE)) D TL(LEXT)
65 . I $L(LEXL) D
66 . . S LEXT="" S LEXT=" Elapsed: "_$$ED($G(LEXL)) D TL(LEXT)
67 D BL
68 Q
69 ;
70 ; Miscellaneous
71UCI(X) ; UCI where Lexicon is installed
72 N LEXU,LEXP,LEXT,Y X ^%ZOSF("UCI") S LEXU=Y,LEXP="" S:LEXU=^%ZOSF("PROD")!($P(LEXU,",",1)=^%ZOSF("PROD")) LEXP=" (Production)"
73 S:LEXU'=^%ZOSF("PROD")&($P(LEXU,",",1)'=^%ZOSF("PROD")) LEXP=" (Test)" S X="",$P(X,"^",1)=LEXU,$P(X,"^",2)=LEXP
74 Q X
75USR(LEX) ; User/Person
76 N LEXDUZ,LEXPH,LEXNM
77 S LEX=+($G(DUZ)),LEXNM=$$GET1^DIQ(200,+LEX,.01) Q:'$L(LEXNM) "UNKNOWN^"
78 S LEXDUZ=LEX S LEXPH=$$GET1^DIQ(200,+LEXDUZ,.132) S:LEXPH="" LEXPH=$$GET1^DIQ(200,+LEXDUZ,.131)
79 S:LEXPH="" LEXPH=$$GET1^DIQ(200,+LEXDUZ,.133) S:LEXPH="" LEXPH=$$GET1^DIQ(200,+LEXDUZ,.134)
80 S LEXDUZ=$$GET1^DIQ(200,+LEX,.01),LEX=LEXDUZ_"^"_LEXPH Q LEX
81SS(LEX) ; Start/Stop Times
82 N LEXDA,LEXOUT,LEXIENS,LEXB,LEXBUILD,LEXB,LEXE,LEXL
83 S LEXBUILD=$G(LEX),LEXD=0 S:$L(LEXBUILD) LEXD=$$DDA(LEXBUILD)
84 S LEXDA=+($G(XPDA))
85 I +LEXDA>0 D
86 . S LEXIENS=LEXDA_","
87 . D GETS^DIQ(9.7,LEXIENS,"11;17","I","LEXOUT")
88 . S LEXL=0,LEXB=$G(LEXOUT(9.7,LEXIENS,11,"I"))
89 . S LEXE=$$NOW^XLFDT
90 . S:+LEXB>0&(+LEXE>0) LEXL=$$EP(LEXB,LEXE)
91 . S LEX=LEXB_"^"_LEXE S:$L(LEXL) $P(LEX,"^",3)=LEXL
92 I +LEXDA=0 D
93 . S LEX="" S LEXDA=+($G(LEXD)) Q:+LEXDA'>0
94 . S LEXL="",LEXB=$P($G(LEXD),"^",2) Q:$P(LEXB,".",1)'?7N
95 . S LEXE=$$NOW^XLFDT
96 . S:+LEXB>0&(+LEXE>0) LEXL=$$EP(LEXB,LEXE)
97 . S LEX=LEXB_"^"_LEXE S:$L(LEXL) $P(LEX,"^",3)=LEXL
98 Q LEX
99DDA(LEX) ; Get Default DA of Build LEX
100 N LEXB,LEXE,LEXOUT,LEXMSG,LEXI S LEXB=$G(LEX) Q:'$L(LEXB) ""
101 D FIND^DIC(9.7,,"11I;17I","BP",LEXB,,"B",,,"LEXOUT","LEXMSG")
102 S LEXI=+($O(LEXOUT("DILIST"," "),-1))
103 S LEXB=$G(LEXOUT("DILIST",+LEXI,0))
104 S LEXI=$P(LEXB,"^",1),LEXE=$P(LEXB,"^",4),LEXB=$P(LEXB,"^",3)
105 Q:+($G(LEXI))'>0 "" Q:+($G(LEXB))'>0 "" S:+LEXE'>0 LEXE=$$NOW^XLFDT
106 S LEX=LEXI_"^"_LEXB_"^"_LEXE
107 Q LEX
108ASOF(LEX) ; As of date/time
109 S X=$$ED($$NOW^XLFDT) Q X
110ED(LEX) ; External Date MM/DD/YYYY TT:TT
111 S LEX=$$FMTE^XLFDT($G(LEX),"1Z")
112 S:LEX["@" LEX=$P(LEX,"@",1)_" "_$P(LEX,"@",2,299) Q LEX
113 Q LEX
114EP(X,Y) ; Elapsed Time (Begin, End)
115 N LEXTIM,LEXBEG,LEXEND
116 S LEXBEG=$G(X),LEXEND=$G(Y) Q:+LEXBEG'>0 "" Q:+LEXEND'>0 ""
117 S LEXTIM=$$FMDIFF^XLFDT(LEXEND,LEXBEG,2) Q:+LEXTIM'>0 "00:00:00"
118 S LEXTIM=$$TIM(LEXTIM)
119 Q LEXTIM
120TIM(X) ; Format Time Elapsed
121 N LEXD,LEXH,LEXM,LEXS,LEXT,LEXV S X=+($G(X)) Q:X'>0 "00:00:00"
122 S LEXD=X\86400 S LEXV=LEXD*86400 S:+LEXV>0&(LEXV<X) X=X-LEXV
123 S LEXH=X\3600 S LEXV=LEXH*3600 S:+LEXV>0&(LEXV<X) X=X-LEXV
124 S:$L(LEXH)<2 LEXH="0"_LEXH S:$L(LEXH)<2 LEXH="0"_LEXH
125 S LEXM=X\60 S LEXV=LEXM*60 S:+LEXV>0&(LEXV<X) X=X-LEXV
126 S:$L(LEXM)<2 LEXM="0"_LEXM S:$L(LEXM)<2 LEXM="0"_LEXM
127 S LEXS=X S:$L(LEXS)<2 LEXS="0"_LEXS S:$L(LEXS)<2 LEXS="0"_LEXS
128 S LEXT="" S:+LEXD>0 LEXT=+LEXD_" day"_$S(+LEXD>1:"s",1:"")_" "
129 S LEXT=LEXT_LEXH_":"_LEXM_":"_LEXS,X=LEXT
130 Q X
131BL ; Blank Line
132 D TL("") Q
133TL(LEXX) ; Text Line
134 S LEXSUB=$G(LEXSUB) S:'$L(LEXSUB) LEXSUB="LEXXII"
135 I '$D(^TMP(LEXSUB,$J,1)) S ^TMP(LEXSUB,$J,1)=" ",^TMP(LEXSUB,$J,0)=1
136 N LEXNX S LEXNX=$O(^TMP(LEXSUB,$J," "),-1),LEXNX=LEXNX+1
137 S ^TMP(LEXSUB,$J,LEXNX)=" "_$G(LEXX),^TMP(LEXSUB,$J,0)=LEXNX
138 Q
139ST ; Show Temp Array
140 S LEXSUB=$G(LEXSUB) S:'$L(LEXSUB) LEXSUB="LEXXII"
141 N LEXN,LEXC S LEXN="^TMP("""_LEXSUB_""","_$J_")",LEXC="^TMP("""_LEXSUB_""","_$J_","
142 F S LEXN=$Q(@LEXN) Q:LEXN=""!(LEXN'[LEXC) D
143 . Q:LEXN[",0)" W !,@LEXN
144 Q
Note: See TracBrowser for help on using the repository browser.