source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENPL5.m@ 1005

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

initial load of WorldVistAEHR

File size: 4.6 KB
RevLine 
[613]1ENPL5 ;(WASH ISC)/LKG,SAB-FYFP REPORT ;8/17/95
2 ;;7.0;ENGINEERING;**11,23**;Aug 17, 1993
3IN ;Entry point to print 5-Yr Plan report
4 S DIR(0)="N^1993:2099:0",DIR("A")="Budget Year of 5-Yr Plan"
5 S DIR("?")="Enter the 4-digit Budget Year of the Plan"
6 S DIR("B")=$E(17000000+DT,1,4)+$S($E(DT,4,7)>0600:2,1:1)
7 D ^DIR K DIR G:$D(DIRUT) EX S ENFY=Y-1
8ST ; get station
9 S EN6910Y0=$G(^DIC(6910,1,0))
10 S DIC("B")=$P(EN6910Y0,U,2)
11 S DIC="^DIC(4,",DIC(0)="AEMQ" D ^DIC K DIC G:Y<1 EX S ENI=+Y_","
12 S ENSN=$E($$GET1^DIQ(4,ENI,99),1,3)
13 S ENPN=$O(^ENG("PROJ","B",ENSN_"-"))
14 I $P(ENPN,"-")'=ENSN W !,$C(7)_"No Projects on file for this Site" G ST
15 S ENX="VAMC: "_$$GET1^DIQ(4,ENI,"1.03")_", "
16 S ENX=ENX_$$GET1^DIQ(4,ENI,".02:1")_" ("_ENSN_")"
17 S:$P(EN6910Y0,U,7)]"" ENX=ENX_" Region: "_$P(EN6910Y0,U,7)
18 S:$P(EN6910Y0,U,11)]"" ENX=ENX_" VISN: "_$P(EN6910Y0,U,11)
19 S:$P(EN6910Y0,U,12)]"" ENX=ENX_" Network: "_$P(EN6910Y0,U,12)
20 S ENPGH=ENX
21 K EN6910Y0,ENI
22 ;
23 S ENMDA=0,ENDV="*"
24 I $P($G(^DIC(6910,1,0)),U,10) D G:$D(DTOUT)!$D(DUOUT) EX
25 . W !,"Select Division to be included in report or leave blank for all"
26 . S DIC="^ENG(6910.3,",DIC(0)="AQEM" D ^DIC Q:$D(DTOUT)!$D(DUOUT)
27 . I Y'<1 S ENDV=+Y
28 . I Y<1 S ENMDA=1
29 S:ENDV'="*" ENPGH=ENPGH_" Div: "_$$GET1^DIQ(6910.3,ENDV_",",.01)
30 ;
31 K DIR S DIR("A")="Start with year: ",DIR("B")=ENFY
32 S DIR(0)="SA^"_ENFY_":CURRENT YR;"_(ENFY+1)_":BUDGET YR;"_(ENFY+2)_":BUDGET YR+1;"_(ENFY+3)_":BUDGET YR+2;"_(ENFY+4)_":BUDGET YR+3;"_(ENFY+5)_":BUDGET YR+4;FUTURE:FUTURE YEARS"
33 S DIR("?")="Enter a 4 digit year from "_ENFY_" to "_(ENFY+5)_" or FUTURE"
34 D ^DIR K DIR G:$D(DIRUT) EX S ENFYB=$S(Y="FUTURE":"F",1:Y-ENFY)
35 ;
36 S DIR("A")="Go to year: ",DIR("B")="FUTURE",DIR(0)="SA^"
37 I ENFYB'="F" F ENI=ENFYB:1:5 S DIR(0)=DIR(0)_(ENFY+ENI)_$S(ENI:":BUDGET YR",1:":CURRENT YR")_$S(ENI>1:"+"_(ENI-1)_";",1:";")
38 S DIR(0)=DIR(0)_"FUTURE:FUTURE YEARS" K ENI
39 S DIR("?")="Enter FUTURE"_$S(ENFYB'="F":" or a four digit year from "_(ENFY+ENFYB)_" to "_(ENFY+5),1:"")
40 D ^DIR K DIR G:$D(DIRUT) EX S ENFYE=$S(Y="FUTURE":"F",1:Y-ENFY)
41 ;
42 S DIR("A")="Level of detail: ",DIR("B")="DEFAULT"
43 S DIR(0)="SA^L:LOWEST;S:SUMMARY;E:EQUIPMENT;D:DEFAULT;H:HIGHEST"
44 S DIR("?")="Enter a code (L, S, E, D, or H)"
45 S DIR("?",1)="L (LOWEST) Prints only project list pages."
46 S DIR("?",2)="S (SUMMARY) Prints project list and final summary pages."
47 S DIR("?",3)="E (EQUIPMENT) Prints equipment page only."
48 S DIR("?",4)="D (DEFAULT) Prints project list, final summary,"
49 S DIR("?",5)=" and equipment list pages. Prints detail"
50 S DIR("?",6)=" pages for BUDGET and BUDGET+1 years."
51 S DIR("?",7)="H (HIGHEST) Prints project list, final summary,"
52 S DIR("?",8)=" and equipment list pages. Prints detail"
53 S DIR("?",9)=" pages for BUDGET through BUDGET+4 years."
54 D ^DIR K DIR G:$D(DIRUT) EX S ENDETAIL=Y
55DEV ; device
56 S %ZIS="PQ" D ^%ZIS G:POP EX I IOM<132 K IO("Q") D:IO'=IO(0) ^%ZISC W *7,"* Must Support 132 Character Display" G DEV
57 I $D(IO("Q")) D G EX
58 . S ZTRTN="QEN^ENPL5",ZTDESC="Five Year Facility Plan Report"
59 . F ENX="ENSN","ENDV","ENPGH","ENMDA","ENFY","ENFYB","ENFYE","ENDETAIL" S ZTSAVE(ENX)=""
60 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
61QEN ; queued entry point
62 U IO K ENT S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENRDT=Y
63 S ENPGHC=125-$L(ENPGH)\2+5
64 ; get projects and leases
65 S ENX="Y"_$S("EDH"[ENDETAIL:"E",1:"")_$S("DH"[ENDETAIL:"L",1:"")
66 D FYFP^ENPLS1(ENSN,ENFY,ENFYB,ENFYE,ENDV,ENX)
67 ; generate current and/or plan year summary pages
68 I "LSDH"[ENDETAIL,ENFYB'="F" F ENYR=ENFY+ENFYB:1:ENFY+$S(ENFYE="F":5,1:ENFYE) D YS^ENPL5A Q:END
69 ; generate future year summary pages
70 I "LSDH"[ENDETAIL,ENFYE="F",'END S ENYR="F" D YS^ENPL5A
71 ; generate equipment pages
72 I "EDH"[ENDETAIL,'END D EQP^ENPL5C
73 ; generate detail pages
74 I "DH"[ENDETAIL,'END D
75 . S ENFYMX=$S(ENDETAIL["D":ENFY+2,ENDETAIL["H":ENFY+5,1:0) ; max year
76 . S ENPN=""
77 . F S ENPN=$O(^TMP($J,"L",ENPN)) Q:ENPN="" D Q:END
78 . . S ENDA=$P(^TMP($J,"L",ENPN),U),ENY0=$G(^ENG("PROJ",ENDA,0))
79 . . S ENPR=$P(ENY0,U,6)
80 . . I "^MA^MI^MM^NR^"[(U_ENPR_U) D
81 . . . S ENFYAE=$P($G(^ENG("PROJ",ENDA,5)),U,7)
82 . . . S ENFYCO=$P(ENY0,U,7)
83 . . . I (ENFYAE>ENFY&(ENFYAE'>ENFYMX))!(ENFYCO>ENFY&(ENFYCO'>ENFYMX)) D PD^ENPL5B
84 . . I "^LE^"[(U_ENPR_U) D
85 . . . S ENFYRE=$P($G(^ENG("PROJ",ENDA,55)),U,3)
86 . . . I ENFYRE>ENFY,ENFYRE'>ENFYMX D PD^ENPL5B
87 . K ENFYMX,ENFYAE,ENFYCO,ENFYRE,ENY0
88 ; generate plan summary page
89 I "SDH"[ENDETAIL,'END D PS^ENPL5D
90 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
91EX ; exit
92 K ^TMP($J)
93 K EN6910Y0,END,ENDA,ENDETAIL,ENDV,ENFY,ENFYB,ENFYE,ENI,ENMDA
94 K ENPG,ENPGH,ENPGHC,ENPN,ENPR,ENRDT,ENSN,ENT,ENX,ENYR
95 K DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
96 Q
97 ;ENPL5
Note: See TracBrowser for help on using the repository browser.