ENPROJ ;(WIRMFO)/DLM/DH/SAB-Project Tracking Enter/Edit ;4/25/97
;;7.0;ENGINEERING;**23,28**;Aug 17, 1993
;
EDALLT ;Enter/Edit All Project Data - Template
S ENDR="[ENPRI001]" G TEMPL
;
EDALLS ;Enter/Edit All Project Data - Screen
S ENDR="[ENPR ALL]" G SCREEN
;
EDPREL ;Enter/Edit Preliminary Project Data - Screen
S ENDR="[ENPR PRELIM]" G SCREEN
;
EDMS ;Enter/Edit Milestone Data - Screen
S ENDR="[ENPR MS]" G SCREEN
;
EDAE ;Enter/Edit A/E Data - Screen
S ENDR="[ENPR AE]" G SCREEN
;
EDCO ;Enter/Edit Contractor Data - Screen
S ENDR="[ENPR CO]" G SCREEN
;
EDCHG ;Enter/Edit Changes & Remarks - Screen
S ENDR="[ENPR CHG]" G SCREEN
;
EDLOCAL ;Enter/Edit Local Project Data - Template
S ENDR=$S($D(^DIE("B","ENZPRLOCAL")):"[ENZ",1:"[EN")_"PRLOCAL]" G TEMPL
;
TEMPL ; called for input template edits
; input
; ENDR - name of template
D ASKPROJ G:'ENDA TEMPLX
S DIE="^ENG(""PROJ"",",DA=ENDA,DR=ENDR
D ^DIE K DIE,DR
I '$D(DTOUT),$D(^ENG("PROJ",ENDA,0)) D VALPROJ
L -^ENG("PROJ",ENDA)
I '$D(DTOUT),'$D(DUOUT) G TEMPL
TEMPLX ; exit
K DA,DIC,DIE,DIROUT,DIRUT,DR,DUOUT,DTOUT,X,Y
K ENAMI,ENAY,ENBC,ENBCI,ENBO,ENBOI,ENCAF,ENCMI,ENCY,ENDA,ENDR
K ENFT,ENPC,ENPCI,ENPN,ENPR,ENRY
Q
;
SCREEN ; called for screen edits
; input
; ENDR - name of form
D ASKPROJ G:'ENDA SCREENX
S DDSFILE=6925,DA=ENDA,DR=ENDR,DDSPARM="S"
D ^DDS
I $G(DDSSAVE),'$D(DTOUT),$D(^ENG("PROJ",ENDA,0)) D VALPROJ
L -^ENG("PROJ",ENDA)
I '$D(DTOUT),'$D(DUOUT) G SCREEN
SCREENX ; exit
K DA,DIC,DIE,DIROUT,DIRUT,DR,DUOUT,DTOUT,X,Y
K DDSFILE,DDSPAGE,DDSPARM,DDSSAVE
K ENDA,ENDR,ENPN
Q
;
ASKPROJ ; Ask project to edit
; output
; ENDA - ien of locked project (or null)
S ENDA=""
S DIC="^ENG(""PROJ"",",DIC(0)="AELMQ",DIC("A")="Select PROJECT NUMBER: "
S DLAYGO=6925 D ^DIC K DIC,DLAYGO I Y'>0!$D(DTOUT)!$D(DUOUT) Q
L +^ENG("PROJ",+Y):5 I '$T D Q
. W $C(7),!!,"Project is locked by another user. Please try later",!
S ENDA=+Y,ENPN=$P(Y,U,2)
I $P(Y,U,3)=1 D
. ; populate fields for new project
. N DA,DR,DIE,ENMCI
. S ENMCI=$$FIND1^DIC(4,"","O",$P(ENPN,"-"),"D")
. S DR=""
. S:ENMCI DR=DR_";3///^S X=ENMCI"
. S:"4567"[$E(ENPN) DR=DR_";158///VHA"
. S:"89"[$E(ENPN) DR=DR_";158///NCS"
. I $E(DR)=";" S DR=$E(DR,2,999)
. I DR]"" S DIE="^ENG(""PROJ"",",DA=ENDA D ^DIE
Q
;
VALPROJ ; Validate edited project
; input
; ENDA - ien of project
; ENPN - project number
S ^TMP($J,"L")=1,^TMP($J,"L",ENPN)=ENDA
D EN^ENPLV("R")
K ^TMP($J,"L")
Q
;
;ENPROJ
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENPROJ 2558 printed Oct 16, 2024@17:56:08 Page 2
ENPROJ ;(WIRMFO)/DLM/DH/SAB-Project Tracking Enter/Edit ;4/25/97
+1 ;;7.0;ENGINEERING;**23,28**;Aug 17, 1993
+2 ;
EDALLT ;Enter/Edit All Project Data - Template
+1 SET ENDR="[ENPRI001]"
GOTO TEMPL
+2 ;
EDALLS ;Enter/Edit All Project Data - Screen
+1 SET ENDR="[ENPR ALL]"
GOTO SCREEN
+2 ;
EDPREL ;Enter/Edit Preliminary Project Data - Screen
+1 SET ENDR="[ENPR PRELIM]"
GOTO SCREEN
+2 ;
EDMS ;Enter/Edit Milestone Data - Screen
+1 SET ENDR="[ENPR MS]"
GOTO SCREEN
+2 ;
EDAE ;Enter/Edit A/E Data - Screen
+1 SET ENDR="[ENPR AE]"
GOTO SCREEN
+2 ;
EDCO ;Enter/Edit Contractor Data - Screen
+1 SET ENDR="[ENPR CO]"
GOTO SCREEN
+2 ;
EDCHG ;Enter/Edit Changes & Remarks - Screen
+1 SET ENDR="[ENPR CHG]"
GOTO SCREEN
+2 ;
EDLOCAL ;Enter/Edit Local Project Data - Template
+1 SET ENDR=$SELECT($DATA(^DIE("B","ENZPRLOCAL")):"[ENZ",1:"[EN")_"PRLOCAL]"
GOTO TEMPL
+2 ;
TEMPL ; called for input template edits
+1 ; input
+2 ; ENDR - name of template
+3 DO ASKPROJ
if 'ENDA
GOTO TEMPLX
+4 SET DIE="^ENG(""PROJ"","
SET DA=ENDA
SET DR=ENDR
+5 DO ^DIE
KILL DIE,DR
+6 IF '$DATA(DTOUT)
IF $DATA(^ENG("PROJ",ENDA,0))
DO VALPROJ
+7 LOCK -^ENG("PROJ",ENDA)
+8 IF '$DATA(DTOUT)
IF '$DATA(DUOUT)
GOTO TEMPL
TEMPLX ; exit
+1 KILL DA,DIC,DIE,DIROUT,DIRUT,DR,DUOUT,DTOUT,X,Y
+2 KILL ENAMI,ENAY,ENBC,ENBCI,ENBO,ENBOI,ENCAF,ENCMI,ENCY,ENDA,ENDR
+3 KILL ENFT,ENPC,ENPCI,ENPN,ENPR,ENRY
+4 QUIT
+5 ;
SCREEN ; called for screen edits
+1 ; input
+2 ; ENDR - name of form
+3 DO ASKPROJ
if 'ENDA
GOTO SCREENX
+4 SET DDSFILE=6925
SET DA=ENDA
SET DR=ENDR
SET DDSPARM="S"
+5 DO ^DDS
+6 IF $GET(DDSSAVE)
IF '$DATA(DTOUT)
IF $DATA(^ENG("PROJ",ENDA,0))
DO VALPROJ
+7 LOCK -^ENG("PROJ",ENDA)
+8 IF '$DATA(DTOUT)
IF '$DATA(DUOUT)
GOTO SCREEN
SCREENX ; exit
+1 KILL DA,DIC,DIE,DIROUT,DIRUT,DR,DUOUT,DTOUT,X,Y
+2 KILL DDSFILE,DDSPAGE,DDSPARM,DDSSAVE
+3 KILL ENDA,ENDR,ENPN
+4 QUIT
+5 ;
ASKPROJ ; Ask project to edit
+1 ; output
+2 ; ENDA - ien of locked project (or null)
+3 SET ENDA=""
+4 SET DIC="^ENG(""PROJ"","
SET DIC(0)="AELMQ"
SET DIC("A")="Select PROJECT NUMBER: "
+5 SET DLAYGO=6925
DO ^DIC
KILL DIC,DLAYGO
IF Y'>0!$DATA(DTOUT)!$DATA(DUOUT)
QUIT
+6 LOCK +^ENG("PROJ",+Y):5
IF '$TEST
Begin DoDot:1
+7 WRITE $CHAR(7),!!,"Project is locked by another user. Please try later",!
End DoDot:1
QUIT
+8 SET ENDA=+Y
SET ENPN=$PIECE(Y,U,2)
+9 IF $PIECE(Y,U,3)=1
Begin DoDot:1
+10 ; populate fields for new project
+11 NEW DA,DR,DIE,ENMCI
+12 SET ENMCI=$$FIND1^DIC(4,"","O",$PIECE(ENPN,"-"),"D")
+13 SET DR=""
+14 if ENMCI
SET DR=DR_";3///^S X=ENMCI"
+15 if "4567"[$EXTRACT(ENPN)
SET DR=DR_";158///VHA"
+16 if "89"[$EXTRACT(ENPN)
SET DR=DR_";158///NCS"
+17 IF $EXTRACT(DR)=";"
SET DR=$EXTRACT(DR,2,999)
+18 IF DR]""
SET DIE="^ENG(""PROJ"","
SET DA=ENDA
DO ^DIE
End DoDot:1
+19 QUIT
+20 ;
VALPROJ ; Validate edited project
+1 ; input
+2 ; ENDA - ien of project
+3 ; ENPN - project number
+4 SET ^TMP($JOB,"L")=1
SET ^TMP($JOB,"L",ENPN)=ENDA
+5 DO EN^ENPLV("R")
+6 KILL ^TMP($JOB,"L")
+7 QUIT
+8 ;
+9 ;ENPROJ