source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENPRUTL.m@ 767

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

initial load of WorldVistAEHR

File size: 6.9 KB
Line 
1ENPRUTL ;WISC/SAB-PROJECT TRACKING UTILITIES ;1/20/1998
2 ;;7.0;ENGINEERING;**28,49**;Aug 17, 1993
3 Q
4 ;
5PRDOM ; Determine Domain for project tracking transmissions
6 S ENDOMAIN=$$GET1^DIQ(6910,1,101)
7 I ENDOMAIN']"" W !,"Domain not found in PROJECT TRACKING ROLLUP DOMAIN (#101) field",!,"of the ENG INIT PARAMETERS (#6910) file. Transmission aborted!",!! R "Press RETURN to Continue",X:DTIME
8 Q
9 ;
10FMS(ENDA) ; FMS # Extrinsic Function
11 ; called from FMS # (# .05) computed field
12 ; Input: DA - ien of construction project
13 ; Returns: computed FMS #
14 N ENFT,ENPR,ENX,ENY
15 S ENX="",ENY=$G(^ENG("PROJ",ENDA,0)),ENPR=$P(ENY,U,6)
16 I "^MA^MI^"[(U_ENPR_U) D
17 . N ENFT,ENPN,ENPC
18 . S ENPN=$P(ENY,U)
19 . S ENFT("I")=$P($G(^ENG("PROJ",ENDA,52)),U,6)
20 . S ENPC("C")=$S(ENFT("I")="VBA":"VB",ENFT("I")="NCS":"CM",1:"")
21 . I ENPC("C")="" D
22 . . S ENPC("I")=$P($G(^ENG("PROJ",ENDA,52)),U)
23 . . S:ENPC("I") ENPC("C")=$P($G(^OFM(7336.8,ENPC("I"),0)),U,9)
24 . I $G(ENPC("C"))'?2U S ENPC("C")="??"
25 .S ENX=$P(ENPN,"-")_"-"_ENPC("C")_$S(ENPR="MA":2,1:3)_"-"_$P(ENPN,"-",2)
26 Q ENX
27 ;
28MSL(ENDA) ; Milestone List Extrinsic Function
29 ; ENDA - ien of construction project
30 ; Returns value with pieces (true/false) which indicate applicability
31 ; of the corresponding 22 milestones
32 N ENAM,ENCM,ENCAF,ENPR,ENX
33 S ENPR=$$GET1^DIQ(6925,ENDA,155,"I") ; program
34 S ENAM=$$GET1^DIQ(6925,ENDA,7) ; design (a/e) method
35 S ENCM=$$GET1^DIQ(6925,ENDA,8) ; construction method
36 S ENCAF=$$GET1^DIQ(6925,ENDA,4) ; approved construction funding
37 D MSLAP
38 Q ENX
39 ;
40MSLAP ; set pieces of ENX for milestone applicability
41 ; also called from ENPRF1
42 ; needs ENAM,ENCM,ENCAF,ENPR returns ENX
43 N ENI
44 S ENX="",$P(ENX,U,22)=""
45 I "^MA^MI^"[(U_ENPR_U) F ENI=1,2 S $P(ENX,U,ENI)=1
46 I "^MA^MI^MM^NR^"[(U_ENPR_U) S $P(ENX,U,3)=1
47 I ENCM'="DESIGN/BUILD",ENAM'="VAMC" F ENI=4,5,6 S $P(ENX,U,ENI)=1
48 I "^MA^"[(U_ENPR_U),ENCM'="DESIGN/BUILD" F ENI=7,8 S $P(ENX,U,ENI)=1
49 I "^MA^MI^MM^"[(U_ENPR_U),ENCM'="DESIGN/BUILD" F ENI=9,10 S $P(ENX,U,ENI)=1
50 I "^MA^MI^MM^NR^SL^"[(U_ENPR_U) D
51 . I ENCM'="DESIGN/BUILD" F ENI=11,12 S $P(ENX,U,ENI)=1
52 . I ENCAF'<500000 F ENI=13,16 S $P(ENX,U,ENI)=1
53 . I ENCAF'<500000 F ENI=14,17 S $P(ENX,U,ENI)=1
54 . I ENCM'="STATION LABOR",ENCM'="P&H" F ENI=15,18,19 S $P(ENX,U,ENI)=1
55 . F ENI=20,21,22 S $P(ENX,U,ENI)=1
56 Q
57 ;
58MSD(ENDA,ENPRIOR) ; Milestone Dates for Project
59 ; Input Variables
60 ; ENDA - ien of project
61 ; ENPRIOR - (optional) flag, true if previous values also desired
62 ; Output Variables
63 ; ENMS("%",milestone #) = % complete ("%0" for previous values)
64 ; ENMS("P",milestone #) = planned date ("P0" for previous values)
65 ; ENMS("R",milestone #) = revised date ("R0" for previous values)
66 ; ENMS("A",milestone #) = actual date ("A0" for previous values)
67 K ENMS S ENPRIOR=$G(ENPRIOR)
68 N ENI,ENP,ENY
69 S ENP=""
70 S ENY=$G(^ENG("PROJ",ENDA,1))
71 S ENMS("%",2)=$P(ENY,U,11)
72 S ENMS("%",8)=$P(ENY,U,6)
73 S ENMS("%",10)=$P(ENY,U,9)
74 S ENMS("%",12)=$P(ENY,U,7)
75 S ENMS("%",21)=$P(ENY,U,8)
76 S ENY=$G(^ENG("PROJ",ENDA,2)) D N2
77 S ENY=$G(^ENG("PROJ",ENDA,3)) D N3
78 S ENY=$G(^ENG("PROJ",ENDA,4)) D N4
79 S ENY=$G(^ENG("PROJ",ENDA,50)) D N50
80 S ENY=$G(^ENG("PROJ",ENDA,51)) D N51
81 S ENY=$G(^ENG("PROJ",ENDA,56)) D N56
82 ; set n/a milestones blank
83 ;S ENY=$$MSL(ENDA) F ENI=1:1:22 I '$P(ENY,U,ENI) D
84 ;. S ENMS("P",ENI)="",ENMS("R",ENI)="",ENMS("A",ENI)=""
85 ;. I $D(ENMS("%",ENI)) S ENMS("%",ENI)=""
86 Q:'ENPRIOR
87 S ENP="0"
88 S ENY=$G(^ENG("PROJ",ENDA,60))
89 S ENMS("%0",2)=$P(ENY,U,21)
90 S ENMS("%0",8)=$P(ENY,U,16)
91 S ENMS("%0",10)=$P(ENY,U,19)
92 S ENMS("%0",12)=$P(ENY,U,17)
93 S ENMS("%0",21)=$P(ENY,U,18)
94 S ENY=$G(^ENG("PROJ",ENDA,61)) D N2
95 S ENY=$G(^ENG("PROJ",ENDA,62)) D N3
96 S ENY=$G(^ENG("PROJ",ENDA,63)) D N4
97 S ENY=$G(^ENG("PROJ",ENDA,66)) D N50
98 S ENY=$G(^ENG("PROJ",ENDA,67)) D N51
99 S ENY=$G(^ENG("PROJ",ENDA,69)) D N56
100 ; set n/a milestones blank
101 ;S ENY=$$MSL(ENDA) F ENI=1:1:22 I '$P(ENY,U,ENI) D
102 ;. S ENMS("P0",ENI)="",ENMS("R0",ENI)="",ENMS("A0",ENI)=""
103 ;. I $D(ENMS("%0",ENI)) S ENMS("%0",ENI)=""
104 Q
105N2 ;
106 F ENI=0:1:1 S ENMS("P"_ENP,7+ENI)=$P(ENY,U,2+ENI)
107 F ENI=0:1:1 S ENMS("P"_ENP,11+ENI)=$P(ENY,U,4+ENI)
108 F ENI=0:1:0 S ENMS("P"_ENP,15+ENI)=$P(ENY,U,6+ENI)
109 F ENI=0:1:3 S ENMS("P"_ENP,18+ENI)=$P(ENY,U,7+ENI)
110 Q
111N3 ;
112 F ENI=0:1:1 S ENMS("R"_ENP,7+ENI)=$P(ENY,U,1+ENI)
113 F ENI=0:1:1 S ENMS("R"_ENP,11+ENI)=$P(ENY,U,3+ENI)
114 F ENI=0:1:0 S ENMS("R"_ENP,15+ENI)=$P(ENY,U,5+ENI)
115 F ENI=0:1:3 S ENMS("R"_ENP,18+ENI)=$P(ENY,U,6+ENI)
116 Q
117N4 ;
118 F ENI=0:1:5 S ENMS("A"_ENP,3+ENI)=$P(ENY,U,1+ENI)
119 F ENI=0:1:1 S ENMS("A"_ENP,11+ENI)=$P(ENY,U,7+ENI)
120 F ENI=0:1:0 S ENMS("A"_ENP,15+ENI)=$P(ENY,U,9+ENI)
121 F ENI=0:1:3 S ENMS("A"_ENP,18+ENI)=$P(ENY,U,10+ENI)
122 F ENI=0:1:1 S ENMS("A"_ENP,9+ENI)=$P(ENY,U,14+ENI)
123 Q
124N50 ;
125 F ENI=0:1:1 S ENMS("P"_ENP,9+ENI)=$P(ENY,U,2+ENI)
126 F ENI=0:1:0 S ENMS("P"_ENP,22+ENI)=$P(ENY,U,4+ENI)
127 F ENI=0:1:2 S ENMS("R"_ENP,1+ENI)=$P(ENY,U,5+ENI)
128 F ENI=0:1:5 S ENMS("P"_ENP,1+ENI)=$P(ENY,U,8+ENI)
129 F ENI=0:1:2 S ENMS("R"_ENP,4+ENI)=$P(ENY,U,14+ENI)
130 F ENI=0:1:1 S ENMS("R"_ENP,9+ENI)=$P(ENY,U,17+ENI)
131 F ENI=0:1:0 S ENMS("R"_ENP,22+ENI)=$P(ENY,U,19+ENI)
132 Q
133N51 ;
134 F ENI=0:1:1 S ENMS("A"_ENP,1+ENI)=$P(ENY,U,1+ENI)
135 F ENI=0:1:0 S ENMS("A"_ENP,22+ENI)=$P(ENY,U,3+ENI)
136 Q
137N56 ;
138 F ENI=0:1:1 S ENMS("P"_ENP,13+ENI)=$P(ENY,U,ENI*3+1)
139 F ENI=0:1:1 S ENMS("P"_ENP,16+ENI)=$P(ENY,U,ENI*3+7)
140 F ENI=0:1:1 S ENMS("R"_ENP,13+ENI)=$P(ENY,U,ENI*3+2)
141 F ENI=0:1:1 S ENMS("R"_ENP,16+ENI)=$P(ENY,U,ENI*3+8)
142 F ENI=0:1:1 S ENMS("A"_ENP,13+ENI)=$P(ENY,U,ENI*3+3)
143 F ENI=0:1:1 S ENMS("A"_ENP,16+ENI)=$P(ENY,U,ENI*3+9)
144 Q
145MS(ENI) ; Milestone Name Extrinsic Function
146 ; Input ENI - index number for milestone (1-22)
147 ; Returns name of milestone
148 N ENX
149 S ENX=""
150 S:ENI ENX=$P($P($T(MSDATA+ENI),";;",2),U)
151 Q ENX
152MSFP(ENI) ; Milestone Planned Field Number Extrinsic Function
153 ; Input ENI - index number for milestone (1-22)
154 ; Returns field number of milestone (planned)
155 N ENX
156 S ENX=""
157 S:ENI ENX=$P($P($T(MSDATA+ENI),";;",2),U,2)
158 Q ENX
159 ;
160MSFR(ENI) ; Milestone Field Number Extrinsic Function
161 ; Input ENI - index number for milestone (1-22)
162 ; Returns field number of milestone (revised)
163 N ENX
164 S ENX=""
165 S:ENI ENX=$P($P($T(MSDATA+ENI),";;",2),U,3)
166 Q ENX
167 ;
168MSFA(ENI) ; Milestone Field Number Extrinsic Function
169 ; Input ENI - index number for milestone (1-22)
170 ; Returns field number of milestone (actual)
171 N ENX
172 S ENX=""
173 S:ENI ENX=$P($P($T(MSDATA+ENI),";;",2),U,4)
174 Q ENX
175 ;
176MSDATA ;;
1771 ;;Design Program Start^20^34^49
1782 ;;Design Program Compl^20.1^34.1^49.1
1793 ;;Authorized^^^50
1804 ;;Advertise for A/E^20.3^34.3^51
1815 ;;Select A/E^20.4^34.4^52
1826 ;;A/E Award^20.5^34.5^53
1837 ;;Start Schematics^21^35^54
1848 ;;Complete Schematics^22^36^55
1859 ;;Start Design Dev.^22.5^36.1^55.5
18610 ;;Compl. Design Dev.^22.6^36.2^55.6
18711 ;;Start/Award CD^23^37^56
18812 ;;Complete CD^24^38^57
18913 ;;Start L/T Review^24.4^38.4^57.4
19014 ;;Start Audit Review^24.6^38.6^57.6
19115 ;;Issue IFB/SBA^25^39^58
19216 ;;Compl. L/T Review^25.4^39.4^58.4
19317 ;;Compl. Audit Review^25.6^39.6^58.6
19418 ;;Bid Open/Negotiation^26^40^59
19519 ;;Construction Award^27^41^60
19620 ;;Construction Start^28^42^61
19721 ;;Const. Complete^29^43^62
19822 ;;Activation^30^44^63
199 ;ENPRUTL
Note: See TracBrowser for help on using the repository browser.