source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENXIP71.m@ 1351

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

initial load of WorldVistAEHR

File size: 5.4 KB
Line 
1ENXIP71 ;WCIOFO/SAB-PATCH INSTALL ROUTINE ;5/31/2002
2 ;;7.0;ENGINEERING;**71**;Aug 17, 1993
3 ;-------------------------------------------------------------------
4 ;This routine is a modified copy of ENXIP63 from EN*7*63.
5 ;
6 ;-------------------------------------------------------------------
7PRE ;PRE Install Entry Point.
8 ;
9 I $$PATCH^XPDUTL("EN*7.0*71") D BMES^XPDUTL(" Skipping pre install since patch was previously installed.") Q
10 ;
11 ;Check for field #99 entries in 6914 set by EN*7*63.
12 ;If $P1 of "RC" node has a value, set it to null
13 N ENIEN,ENCNT,ENMSG S (ENIEN,ENCNT)=0
14 ;
15 S ENMSG=" * Checking for field #99 entries in file 6914."
16 D BMES^XPDUTL(ENMSG)
17 F S ENIEN=$O(^ENG(6915.2,"B",ENIEN)) Q:'ENIEN D
18 . QUIT:'$D(^ENG(6914,ENIEN,"RC"))
19 . ;
20 . I $P(^ENG(6914,ENIEN,"RC"),U)'="" D
21 . . S $P(^ENG(6914,ENIEN,"RC"),U)=""
22 . . S ENCNT=ENCNT+1
23 ;
24 S ENMSG=" * "_ENCNT_" field #99 entries were removed in file 6914."
25 D MES^XPDUTL(" * Check for field #99 entries in file 6914 completed.")
26 I ENCNT>0 D MES^XPDUTL(ENMSG)
27 E D MES^XPDUTL(" * NO field #99 entries found in file 6914.")
28 ;
29 ;-------------------- D A T A V A L I D A T I O N ------------------
30 ;
31 ;Validate data in 6914. If there is a problem, inform the user and
32 ;save problem records in a temp file.
33 ;
34 K ^XTMP("ENXIP71",0)
35 ;
36 S (ENIEN,ENCNT)=0,ENMSG=""
37 S ^XTMP("ENXIP71",0)=$$FMADD^XLFDT(DT,21)_U_DT
38 ;
39 S ENMSG=" * Checking for problem records in file 6914."
40 D BMES^XPDUTL(ENMSG)
41 F S ENIEN=$O(^ENG(6915.2,"B",ENIEN)) Q:'ENIEN D
42 . ;
43 . Q:+$$CHKFA^ENFAUTL(ENIEN)'>0 ;Not currently reported to FA
44 . ;
45 . ;Data vaildation - No entry in the Equipment File
46 . I '$D(^ENG(6914,ENIEN)) D Q
47 . . S ENCNT=ENCNT+1
48 . . S ENMSG=" "_ENCNT_". NO ENTRY IN FILE 6914 for IEN "_ENIEN
49 . . S ^XTMP("ENXIP71",ENIEN)=ENMSG
50 . . D MES^XPDUTL(ENMSG)
51 . ;
52 . K ENEQ
53 . F I=2,8,9 S ENEQ(I)=$G(^ENG(6914,ENIEN,I)) ;Check data from 6914
54 . ;
55 . ;Data vaildation - Check for missing nodes
56 . ; 1. Node 2 has the Total Asset Value
57 . ; 2. Node 8 has the Standard General Ledger
58 . ; 3. Node 9 has Station no. and Fund no.
59 . ;
60 . I ENEQ(2)="" D
61 . . S ENCNT=ENCNT+1
62 . . S ENMSG=" "_ENCNT_". NODE 2 MISSING IN 6914 for IEN "_ENIEN
63 . . S ^XTMP("ENXIP71",ENIEN)=ENMSG
64 . . D MES^XPDUTL(ENMSG)
65 . . ;
66 . I ENEQ(8)="" D
67 . . S ENCNT=ENCNT+1
68 . . S ENMSG=" "_ENCNT_". NODE 8 MISSING IN 6914 for IEN "_ENIEN
69 . . S ^XTMP("ENXIP71",ENIEN)=ENMSG
70 . . D MES^XPDUTL(ENMSG)
71 . . ;
72 . I ENEQ(9)="" D
73 . . S ENCNT=ENCNT+1
74 . . S ENMSG=" "_ENCNT_". NODE 9 MISSING IN 6914 for IEN "_ENIEN
75 . . S ^XTMP("ENXIP71",ENIEN)=ENMSG
76 . . D MES^XPDUTL(ENMSG)
77 ;
78 S ENMSG=" * These problem records will not process with the "
79 S ENMSG=ENMSG_"one-time job!"
80 D MES^XPDUTL(" * Check for problem records in file 6914 completed.")
81 ;
82 I ENCNT>0 D MES^XPDUTL(ENMSG) Q
83 D MES^XPDUTL(" * NO problem records were found in file 6914.")
84 ;
85 Q
86 ;---------------------------------------------------------------------
87POST ;Post Install Entry Point
88 N ENI,ENSN
89 ;
90 ; only perform during 1st install
91 I $$PATCH^XPDUTL("EN*7.0*71") D BMES^XPDUTL(" Skipping post install since patch was previously installed.") Q
92 I DT>3020724 D BMES^XPDUTL(" Skipping post install since Today is after July 24, 2002.") Q
93 ; check if legacy computer system (due to facility consolidation)
94 ; We don't want to generate new FD Documents on the legacy since
95 ; FD Documents are manually entered on Fixed Assets/FMS within
96 ; a month of having the equipment data transferred to the consolidated
97 ; computer system. Any new FD Documents sent from the legacy
98 ; Engineering software would reject in Austin.
99 ;
100 S ENI=$O(^DIC(6910,0)) ; ien of entry in file 6910 (should be 1)
101 S ENSN=$S(ENI:$P($G(^DIC(6910,ENI,0)),U,2),1:"") ; station number
102 I $$LEGACY(ENSN) D Q
103 . D BMES^XPDUTL(" Skipping post install because patch is being installed on a legacy system.")
104 . D MES^XPDUTL(" Any FD Documents generated by a legacy system would reject in Austin.")
105 ;
106QTASK ; Queue Task to expense capitalized equipment that does not meet the
107 ; new capitalization threshold ($100,000)
108 ;
109 S ZTRTN="TASK^ENFACTT"
110 S ZTDESC="ENG Capitalization Threshold Task"
111 S ZTDTH="3020724.170000"
112 S ZTIO=""
113 S ZTSAVE("ENIO")=XPDQUES("POS1","B")
114 D ^%ZTLOAD
115 ;
116 I '$G(ZTSK) D
117 . D BMES^XPDUTL("ERROR. The one-time task was not successfully queued.")
118 . D MES^XPDUTL("Please contact National VISTA Support for assistance.")
119 . ; send mail message to developer and installer
120 ;
121 I $G(ZTSK) D
122 . D BMES^XPDUTL(" The one-time task was successfully queued.")
123 . D MES^XPDUTL(" 1. The task number is "_ZTSK)
124 . D MES^XPDUTL(" 2. It will start on "_$$HTE^XLFDT(ZTSK("D")))
125 . D MES^XPDUTL(" 3. After the task completes a summary report will be printed on device:")
126 . D MES^XPDUTL(" "_XPDQUES("POS1","B"))
127 ;
128 Q
129 ;----------------------------------------------------------------------
130LEGACY(ENSN) ; Legacy Station Extrinsic Function
131 ; input ENSN - station number
132 ; returns 1 if legacy station or 0 if not legacy station
133 ; list updated through calendar year 1999 facility consolidations
134 ;
135 ; Most up to date listing received 5/16/02. Added additional stations
136 ; with information supplied by NDBI
137 ;
138 N ENRET
139 S ENRET=0
140 S ENSN=$G(ENSN)
141 ;
142 I "^599^505^627^641^566^611^685^591^569^513^579^604^645^535^522^680^752^533^592^574^686^617^665^594^525^532^527^"[(U_ENSN_U) S ENRET=1
143 ;
144 ;New Legacy for EN*7&71
145 I "^647^543^609^677^567^452^555^514^670^500^622^597^584^"[(U_ENSN_U) S ENRET=1
146 ;
147 Q ENRET
148 ;
149 ;ENXIP71
Note: See TracBrowser for help on using the repository browser.