source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXINENV.m@ 623

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

initial load of WorldVistAEHR

File size: 6.3 KB
Line 
1ECXINENV ;ALB/JAP - Environment Check for DSS Install ;Nov 03, 1997
2 ;;3.0;DSS EXTRACTS;;Dec 22, 1997
3EN ;entry point
4 N Y,J,JJ,DIR,DTOUT,DUOUT,DIRUT,ECX,MSG,MSG1,MSG2,MSG2B,MSG3,FILE,FILENM,TEXT
5 K XPDQUIT,XPDABORT
6 F J=1:1:12 S TEXT=$P($T(MSG1+J),";",3),MSG1(J)=TEXT
7 F J=1:1:4 S TEXT=$P($T(MSG2+J),";",3),MSG2(J)=TEXT
8 F J=1:1:8 S TEXT=$P($T(MSG2B+J),";",3),MSG2B(J)=TEXT
9 F J=1:1:8 S TEXT=$P($T(MSG3+J),";",3),MSG3(J)=TEXT
10 ;is this is not a first time install provide user warning
11 I $O(^ECX(728,0)) D MES^XPDUTL(.MSG1) D
12 .W ! S DIR(0)="Y",DIR("A")="Continue with the installation",DIR("B")="NO",DIR("?")="Answer YES to install DSS EXTRACTS v3.0 or NO to stop."
13 .D ^DIR
14 .I Y=0!($G(DIRUT)) S XPDQUIT=1 D MES^XPDUTL("Installation aborted...")
15 .K DIR,DIRUT,DTOUT,DUOUT W !
16 Q:$G(XPDQUIT)
17 D MES^XPDUTL(">>> Checking Environment --")
18 D MES^XPDUTL(" ")
19 I +$G(DUZ)'>0!($G(DUZ(0))'="@")!($G(U)'="^")!('$D(DT))!('$D(IOSL)) D
20 .S XPDQUIT=2
21 .D MES^XPDUTL("You must first initialize Programmer Environment by running ^XUP.")
22 .D MES^XPDUTL(.MSG2)
23 .D MES^XPDUTL(" ") S DIR(0)="E" D ^DIR K DIR
24 Q:$G(XPDQUIT)
25 ;don't bother checking files if this is first-time install of dss
26 Q:'$O(^ECX(728,0))
27 ;if this is a re-install of v3.0, don't insist that data in files be deleted
28 D FILE^DID(728,,"VERSION","ECX")
29 ;only do this check if version is 2
30 ;see if there's any extract data still in files from v2.0t11
31 I ECX("VERSION")'["3.0" D
32 .F J=1:1:20 S FILE=$P($T(FILES+J),";",3),FILENM=$P($T(FILES+J),";",4) D
33 ..S JJ=$O(^ECX(FILE,0)) I +JJ>0 D
34 ...S MSG=" Data still exists in file "_FILENM_" (#"_FILE_")."
35 ...D:($Y+3>IOSL) PAUSE
36 ...D MES^XPDUTL(MSG) S XPDQUIT=2
37 I $G(XPDQUIT) D Q
38 .D:($Y+8>IOSL) PAUSE
39 .D MES^XPDUTL(.MSG2B)
40 .F J=1:1:20 S FILE=$P($T(FILES+J),";",3),FILENM=$P($T(FILES+J),";",4) D
41 ..S JJ=$O(^ECX(FILE,0)) I +JJ>0 D
42 ...S MSG=" "_FILENM_" (#"_FILE_")"
43 ...D:($Y+3>IOSL) PAUSE
44 ...D MES^XPDUTL(MSG)
45 .D:($Y+5>IOSL) PAUSE
46 .D MES^XPDUTL(.MSG2)
47 .D:($Y+12>IOSL) PAUSE
48 .D MES^XPDUTL(.MSG3)
49 D MES^XPDUTL("Environment check completed... OK.")
50 Q
51 ;
52PAUSE ;screen pause
53 N Y,JJ,SS
54 I $E(IOST)="C" D
55 .S SS=22-$Y F JJ=1:1:SS W !
56 .D MES^XPDUTL(" ") S DIR(0)="E" D ^DIR K DIR
57 W:$Y!($E(IOST)="C") @IOF
58 Q
59 ;
60CLEAN ;allow site to cleanup old extract records
61 N FF,J,JJ,JJJ,DIC,DR,DA,DIQ,FILE,EXTRACT,ECX,TYPE,START,PURGE,ABORT,OUT,DATA,CLEAN1,CLEAN2,REM,MSG
62 F J=1:1:8 S TEXT=$P($T(CLEAN1+J),";",3),CLEAN1(J)=TEXT
63 F J=1:1:6 S TEXT=$P($T(CLEAN2+J),";",3),CLEAN2(J)=TEXT
64 W !!
65 D FILE^DID(728,,"VERSION","ECX")
66 I ECX("VERSION")["3.0" D Q
67 .D:($Y+3>IOSL) PAUSE D MES^XPDUTL(.CLEAN1)
68 ;if v3 not installed then continue
69 S ABORT=0,DATA=0
70 F FF=1:1:20 S FILE=$P($T(FILES+FF),";",3),FILENM=$P($T(FILES+FF),";",4),JJ=0 D Q:ABORT=1
71 .F S JJ=$O(^ECX(FILE,JJ)) Q:+JJ<1 I +JJ>0 D Q:ABORT=1
72 ..S OUT=0
73 ..S EXTRACT=$P(^ECX(FILE,JJ,0),"^",3),DIC=727,DR="2;3;9",DIQ(0)="I",DIQ="ECX"
74 ..K ECX S DA=EXTRACT D EN^DIQ1
75 ..S TYPE=$G(ECX(727,DA,2,"I")),START=$G(ECX(727,DA,3,"I")),PURGE=$G(ECX(727,DA,9,"I"))
76 ..;if this extract was not previously purged, don't proceed
77 ..I PURGE="" D Q
78 ...S ABORT=1
79 ...D:($Y+3>IOSL) PAUSE D MES^XPDUTL(.CLEAN2)
80 ..S REM(1)=" Data will now be deleted from:"
81 ..S REM(2)=" File #"_FILE_" - Extract #"_EXTRACT
82 ..S DATA=1
83 ..D:($Y+3>IOSL) PAUSE D MES^XPDUTL(.REM)
84 ..S JJJ=JJ-1
85 ..F S JJJ=$O(^ECX(FILE,JJJ)) Q:+JJJ<1 I +JJJ>0 D Q:OUT=1
86 ...S EXTRX=$P(^ECX(FILE,JJJ,0),"^",3)
87 ...I EXTRX'=EXTRACT S OUT=1
88 ...Q:OUT=1
89 ...S DIK="^ECX("_FILE_",",DA=JJJ D ^DIK
90 ...S MSG=" Record #"_JJJ_" in File #"_FILE_" deleted."
91 ...D:($Y+3>IOSL) PAUSE D MES^XPDUTL(MSG)
92 ..W !!
93 I ABORT=0,DATA=1 D
94 .S MSG=" Clean-up of old extract data complete."
95 .D:($Y+3>IOSL) PAUSE D MES^XPDUTL(MSG)
96 I ABORT=0,DATA=0 D
97 .S MSG=" There are no old extract records which can be deleted."
98 .D:($Y+3>IOSL) PAUSE D MES^XPDUTL(MSG)
99 W !!
100 Q
101 ;
102FILES ;files to be checked for existing data
103 ;;727.802;ADMISSION EXTRACT
104 ;;727.803;CLINIC EXTRACT
105 ;;727.804;CLINIC NOSHOW EXTRACT
106 ;;727.805;NURSING EXTRACT
107 ;;727.806;DENTAL EXTRACT
108 ;;727.808;PHYSICAL MOVEMENT EXTRACT
109 ;;727.809;UNIT DOSE LOCAL EXTRACT
110 ;;727.81;PRESCRIPTION EXTRACT
111 ;;727.811;SURGERY EXTRACT
112 ;;727.813;LABORATORY EXTRACT
113 ;;727.814;RADIOLOGY EXTRACT
114 ;;727.815;EVENT CAPTURE LOCAL EXTRACT
115 ;;727.817;TREATING SPECIALTY CHANGE EXTRACT
116 ;;727.819;IV DETAIL EXTRACT
117 ;;727.82;ADMISSION SETUP EXTRACT
118 ;;727.821;PHYSICAL MOVEMENT SETUP EXTRACT
119 ;;727.822;TREATING SPECIALTY CHANGE SETUP EXTRACT
120 ;;727.823;PAI EXTRACT
121 ;;727.824;LAB RESULTS EXTRACT
122 ;;727.825;QUASAR EXTRACT
123 ;
124MSG1 ;
125 ;;
126 ;; ********** WARNING **********
127 ;;
128 ;;DO NOT INSTALL DSS EXTRACTS V3.0 unless your site has
129 ;;extracted, transmitted, and received transmission
130 ;;confirmation from the Austin Automation Center for ALL
131 ;;FY97 data. Prior approval for this installation should
132 ;;have been received from the local DSS Site Manager.
133 ;;
134 ;; Answer YES to install DSS EXTRACTS v3.0.
135 ;; Answer NO to stop the installation process now.
136 ;;
137MSG2 ;post abort message
138 ;;
139 ;;
140 ;;Installation aborted...
141 ;;
142MSG2B ;more post abort info if data in files
143 ;;
144 ;;Before continuing with this installation, you should verify with
145 ;;the DSS Site Manager that all FY97 data has been transmitted and
146 ;;transmission confirmation has been received from the Austin
147 ;;Automation Center. Then data from the following files should be
148 ;;purged by the DSS Site Manager using the Purge Data from Extract
149 ;;Files [ECXPURG] option:
150 ;;
151MSG3 ;;restart info
152 ;;
153 ;;When you wish to continue with this installation, simply select
154 ;;the Install Package(s) [XPD INSTALL BUILD] option from the Kernel
155 ;;Installation & Distribution System menu. You do not need to
156 ;;reload the KIDS distribution file. (The package build has not
157 ;;been deleted from the ^XTMP global.)
158 ;;
159 ;;
160CLEAN1 ;;can't cleanup global if v3 installed
161 ;;
162 ;;DSS EXTRACTS v3.0 has already been installed on this system.
163 ;;This file clean-up cannot be performed after installation of
164 ;;the new version.
165 ;;
166 ;;If you are having difficulty, please contact the Customer Support
167 ;;Help Desk.
168 ;;
169CLEAN2 ;;unpurged extract file
170 ;;
171 ;;Cannot continue -- an unpurged extract file has been found.
172 ;;
173 ;;Please advise the DSS Site Manager to complete purging of all
174 ;;previously extracted data from files #727.802 through #727.825
175 ;;by using the DSS option Purge Data from Extract Files [ECXPURG].
176 ;;
Note: See TracBrowser for help on using the repository browser.