source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENPLV3.m@ 975

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1ENPLV3 ;(WIRMFO)/SAB-PROJECT VALIDATION, VALIDATE ONE ENTRY (cont) ;2/2/1998
2 ;;7.0;ENGINEERING;**23,28,49**;Aug 17, 1993
3 ;
4 I ENPR]"" D ; program checks
5 . I ENPCI]"" D
6 . . S ENX=$G(^OFM(7336.8,ENPCI,0))
7 . . I $P(ENX,U,2)'[ENPR S ENS=1,ENMSG="PROJECT CATEGORY ("_$P(ENX,U)_") inconsistent with PROGRAM ("_ENPR_")." D MSG
8 . I ENBCI]"" D
9 . . 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
10 . I ENSTATI]"" D
11 . . 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
12 ;
13 I "^NR^"[(U_ENPR_U) D ; NRM program checks
14 . 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
15 ;
16 I "^NR^SL^"[(U_ENPR_U) D ; NRM, STATION LEVEL program checks
17 . I $P(ENY52,U,9)="",ENFT'="NCS" S ENS=1,ENMSG="BONUS CATEGORY is required for PROGRAM ("_ENPR_")" D MSG
18 . I $P(ENY52,U,9)]"" D
19 . . S ENX=$P($G(^OFM(7336.8,$P(ENY52,U,9),0)),U)
20 . . I ENX["NHCU" D
21 . . . I $P(ENY52,U,3)="" S ENS=1,ENMSG="NHCU BEDS (NEW) required for BONUS CATEGORY ("_ENX_")." D MSG
22 . . . I $P(ENY52,U,4)="" S ENS=1,ENMSG="NHCU BEDS (RENOVATED) required for BONUS CATEGORY ("_ENX_")." D MSG
23 . . . I $P(ENY52,U,5)="" S ENS=1,ENMSG="NHCU BEDS (CONVERTED) required for BONUS CATEGORY ("_ENX_")." D MSG
24 ;
25 I "^MA^MI^MM^"[(U_ENPR_U) D ; MA,MI,MM program checks
26 . I ENPCI]"" D
27 . . S ENX=$G(^OFM(7336.8,ENPCI,0))
28 . . I $P(ENX,U)["NHCU" D
29 . . . I $P(ENY52,U,3)="" S ENS=1,ENMSG="NHCU BEDS (NEW) required for PROJECT CATEGORY ("_$P(ENX,U)_")." D MSG
30 . . . I $P(ENY52,U,4)="" S ENS=1,ENMSG="NHCU BEDS (RENOVATED) required for PROJECT CATEGORY ("_$P(ENX,U)_")." D MSG
31 . . . I $P(ENY52,U,5)="" S ENS=1,ENMSG="NHCU BEDS (CONVERTED) required for PROJECT CATEGORY ("_$P(ENX,U)_")." D MSG
32 . I $P(ENY0,U,7)="" S ENS=1,ENMSG="FUNDING YEAR - CONST required for PROGRAM ("_ENPR_")." D MSG
33 ;
34 Q
35MSG ; save message
36 ; ENL(ENS) - last line used in array
37 ; ENMSG - messsage
38 ; ENS - severity (1,2) 1 invalid, 2 warning
39 I ENV>ENS S ENV=ENS
40 S ENL(ENS)=ENL(ENS)+1,^TMP($J,"V",ENDA,ENS,ENL(ENS),0)=ENMSG
41 Q
42 ;ENPLV3
Note: See TracBrowser for help on using the repository browser.