ENXHIPS ;WISC/SAB-POST INIT ;11/10/97
;;7.0;ENGINEERING;**28**;Aug 17, 1993
N DA,DIK,ENDA,ENFYAE,ENFYCO,ENI,ENOPT,ENPN,ENY5
D MES^XPDUTL(" Performing Post-Init...")
;
ENPARAM ; populate 6910 project tracking domain
I $D(^DIC(6910,1)),$P($G(^DIC(6910,1,9)),U,2)="" D
. S ENI=$$FIND1^DIC(4.2,"","","FORUM")
. I ENI S $P(^DIC(6910,1,9),U,2)=ENI
;
PROJUPD ; loop through projects and update
D MES^XPDUTL(" Setting Progress Report milestone dates with a month and year")
D MES^XPDUTL(" but no day equal to the last day of the month")
S ENDA=0 F S ENDA=$O(^ENG("PROJ",ENDA)) Q:'ENDA D
. ; fix status value incorrectly populated by trigger
. I $P($G(^ENG("PROJ",ENDA,1)),U,3)="COMPLETED PROJECT" S $P(^ENG("PROJ",ENDA,1),U,3)=16
. ; Check/Fix 2 digit funding years
. S ENFYAE=$P($G(^ENG("PROJ",ENDA,5)),U,7)
. S ENFYCO=$P($G(^ENG("PROJ",ENDA,0)),U,7)
. K DR S DR=""
. I ENFYAE?2N S DR=DR_";3.45///^S X=19"_ENFYAE
. I ENFYCO?2N S DR=DR_";3.5///^S X=19"_ENFYCO
. I DR]"" S DR=$E(DR,2,999),DIE="^ENG(""PROJ"",",DA=ENDA D ^DIE K DR,DIE
. ; Populate new MA/MI Contingency PCT field
. I "^MA^MI^MM^"[(U_$P($G(^ENG("PROJ",ENDA,0)),U,6)_U) D
. . S ENY(19)=$G(^ENG("PROJ",ENDA,19))
. . I $P(ENY(19),U,8)]"",$P(ENY(19),U,12)="" S $P(^ENG("PROJ",ENDA,19),U,12)=$$GET1^DIQ(6925,ENDA,218)
. ; Set Milestone Dates to End Of Month
. D SETEOM(2,2,10)
. D SETEOM(3,1,9)
. D SETEOM(4,1,15)
. D SETEOM(50,2,19)
. D SETEOM(51,1,3)
. D SETEOM(56,1,12)
. D SETEOM(61,2,10)
. D SETEOM(62,1,9)
. D SETEOM(63,1,15)
. D SETEOM(66,2,19)
. D SETEOM(67,1,3)
. D SETEOM(69,1,12)
;
; update applicable programs for project status
S $P(^ENG(6925.2,8,0),U,5)="MA,MI,MM,NR,SL" ; a/e
S $P(^ENG(6925.2,11,0),U,5)="MA,MI,MM,NR,SL" ; construction documents
;
D MES^XPDUTL(" Completed Post-Init")
Q
;
SETEOM(ENODE,ENPB,ENPE) ; Set Dates to End Of Month
; Input ENDA - ien of project
; ENODE - node which contains milestone dates
; ENPB - piece in ENODE to begin a range of milestones
; ENPE - piece in ENODE to end a range of milestones
N ENI,ENW,ENY
S ENY=$G(^ENG("PROJ",ENDA,ENODE)),ENW=0
F ENI=ENPB:1:ENPE I $E($P(ENY,U,ENI),4,5)>0,$E($P(ENY,U,ENI),6,7)="00" S $P(ENY,U,ENI)=$$EOM^ENUTL($P(ENY,U,ENI)),ENW=1 ;W "."
I ENW S ^ENG("PROJ",ENDA,ENODE)=ENY
Q
;ENXHIPS
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENXHIPS 2364 printed Oct 16, 2024@17:57:35 Page 2
ENXHIPS ;WISC/SAB-POST INIT ;11/10/97
+1 ;;7.0;ENGINEERING;**28**;Aug 17, 1993
+2 NEW DA,DIK,ENDA,ENFYAE,ENFYCO,ENI,ENOPT,ENPN,ENY5
+3 DO MES^XPDUTL(" Performing Post-Init...")
+4 ;
ENPARAM ; populate 6910 project tracking domain
+1 IF $DATA(^DIC(6910,1))
IF $PIECE($GET(^DIC(6910,1,9)),U,2)=""
Begin DoDot:1
+2 SET ENI=$$FIND1^DIC(4.2,"","","FORUM")
+3 IF ENI
SET $PIECE(^DIC(6910,1,9),U,2)=ENI
End DoDot:1
+4 ;
PROJUPD ; loop through projects and update
+1 DO MES^XPDUTL(" Setting Progress Report milestone dates with a month and year")
+2 DO MES^XPDUTL(" but no day equal to the last day of the month")
+3 SET ENDA=0
FOR
SET ENDA=$ORDER(^ENG("PROJ",ENDA))
if 'ENDA
QUIT
Begin DoDot:1
+4 ; fix status value incorrectly populated by trigger
+5 IF $PIECE($GET(^ENG("PROJ",ENDA,1)),U,3)="COMPLETED PROJECT"
SET $PIECE(^ENG("PROJ",ENDA,1),U,3)=16
+6 ; Check/Fix 2 digit funding years
+7 SET ENFYAE=$PIECE($GET(^ENG("PROJ",ENDA,5)),U,7)
+8 SET ENFYCO=$PIECE($GET(^ENG("PROJ",ENDA,0)),U,7)
+9 KILL DR
SET DR=""
+10 IF ENFYAE?2N
SET DR=DR_";3.45///^S X=19"_ENFYAE
+11 IF ENFYCO?2N
SET DR=DR_";3.5///^S X=19"_ENFYCO
+12 IF DR]""
SET DR=$EXTRACT(DR,2,999)
SET DIE="^ENG(""PROJ"","
SET DA=ENDA
DO ^DIE
KILL DR,DIE
+13 ; Populate new MA/MI Contingency PCT field
+14 IF "^MA^MI^MM^"[(U_$PIECE($GET(^ENG("PROJ",ENDA,0)),U,6)_U)
Begin DoDot:2
+15 SET ENY(19)=$GET(^ENG("PROJ",ENDA,19))
+16 IF $PIECE(ENY(19),U,8)]""
IF $PIECE(ENY(19),U,12)=""
SET $PIECE(^ENG("PROJ",ENDA,19),U,12)=$$GET1^DIQ(6925,ENDA,218)
End DoDot:2
+17 ; Set Milestone Dates to End Of Month
+18 DO SETEOM(2,2,10)
+19 DO SETEOM(3,1,9)
+20 DO SETEOM(4,1,15)
+21 DO SETEOM(50,2,19)
+22 DO SETEOM(51,1,3)
+23 DO SETEOM(56,1,12)
+24 DO SETEOM(61,2,10)
+25 DO SETEOM(62,1,9)
+26 DO SETEOM(63,1,15)
+27 DO SETEOM(66,2,19)
+28 DO SETEOM(67,1,3)
+29 DO SETEOM(69,1,12)
End DoDot:1
+30 ;
+31 ; update applicable programs for project status
+32 ; a/e
SET $PIECE(^ENG(6925.2,8,0),U,5)="MA,MI,MM,NR,SL"
+33 ; construction documents
SET $PIECE(^ENG(6925.2,11,0),U,5)="MA,MI,MM,NR,SL"
+34 ;
+35 DO MES^XPDUTL(" Completed Post-Init")
+36 QUIT
+37 ;
SETEOM(ENODE,ENPB,ENPE) ; Set Dates to End Of Month
+1 ; Input ENDA - ien of project
+2 ; ENODE - node which contains milestone dates
+3 ; ENPB - piece in ENODE to begin a range of milestones
+4 ; ENPE - piece in ENODE to end a range of milestones
+5 NEW ENI,ENW,ENY
+6 SET ENY=$GET(^ENG("PROJ",ENDA,ENODE))
SET ENW=0
+7 ;W "."
FOR ENI=ENPB:1:ENPE
IF $EXTRACT($PIECE(ENY,U,ENI),4,5)>0
IF $EXTRACT($PIECE(ENY,U,ENI),6,7)="00"
SET $PIECE(ENY,U,ENI)=$$EOM^ENUTL($PIECE(ENY,U,ENI))
SET ENW=1
+8 IF ENW
SET ^ENG("PROJ",ENDA,ENODE)=ENY
+9 QUIT
+10 ;ENXHIPS