source: cprs/branches/tmg-cprs/m_files/TMGINIT.m@ 1035

Last change on this file since 1035 was 796, checked in by Kevin Toppenberg, 14 years ago

Initial upload

File size: 10.0 KB
Line 
1TMGINIT ;TMG/kst/Custom (non-interactive) version of DINIT ;03/25/06
2 ;;1.0;TMG-LIB;**1**;11/01/04
3
4 ;"DINIT(INFO) -- NON-INTERACTIVE versions of standard DINIT code.
5 ;"=============================================================================
6 ;"Kevin Toppenberg, MD 11-04
7 ;"
8 ;"Purpose:
9 ;"
10 ;"This library will provide optional NON-INTERACTIVE versions of standard DINIT code.
11 ;"
12 ;"DINIT(INFO)
13 ;"
14 ;"=============================================================================
15
16DINIT(INFO) ;SFISC/GFT,XAK-INITIALIZE VA FILEMAN ;1:06 PM 30 Mar 1999
17V ;;22.0;VA FileMan (WorldVista Modified);;Mar 30, 1999
18 ;";;22.0;VA FileMan;;Mar 30, 1999
19 ;Per VHA Directive 10-93-142, this routine should not be modified.
20 ;"
21 ;"K. Toppenberg's changes made November, 2004
22 ;"
23 ;"Input:
24 ;" Note: INFO variable is completely an OPTIONAL parameter.
25 ;" If not supplied, interactive mode used
26 ;" INFO("SILENT-OUTPUT") -- 1 = output is supressed.
27 ;" INFO("SILENT-INPUT") -- 1 = User-interactive input is supressed.
28 ;"
29 ;" ** if in SILENT-INPUT mode, THEN the following data should be supplied:
30 ;" ----------------------
31 ;" INFO("CONTINUE") -- Should contain the answer the user would enter for question:
32 ;" "Initialize VA Fileman now?" (i.e. Y or N)
33 ;" INFO("SITE NAME") -- answer for "SITE NAME?"
34 ;" INFO("SITE NUMBER") -- answer for "SITE NUMBER?"
35 ;" INFO("SYS TYPE") -- answer for "TYPE OF MUMPS SYSTEM YOU ARE USING"
36 ;"Output:
37 ;" If in SILENT-OUTPUT mode, then output that would normally go to the screen, will be routed to this array
38 ;" NOTE: INFO SHOULD BE PASSED BY REFERENCE if user wants this information passed back out.
39 ;" INFO("TEXT","LINES")=Number of output lines
40 ;" INFO("TEXT",1)= 1st output line
41 ;" INFO("TEXT",2)= 2nd output line, etc...
42 ;
43 ;
44
45 NEW DBINDENT SET DBINDENT=0
46 IF $DATA(TMGDEBUG) DO DebugMsg^TMGDEBUG(.DBINDENT,"Starting: DINIT^TMGINIT")
47
48 NEW SILNTOUT SET SILNTOUT=$get(INFO("SILENT-OUTPUT"),0) ;//KT
49 NEW SILENTIN SET SILENTIN=$GET(INFO("SILENT-INPUT"),0) ;//KT
50 KILL INFO("TEXT") ;//kt
51
52 D KL^DINIT6
53N ;
54 D VERSION
55 N DIFROM S DIFROM=VERSION
56 DO OUTP^TMGQIO(SILNTOUT,"!","!",X)
57 D DT^DICRW
58 I $G(^DD("VERSION"))]"",^DD("VERSION")_"z"]](VERSION_"z") D
59 . DO OUTP^TMGQIO(SILNTOUT,$C(7),"!","!","*** WARNING!! VA FileMan version "_^DD("VERSION")_" is currently loaded on this system.","!")
60 . DO OUTP^TMGQIO(SILNTOUT,"This Initialization will bring in VA FileMan version "_VERSION_", an earlier version!!","!","!")
61 S Y=$G(^DD("OS")) I Y,"1,2,3,4,5,6,10,11,12,13,15,"[(Y_",") DO G KL^DINIT6
62 . DO OUTP^TMGQIO(SILNTOUT,$C(7),"!","!","Your defined operating system entry "_$P($G(^DD("OS",Y,0)),U)_" does not support the")
63 . DO OUTP^TMGQIO(SILNTOUT,"!","1995 M Standards.","!","!")
64 . DO OUTP^TMGQIO(SILNTOUT,"You may not initialize VA FileMan V21.")
65DO DO OUTP^TMGQIO(SILNTOUT,"!","!","Initialize VA FileMan now? NO//")
66 DO INP^TMGQIO(.Y,SILENTIN,60,$GET(INFO("CONTINUE")))
67 GOTO:Y["^"!("Nn"[$E(Y))!('$T) KL^DINIT6
68 I "Yy"'[$E(Y) DO GOTO DO
69 . DO OUTP^TMGQIO(SILNTOUT,"!","Answer YES to begin Initializing VA FileMan (^ to abort)")
70 ;
71 ;
72NA DO OUTP^TMGQIO(SILNTOUT,"!","!","SITE NAME: ")
73 I $D(^DD("SITE")) DO OUTP^TMGQIO(SILNTOUT,^DD("SITE"),"// ")
74 DO INP^TMGQIO(.X,SILENTIN,60,$GET(INFO("SITE NAME")))
75 G KL^DINIT6:X="^"!'$T
76 I X="",$D(^DD("SITE"))#2 S X=^DD("SITE")
77 I X'?1AN.ANP DO G NA
78 . DO OUTP^TMGQIO(SILNTOUT," ENTER THE NAME OF THIS INSTALLATION SITE (^ to abort)","!","!")
79 S %X=X
80 ;
81 ;
82NO DO OUTP^TMGQIO(SILNTOUT,"!","!","SITE NUMBER: ")
83 IF $D(^DD("SITE",1)) DO OUTP^TMGQIO(SILNTOUT,^DD("SITE",1),"// ")
84 DO INP^TMGQIO(.X,SILENTIN,60,$GET(INFO("SITE NUMBER")))
85 IF (X="^")!('$T) G KL^DINIT6
86 IF X="" S X=$GET(^DD("SITE",1),0)
87 IF X>0 DO
88 . SET ^DD("SITE")=%X,^DD("SITE",1)=X
89 IF (X'>0)&(SILENTIN=1) GOTO KL^DINIT6
90 IF X'>0 DO GOTO NO
91 . DO OUTP^TMGQIO(SILNTOUT," ENTER A NUMBER, CORRESPONDING TO YOUR INSTITUTION")
92 ;***** REMOVE AFTER V21 INIT *****
93 ;D
94 ;. N DIREC F DIREC=0:0 S DIREC=$O(^DI(.84,DIREC)) Q:'DIREC Q:DIREC>10000 K ^DI(.84,DIREC,5)
95 ;. Q
96 ;*********************************
97 K ^DD(0)
98 D ^DINIT0,^DINIT11B
99 D OSETC
100 DO OUTP^TMGQIO(SILNTOUT,"!")
101 S Y=1
102 D OS
103 G KL^DINIT6:Y<0
104 DO OUTP^TMGQIO(SILNTOUT,"!","!","Now loading other FileMan files--please wait.")
105 G GO
106 ;
107 ;
108 ;"=============================================================================
109OS DO OUTP^TMGQIO(SILNTOUT,"!")
110 S DIC="^DD(""OS"","
111 IF (SILENTIN=0)&($DATA(INFO("SYS TYPE"))'=0) DO
112 . S DIC(0)="IAQE"
113 . S DIC("A")="TYPE OF MUMPS SYSTEM YOU ARE USING: "
114 ELSE DO
115 . SET DIC(0)="I"
116 . SET X=INFO("SYS TYPE")
117 I $D(^DD("OS"))#2 DO
118 . S (DITZS,DIC("B"))=^("OS")
119 . S:DITZS=7 (DITZS,DIC("B"))=18
120 E DO
121 . S (DITZS,^DD("OS"))=100
122 D ^DIC
123 K DIC
124 G Q:Y<0
125 S (DITZS,^DD("OS"))=+Y
126 I $D(^%ZTSK),$D(^%ZOSF("OS"))#2,$D(^("MGR"))#2 D
127 . S ZTRTN="OS^%RCR"
128 . S ZTUCI=^%ZOSF("MGR")
129 . S ZTDTH=$H
130 . S ZTIO=""
131 . S ZTSAVE("DITZS")=""
132 . S ZTDESC="Set Operating System"
133 . D ^%ZTLOAD
134 . Q
135Q K DITZS,ZTSK
136 Q
137 ;
138 ;
139 ;"=============================================================================
140VERSION ;
141 S VERSION=$P($T(V),";",3),X="VA FileMan V."_VERSION
142 Q
143 ;
144 ;
145 ;"=============================================================================
146GO ;
147 IF $DATA(TMGDEBUG) DO DebugEntry^TMGDEBUG(.DBINDENT,"GO^TMGINIT")
148 S I=$C(126)
149 S DIT=$P($H,",",2)
150 S $P(^DIBT(0),U,1,2)="TEMPLATE^.4I"
151 S $P(^DIE(0),U,1,2)="TEMPLATE^.4I"
152 S $P(^DIPT(0),U,1,2)="TEMPLATE^.4I"
153 S ^(.01,0)="CAPTIONED^"
154 S ^("F",1)="S DIC=DCC,DA=D0 D EN^DIQ"
155 S ^DIPT(.02,0)="FILE SECURITY CODES^^^1"
156 S ^("F",1)=".01;L20"_I_"0;R13"_I_31_I_33_I_35_I_34_I_32_I_21_I_20
157 S ^DIA(0)="AUDIT^1.1I"
158 K ^DD(.4),^(.41),^("^"),^(.403),^(.4031),^(.40315),^(.403115),^(.4032),^(.404),^(.40415),^(.4044),^(.404421),^(1.2)
159 K ^DIC(.403),^(.404),^(1.2)
160 K ^DD(.44),^(.441),^(.4411),^(.447),^(.448),^(.411),^(.42),^(.81),^DIC(.44),^(.81)
161 F I=.2,.4,.401,.402,.5,.6,.83,1.1,1.11,1.12,1.13 K ^DIC(I,"%D")
162 K ^DIC(.46),^DD(.46),^(.461),^(.463)
163 K ^DIC(.11),^(.31) F I=.11,.111,.112,.114,.31,.312 K ^DD(I)
164 F I=1.521,1.52101,1.5211,1.5212,1.5213,1.5214,1.5215,1.5216,1.5217,1.5218,1.5219,1.52191,1.52192 K ^DIC(I),^DD(I)
165 IF $DATA(TMGDEBUG) DO DebugMsg^TMGDEBUG(.DBINDENT,"Leaving OSETC^TMGINIT--via GOTO ^DINITOFO")
166 G ^DINIT0F0
167 ;
168 ;"=============================================================================
169
170OSETC ;BRING IN MUMPS OS, DIALOG & LANGUAGE DD AND DATA FOR FILEMAN
171
172 IF $DATA(TMGDEBUG) DO DebugMsg^TMGDEBUG(.DBINDENT,"Starting: OSETC^TMGINIT")
173
174 N DN,R,D,DDF,DDT,DTO,DFR,DFN,DTN,DMRG,I,Z,D0
175 DO OUTP^TMGQIO(SILNTOUT,"!","!","Now loading MUMPS Operating System File")
176 D ^DINIT21
177 D OSDD^DINIT24
178 S ^DIC(.7,0)="MUMPS OPERATING SYSTEM^.7"
179 S ^(0,"GL")="^DD(""OS"","
180 D A^DINIT3
181 S ^DIC(.7,"%D",0)="^^5^5^2940908^"
182 S ^DIC(.7,"%D",1,0)="This file stores operating system-specific code. Since the code to invoke"
183 S ^DIC(.7,"%D",2,0)="some operating system utilities that FileMan uses varies among operating"
184 S ^DIC(.7,"%D",3,0)="systems, code to perform these utilities is stored in and executed from"
185 S ^DIC(.7,"%D",4,0)="this file. During the FileMan INIT process an operating system is"
186 S ^DIC(.7,"%D",5,0)="selected so that FileMan knows which entry to use from this file."
187 K ^DD("OS","B"),DA,DIK
188 S DA(1)=.7
189 S DIK="^DD(.7,"
190 D X^DINIT3
191 K DA,DIK
192 S DIK="^DD(""OS"","
193 D X^DINIT3
194 D
195 . N I,DA,DIK
196 . F I=1,2,3,4,5,6,7,10,11,12,13,14,15 S DA=I,DIK="^DD(""OS""," D ^DIK
197 . Q
198 ;
199 K ^UTILITY(U,$J)
200 K ^UTILITY("DIK",$J)
201 DO OUTP^TMGQIO(SILNTOUT,"!","!","Now loading DIALOG and LANGUAGE Files")
202 S DN="^DINIT" F R=1:1:39 D @(DN_$$B36(R)) W "."
203 S $P(^DIC(.84,0),U,1,2)="DIALOG^.84"
204 S $P(^DI(.84,0),U,1,2)="DIALOG^.84I"
205 I $D(^DIC(.84,0,"GL")) D A1^DINIT3
206 S $P(^DIC(.85,0),U,1,2)="LANGUAGE^.85"
207 S $P(^DI(.85,0),U,1,2)="LANGUAGE^.85I"
208 I $D(^DIC(.85,0,"GL")) D A1^DINIT3
209 F I=.84,.841,.842,.844,.845,.847,.8471,.85 D XX^DINIT3
210 D DATA
211
212OSETCQ
213 IF $DATA(TMGDEBUG) DO DebugExit^TMGDEBUG(.DBINDENT,"OSETC^TMGINIT")
214 Q
215 ;
216 ;"=============================================================================
217DATA
218 IF $DATA(TMGDEBUG) DO DebugEntry^TMGDEBUG(.DBINDENT,"DATA^TMGINIT")
219
220 DO OUTP^TMGQIO(SILNTOUT,".")
221 S (D,DDF(1),DDT(0))=$O(^UTILITY(U,$J,0))
222 GOTO:D'>0 DATAQ
223 S DTO=0,DMRG=1,DTO(0)=^(D),Z=^(D)_"0)",D0=^(D,0),@Z=D0
224 S DFR(1)="^UTILITY(U,$J,DDF(1),D0,",DKP=0
225 F D0=0:0 DO GOTO:'$D(^(D0,0)) DATAQ
226 . S D0=$O(^UTILITY(U,$J,DDF(1),D0))
227 . S:D0="" D0=-1
228 . Q:'$D(^(D0,0))
229 . S Z=^(0)
230 . D I^DITR
231 K ^UTILITY(U,$J,DDF(1)),DDF,DDT,DTO,DFR,DFN,DTN
232 G DATA
233DATAQ
234 IF $DATA(TMGDEBUG) DO DebugExit^TMGDEBUG(.DBINDENT,"DATA^TMGINIT")
235 QUIT
236 ;
237 ;"=============================================================================
238B36(X) Q $$N1(X\(36*36)#36+1)_$$N1(X\36#36+1)_$$N1(X#36+1)
239N1(%) Q $E("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",%)
240
241 ;"=====================================================================================
Note: See TracBrowser for help on using the repository browser.