source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENPL3.m@ 702

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1ENPL3 ;(WASH ISC)/LKG,SAB-MINOR/MINOR MISC PRIORITIZATION ;5/12/95
2 ;;7.0;ENGINEERING;**11,23**;Aug 17, 1993
3IN ;Calculation of VAMC Priority points by section and generating Total
4 D A,B,C,D,E,F,G
5 Q
6A ; Citation Points
7 N %Y,ENA,ENB,ENC,END,ENE,X,X1,X2,Y
8 K ENF S ENA=0
9AA S ENA=$O(^ENG("PROJ",ENDA,21,ENA)) G:ENA'?1.N AE
10 S ENB=$G(^ENG("PROJ",ENDA,21,ENA,0)) G AA:'$P(ENB,U,8)
11 ; base 6-yr limit on 1/15 of current year
12 S X1=$E(DT,1,3)_"0115",X2=$P(ENB,U,3) D ^%DTC G:X>2190 AA
13 S ENC=$P(ENB,U,4) G AA:ENC'?1.N,AA:$D(^OFM(7335.7,ENC,0))#10'=1
14 S END=^OFM(7335.7,ENC,0),ENE=$P(END,U,8) G:'ENE AA
15 S X=$P(ENB,U,3) D I
16 S ENF(ENE)=$G(ENF(ENE))+1,ENF(ENE,ENF(ENE))=Y_U_$P(ENB,U,5)_U_$P(ENB,U,6)_"/"_$P(ENB,U,7)
17 G AA
18AE S ENF=$S($D(ENF(1))#10'=1:0,ENF(1)<3:ENF(1)*5,1:10)_U_$S($D(ENF(2))#10'=1:0,ENF(2)<3:ENF(2)*5,1:10)
19 Q
20B ; Space Points
21 N ENA,ENB,ENC
22 K ENG S ENG="0^Not Applicable"
23 S ENB=$S($D(^ENG("PROJ",ENDA,0))#10:$P(^(0),U,6),1:"")
24 G:",MI,MM,"'[(","_ENB_",") BE
25 S ENA=$P($G(^ENG("PROJ",ENDA,18)),U,2) G BE:ENA'?1.N,BE:$D(^OFM(7336.3,ENA,0))#10'=1
26 S ENC=^OFM(7336.3,ENA,0),ENG=$P(ENC,U,ENB="MM"+3)+0_U_$P(ENC,U)
27BE ;
28 Q
29C ; Energy Points
30 N ENA,ENB
31 K ENH S ENH="0^Not Applicable"
32 S ENB=$S($D(^ENG("PROJ",ENDA,0))#10:$P(^(0),U,6),1:"")
33 G:",MI,MM,"'[(","_ENB_",") CE
34 S ENA=$G(^ENG("PROJ",ENDA,15)) ; G:$P(ENA,U,17)'="Y" CE
35 S ENA=+$P(ENA,U,11)
36 S ENH=$S(ENA>5:"5^Above 5",ENA>4:"4^Between 4-5",ENA>3:"3^Between 3-4",ENA>2:"2^Between 2-3",ENA>1:"1^Below 2",1:"0^Not Applicable")
37CE ;
38 Q
39D ; Category Points
40 N ENA,ENB,ENC,END,ENE
41 K ENI S ENI="0^Not Applicable"
42 S ENB=$S($D(^ENG("PROJ",ENDA,0))#10:$P(^(0),U,6),1:"")
43 G DE:",MI,MM,"'[(","_ENB_","),DE:$P($G(^ENG("PROJ",ENDA,18)),U,4)'="Y"
44 S ENA=$P($G(^ENG("PROJ",ENDA,52)),U) G:ENA'?1.N DE
45 G:'$D(^OFM(7336.8,ENA)) DE
46 S ENE=$P($G(^OFM(7336.8,ENA,0)),U,1,4)
47 S ENC=$P($G(^OFM(7336.8,ENA,1)),U,ENB="MM"+6)
48 I $P(ENE,U)["SEISM" D
49 . S END=+$P($G(^ENG("PROJ",ENDA,18)),U,3)
50 . S ENC=$P(ENC,"/",END)
51 S ENI=+ENC_U_$P(ENE,U,4)_$S($P(ENE,U)["SEISM":" AREA CAT "_$P("I^II^III",U,END),1:"")
52DE ;
53 Q
54E ; VAMC Priority Points
55 N ENA,ENB,ENC
56 K ENJ S ENJ="0^NOT a Priority"
57 S ENB=$S($D(^ENG("PROJ",ENDA,0))#10:$P(^(0),U,6),1:"")
58 G:",MI,MM,"'[(","_ENB_",") EE
59 S ENA=$P($G(^ENG("PROJ",ENDA,15)),U,9) G:ENA="" EE
60 I ENB="MI" S ENC=$S(1:0,ENA=1:10,ENA=2:5,1:0) G EA ; unknown
61 S ENC=$S(1:0,ENA>0&(ENA<5):15-(ENA*3),1:0) ; unknown
62EA S ENJ=ENC_U_"PRIORITY "_ENA
63EE ;
64 Q
65F ; allowed Space, Energy, Category combination
66 K ENK
67 S ENK=$S(+ENG>0:+ENG_U_+ENH_"^0",1:"0^"_+ENH_"^"_+ENI)
68FE ;
69 Q
70G ; VAMC & Factor Subtotal
71 K ENX
72 S ENX=ENF+$P(ENF,U,2)+ENK+$P(ENK,U,2)+$P(ENK,U,3)+ENJ
73 Q
74H N ENA,ENB,ENC,END S ENA="",ENB="",ENC="",END="" K ENL
75HA S ENA=$O(^ENG("PROJ","AB",ENDA,ENA)) G:ENA="" HE
76 S ENC=$G(^ENG("PROJ",ENA,0)),ENB=$P(ENC,U,6) G HA:",MA,MI,"'[(","_ENB_",")
77 S END=$P($G(^ENG("PROJ",ENA,1)),U,3) G:END'?1.N HA
78 G:'$P($G(^ENG(6925.2,END,0)),U,3) HA
79 S ENL($P(ENC,U))=$P(ENC,U,3)_U_$S(ENB="MA":"MAJOR",1:"MINOR")
80 G HA
81HE Q
82I I X'?1.N S Y="" Q
83 S X=X+17000000,Y=$S($E(X,7)=0:" ",1:"")_+$E(X,7,8)_" "_$P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,+$E(X,5,6))_" "_$E(X,1,4)
84 Q
85J S X="FY "_$S($D(^ENG("PROJ",ENDA,5))#10:$P(^(5),U,7),1:"XXXX")_" MINOR "
86 S X=X_$P("DESIGN^MISCELLANEOUS",U,$P($G(^ENG("PROJ",ENDA,0)),U,6)="MM"+1)
87 S X=X_" PRIORITIZATION SCORING SHEET"
88 Q
89K ;Entry point for computed expression to calculate VAMC Minor/Minor Misc.
90 ;;Prioritization Methodology Score
91 N ENF,ENG,ENH,ENI,ENJ,ENK,ENX,ENDA
92 I $D(D0)#10'=1 S X="" G KE
93 I ",MI,MM,"'[(","_$P($G(^ENG("PROJ",D0,0)),U,6)_",") S X="" G KE
94 S ENDA=D0 D IN S X=ENX
95KE Q
96 ;ENPL3
Note: See TracBrowser for help on using the repository browser.