ENPLV4 ;(WASH ISC)/SAB-PROJECT VALIDATION, VALIDATE ONE ENTRY (cont) ;9/15/97
;;7.0;ENGINEERING;**23,28**;Aug 17, 1993
; Five Year Facility Plan (FYFP) specific checks
I "^MA^MI^MM^NR^LE^"'[(U_ENPR_U) S ENS=1,ENMSG="PROGRAM ("_ENPR_") not supported for the 5-Yr Plan." D MSG Q
N ENCST,ENFYAE,ENFYCO,ENMAX,ENMIN,ENY55
S ENY55=$G(^ENG("PROJ",ENDA,55))
D ^ENPLV6
S ENFYAE=$P($G(^ENG("PROJ",ENDA,5)),U,7)
S ENFYCO=$P(ENY0,U,7)
I "^MA^MI^MM^NR^"[(U_ENPR_U) D
. I ENFYAE]"",$P(ENY19,U,10)'>0 S ENS=1,ENMSG="ESTIMATED A/E COST (FYFP) required for FUNDING YEAR - A/E ("_ENFYAE_")." D MSG
. I ENFYCO]"",$P(ENY19,U,11)'>0 S ENS=1,ENMSG="ESTIMATED CONST COST (FYFP) required for FUNDING YEAR - CONST ("_ENFYCO_")." D MSG
. I ENFT]"" D
. . S:ENFT="VHA" ENMIN=$S(ENPR="MA":3000000,ENPR="MI":500000,ENPR="MM":150000,ENPR="NR":0,1:0)
. . S:ENFT="VHA" ENMAX=$S(ENPR="MA":10000000000,ENPR="MI":4000000,ENPR="MM":750000,ENPR="NR":10000000000,1:0)
. . S:ENFT="NCS" ENMIN=$S(ENPR="MA":3000000,ENPR="MI":0,ENPR="MM":0,ENPR="NR":0,1:0)
. . S:ENFT="NCS" ENMAX=$S(ENPR="MA":10000000000,ENPR="MI":4000000,ENPR="MM":0,ENPR="NR":0,1:0)
. . S:ENFT="VBA" ENMIN=$S(ENPR="MA":0,ENPR="MI":5000,ENPR="MM":0,ENPR="NR":0,1:0)
. . S:ENFT="VBA" ENMAX=$S(ENPR="MA":0,ENPR="MI":200000,ENPR="MM":10000000000,ENPR="NR":10000000000,1:0)
. . S ENCST=$$GET1^DIQ(6925,ENDA_",",212)
. . I ENCST<ENMIN S ENS=1,ENMSG="ESTIMATED COST ("_ENCST_") must be >= ("_ENMIN_") for FACILITY TYPE ("_ENFT_") and PROGRAM ("_ENPR_")." D MSG
. . I ENCST'<ENMAX S ENS=1,ENMSG="ESTIMATED COST ("_ENCST_") must be < ("_ENMAX_") for FACILITY TYPE ("_ENFT_") and PROGRAM ("_ENPR_")." D MSG
. S ENX=$P($G(^ENG("PROJ",ENDA,5)),U,2) I ENX>0,ENX+999\1000*1000'=$P(ENY19,U,10) S ENS=2,ENMSG="ESTIMATED A/E COST ("_$P(ENY19,U,10)_") does not match APPROVED A/E FUNDING ("_ENX_")" D MSG
. S ENX=$P(ENY1,U) I ENX>0,ENX+999\1000*1000'=$P(ENY19,U,11) S ENS=2,ENMSG="ESTIMATED CONST COST ("_$P(ENY19,U,11)_") does not match APPROVED CONSTRUCTION ("_ENX_")" D MSG
. I ENFYAE<ENFY,ENFYCO<ENFY S ENS=1,ENMSG="A least one FUNDING YEAR (A/E or CONST) must be the Plan's current year ("_ENFY_") or later." D MSG
I "^LE^"[(U_ENPR_U),$P(ENY55,U,2)<ENFY,$P(ENY55,U,3)<ENFY S ENS=1,ENMSG="A least one FY (AWARD LEASE or RENT STARTS) must be the Plan's current year ("_ENFY_") or later." D MSG
;
I ENXMIT D
. I "^MA^MI^MM^NR^"[(U_ENPR_U) D
. . I ENFYAE>ENFY!(ENFYCO>ENFY),";3;5;6;8;9;10;11;12;"'[(";"_ENSTATI_";") S ENS=1,ENMSG="STATUS ("_$$EXTERNAL^DILFD(6925,6,"",ENSTATI)_") inconsistent for Plan's budget year ("_(ENFY+1)_") or later." D MSG
. . I ENFYAE=ENFY!(ENFYCO=ENFY),ENFYAE'>ENFY,ENFYCO'>ENFY,";6;8;9;10;11;12;13;14;15;"'[(";"_ENSTATI_";") S ENS=1,ENMSG="STATUS ("_$$EXTERNAL^DILFD(6925,6,"",ENSTATI)_") inconsistent for Plan's current year ("_(ENFY)_")." D MSG
. I "^LE^"[(U_ENPR_U) D
. . I ";3;5;"'[(";"_ENSTATI_";") S ENS=1,ENMSG="STATUS ("_$$EXTERNAL^DILFD(6925,6,"",ENSTATI)_") inconsistent for Plan." D MSG
Q
MSG ; save message
; ENL(ENS) - last line used in array
; ENMSG - messsage
; ENS - severity (1,2) 1 invalid, 2 warning
I ENV>ENS S ENV=ENS
S ENL(ENS)=ENL(ENS)+1,^TMP($J,"V",ENDA,ENS,ENL(ENS),0)=ENMSG
Q
;ENPLV4
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENPLV4 3237 printed Dec 13, 2024@01:55:10 Page 2
ENPLV4 ;(WASH ISC)/SAB-PROJECT VALIDATION, VALIDATE ONE ENTRY (cont) ;9/15/97
+1 ;;7.0;ENGINEERING;**23,28**;Aug 17, 1993
+2 ; Five Year Facility Plan (FYFP) specific checks
+3 IF "^MA^MI^MM^NR^LE^"'[(U_ENPR_U)
SET ENS=1
SET ENMSG="PROGRAM ("_ENPR_") not supported for the 5-Yr Plan."
DO MSG
QUIT
+4 NEW ENCST,ENFYAE,ENFYCO,ENMAX,ENMIN,ENY55
+5 SET ENY55=$GET(^ENG("PROJ",ENDA,55))
+6 DO ^ENPLV6
+7 SET ENFYAE=$PIECE($GET(^ENG("PROJ",ENDA,5)),U,7)
+8 SET ENFYCO=$PIECE(ENY0,U,7)
+9 IF "^MA^MI^MM^NR^"[(U_ENPR_U)
Begin DoDot:1
+10 IF ENFYAE]""
IF $PIECE(ENY19,U,10)'>0
SET ENS=1
SET ENMSG="ESTIMATED A/E COST (FYFP) required for FUNDING YEAR - A/E ("_ENFYAE_")."
DO MSG
+11 IF ENFYCO]""
IF $PIECE(ENY19,U,11)'>0
SET ENS=1
SET ENMSG="ESTIMATED CONST COST (FYFP) required for FUNDING YEAR - CONST ("_ENFYCO_")."
DO MSG
+12 IF ENFT]""
Begin DoDot:2
+13 if ENFT="VHA"
SET ENMIN=$SELECT(ENPR="MA":3000000,ENPR="MI":500000,ENPR="MM":150000,ENPR="NR":0,1:0)
+14 if ENFT="VHA"
SET ENMAX=$SELECT(ENPR="MA":10000000000,ENPR="MI":4000000,ENPR="MM":750000,ENPR="NR":10000000000,1:0)
+15 if ENFT="NCS"
SET ENMIN=$SELECT(ENPR="MA":3000000,ENPR="MI":0,ENPR="MM":0,ENPR="NR":0,1:0)
+16 if ENFT="NCS"
SET ENMAX=$SELECT(ENPR="MA":10000000000,ENPR="MI":4000000,ENPR="MM":0,ENPR="NR":0,1:0)
+17 if ENFT="VBA"
SET ENMIN=$SELECT(ENPR="MA":0,ENPR="MI":5000,ENPR="MM":0,ENPR="NR":0,1:0)
+18 if ENFT="VBA"
SET ENMAX=$SELECT(ENPR="MA":0,ENPR="MI":200000,ENPR="MM":10000000000,ENPR="NR":10000000000,1:0)
+19 SET ENCST=$$GET1^DIQ(6925,ENDA_",",212)
+20 IF ENCST<ENMIN
SET ENS=1
SET ENMSG="ESTIMATED COST ("_ENCST_") must be >= ("_ENMIN_") for FACILITY TYPE ("_ENFT_") and PROGRAM ("_ENPR_")."
DO MSG
+21 IF ENCST'<ENMAX
SET ENS=1
SET ENMSG="ESTIMATED COST ("_ENCST_") must be < ("_ENMAX_") for FACILITY TYPE ("_ENFT_") and PROGRAM ("_ENPR_")."
DO MSG
End DoDot:2
+22 SET ENX=$PIECE($GET(^ENG("PROJ",ENDA,5)),U,2)
IF ENX>0
IF ENX+999\1000*1000'=$PIECE(ENY19,U,10)
SET ENS=2
SET ENMSG="ESTIMATED A/E COST ("_$PIECE(ENY19,U,10)_") does not match APPROVED A/E FUNDING ("_ENX_")"
DO MSG
+23 SET ENX=$PIECE(ENY1,U)
IF ENX>0
IF ENX+999\1000*1000'=$PIECE(ENY19,U,11)
SET ENS=2
SET ENMSG="ESTIMATED CONST COST ("_$PIECE(ENY19,U,11)_") does not match APPROVED CONSTRUCTION ("_ENX_")"
DO MSG
+24 IF ENFYAE<ENFY
IF ENFYCO<ENFY
SET ENS=1
SET ENMSG="A least one FUNDING YEAR (A/E or CONST) must be the Plan's current year ("_ENFY_") or later."
DO MSG
End DoDot:1
+25 IF "^LE^"[(U_ENPR_U)
IF $PIECE(ENY55,U,2)<ENFY
IF $PIECE(ENY55,U,3)<ENFY
SET ENS=1
SET ENMSG="A least one FY (AWARD LEASE or RENT STARTS) must be the Plan's current year ("_ENFY_") or later."
DO MSG
+26 ;
+27 IF ENXMIT
Begin DoDot:1
+28 IF "^MA^MI^MM^NR^"[(U_ENPR_U)
Begin DoDot:2
+29 IF ENFYAE>ENFY!(ENFYCO>ENFY)
IF ";3;5;6;8;9;10;11;12;"'[(";"_ENSTATI_";")
SET ENS=1
SET ENMSG="STATUS ("_$$EXTERNAL^DILFD(6925,6,"",ENSTATI)_") inconsistent for Plan's budget year ("_(ENFY+1)_") or later."
DO MSG
+30 IF ENFYAE=ENFY!(ENFYCO=ENFY)
IF ENFYAE'>ENFY
IF ENFYCO'>ENFY
IF ";6;8;9;10;11;12;13;14;15;"'[(";"_ENSTATI_";")
SET ENS=1
SET ENMSG="STATUS ("_$$EXTERNAL^DILFD(6925,6,"",ENSTATI)_") inconsistent for Plan's current year ("_(ENFY)_")."
DO MSG
End DoDot:2
+31 IF "^LE^"[(U_ENPR_U)
Begin DoDot:2
+32 IF ";3;5;"'[(";"_ENSTATI_";")
SET ENS=1
SET ENMSG="STATUS ("_$$EXTERNAL^DILFD(6925,6,"",ENSTATI)_") inconsistent for Plan."
DO MSG
End DoDot:2
End DoDot:1
+33 QUIT
MSG ; save message
+1 ; ENL(ENS) - last line used in array
+2 ; ENMSG - messsage
+3 ; ENS - severity (1,2) 1 invalid, 2 warning
+4 IF ENV>ENS
SET ENV=ENS
+5 SET ENL(ENS)=ENL(ENS)+1
SET ^TMP($JOB,"V",ENDA,ENS,ENL(ENS),0)=ENMSG
+6 QUIT
+7 ;ENPLV4