ENPLV3 ;(WIRMFO)/SAB-PROJECT VALIDATION, VALIDATE ONE ENTRY (cont) ;2/2/1998
;;7.0;ENGINEERING;**23,28,49**;Aug 17, 1993
;
I ENPR]"" D ; program checks
. I ENPCI]"" D
. . S ENX=$G(^OFM(7336.8,ENPCI,0))
. . I $P(ENX,U,2)'[ENPR S ENS=1,ENMSG="PROJECT CATEGORY ("_$P(ENX,U)_") inconsistent with PROGRAM ("_ENPR_")." D MSG
. I ENBCI]"" D
. . S ENX=$G(^OFM(7336.9,ENBCI,0)) I $P(ENX,U,2)'[ENPR S ENS=1,ENMSG="BUDGET CATEGORY ("_$P(ENX,U)_") inconsistent with PROGRAM ("_ENPR_")." D MSG
. I ENSTATI]"" D
. . S ENX=$G(^ENG(6925.2,ENSTATI,0)) I $P(ENX,U,5)'[ENPR S ENS=1,ENMSG="STATUS ("_$P(ENX,U)_") inconsistent with PROGRAM ("_ENPR_")." D MSG
;
I "^NR^"[(U_ENPR_U) D ; NRM program checks
. I $P(ENY0,U,7)="",ENPCI]"" S ENX=$P($G(^OFM(7336.8,ENPCI,0)),U) I ENX'="CONSULTANT STUDY" S ENS=1,ENMSG="FUNDING YEAR - CONST required for PROGRAM ("_ENPR_") and PROJECT CATEGORY ("_ENX_")." D MSG
;
I "^NR^SL^"[(U_ENPR_U) D ; NRM, STATION LEVEL program checks
. I $P(ENY52,U,9)="",ENFT'="NCS" S ENS=1,ENMSG="BONUS CATEGORY is required for PROGRAM ("_ENPR_")" D MSG
. I $P(ENY52,U,9)]"" D
. . S ENX=$P($G(^OFM(7336.8,$P(ENY52,U,9),0)),U)
. . I ENX["NHCU" D
. . . I $P(ENY52,U,3)="" S ENS=1,ENMSG="NHCU BEDS (NEW) required for BONUS CATEGORY ("_ENX_")." D MSG
. . . I $P(ENY52,U,4)="" S ENS=1,ENMSG="NHCU BEDS (RENOVATED) required for BONUS CATEGORY ("_ENX_")." D MSG
. . . I $P(ENY52,U,5)="" S ENS=1,ENMSG="NHCU BEDS (CONVERTED) required for BONUS CATEGORY ("_ENX_")." D MSG
;
I "^MA^MI^MM^"[(U_ENPR_U) D ; MA,MI,MM program checks
. I ENPCI]"" D
. . S ENX=$G(^OFM(7336.8,ENPCI,0))
. . I $P(ENX,U)["NHCU" D
. . . I $P(ENY52,U,3)="" S ENS=1,ENMSG="NHCU BEDS (NEW) required for PROJECT CATEGORY ("_$P(ENX,U)_")." D MSG
. . . I $P(ENY52,U,4)="" S ENS=1,ENMSG="NHCU BEDS (RENOVATED) required for PROJECT CATEGORY ("_$P(ENX,U)_")." D MSG
. . . I $P(ENY52,U,5)="" S ENS=1,ENMSG="NHCU BEDS (CONVERTED) required for PROJECT CATEGORY ("_$P(ENX,U)_")." D MSG
. I $P(ENY0,U,7)="" S ENS=1,ENMSG="FUNDING YEAR - CONST required for PROGRAM ("_ENPR_")." 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
;ENPLV3
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENPLV3 2336 printed Dec 13, 2024@01:55:09 Page 2
ENPLV3 ;(WIRMFO)/SAB-PROJECT VALIDATION, VALIDATE ONE ENTRY (cont) ;2/2/1998
+1 ;;7.0;ENGINEERING;**23,28,49**;Aug 17, 1993
+2 ;
+3 ; program checks
IF ENPR]""
Begin DoDot:1
+4 IF ENPCI]""
Begin DoDot:2
+5 SET ENX=$GET(^OFM(7336.8,ENPCI,0))
+6 IF $PIECE(ENX,U,2)'[ENPR
SET ENS=1
SET ENMSG="PROJECT CATEGORY ("_$PIECE(ENX,U)_") inconsistent with PROGRAM ("_ENPR_")."
DO MSG
End DoDot:2
+7 IF ENBCI]""
Begin DoDot:2
+8 SET ENX=$GET(^OFM(7336.9,ENBCI,0))
IF $PIECE(ENX,U,2)'[ENPR
SET ENS=1
SET ENMSG="BUDGET CATEGORY ("_$PIECE(ENX,U)_") inconsistent with PROGRAM ("_ENPR_")."
DO MSG
End DoDot:2
+9 IF ENSTATI]""
Begin DoDot:2
+10 SET ENX=$GET(^ENG(6925.2,ENSTATI,0))
IF $PIECE(ENX,U,5)'[ENPR
SET ENS=1
SET ENMSG="STATUS ("_$PIECE(ENX,U)_") inconsistent with PROGRAM ("_ENPR_")."
DO MSG
End DoDot:2
End DoDot:1
+11 ;
+12 ; NRM program checks
IF "^NR^"[(U_ENPR_U)
Begin DoDot:1
+13 IF $PIECE(ENY0,U,7)=""
IF ENPCI]""
SET ENX=$PIECE($GET(^OFM(7336.8,ENPCI,0)),U)
IF ENX'="CONSULTANT STUDY"
SET ENS=1
SET ENMSG="FUNDING YEAR - CONST required for PROGRAM ("_ENPR_") and PROJECT CATEGORY ("_ENX_")."
DO MSG
End DoDot:1
+14 ;
+15 ; NRM, STATION LEVEL program checks
IF "^NR^SL^"[(U_ENPR_U)
Begin DoDot:1
+16 IF $PIECE(ENY52,U,9)=""
IF ENFT'="NCS"
SET ENS=1
SET ENMSG="BONUS CATEGORY is required for PROGRAM ("_ENPR_")"
DO MSG
+17 IF $PIECE(ENY52,U,9)]""
Begin DoDot:2
+18 SET ENX=$PIECE($GET(^OFM(7336.8,$PIECE(ENY52,U,9),0)),U)
+19 IF ENX["NHCU"
Begin DoDot:3
+20 IF $PIECE(ENY52,U,3)=""
SET ENS=1
SET ENMSG="NHCU BEDS (NEW) required for BONUS CATEGORY ("_ENX_")."
DO MSG
+21 IF $PIECE(ENY52,U,4)=""
SET ENS=1
SET ENMSG="NHCU BEDS (RENOVATED) required for BONUS CATEGORY ("_ENX_")."
DO MSG
+22 IF $PIECE(ENY52,U,5)=""
SET ENS=1
SET ENMSG="NHCU BEDS (CONVERTED) required for BONUS CATEGORY ("_ENX_")."
DO MSG
End DoDot:3
End DoDot:2
End DoDot:1
+23 ;
+24 ; MA,MI,MM program checks
IF "^MA^MI^MM^"[(U_ENPR_U)
Begin DoDot:1
+25 IF ENPCI]""
Begin DoDot:2
+26 SET ENX=$GET(^OFM(7336.8,ENPCI,0))
+27 IF $PIECE(ENX,U)["NHCU"
Begin DoDot:3
+28 IF $PIECE(ENY52,U,3)=""
SET ENS=1
SET ENMSG="NHCU BEDS (NEW) required for PROJECT CATEGORY ("_$PIECE(ENX,U)_")."
DO MSG
+29 IF $PIECE(ENY52,U,4)=""
SET ENS=1
SET ENMSG="NHCU BEDS (RENOVATED) required for PROJECT CATEGORY ("_$PIECE(ENX,U)_")."
DO MSG
+30 IF $PIECE(ENY52,U,5)=""
SET ENS=1
SET ENMSG="NHCU BEDS (CONVERTED) required for PROJECT CATEGORY ("_$PIECE(ENX,U)_")."
DO MSG
End DoDot:3
End DoDot:2
+31 IF $PIECE(ENY0,U,7)=""
SET ENS=1
SET ENMSG="FUNDING YEAR - CONST required for PROGRAM ("_ENPR_")."
DO MSG
End DoDot:1
+32 ;
+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 ;ENPLV3