ENPLX ;WISC/SAB-PROJECT TRANSMISSION ;5/12/97
;;7.0;ENGINEERING;**23,28,70**;Aug 17, 1993
EN(ENTY) ; entry point
;-------------------------------------------------------------
;This option is now obsolete
;
NEW MSG ;Array for message
S MSG(1,"F")="!!!"
S MSG(1)=" This option is now Out of Order. Construction project "
S MSG(1)=MSG(1)_"data is now "
S MSG(2)=" entered and reported in a web database at "
S MSG(2)=MSG(2)_"http://vaww.domain.ext/capassets."
S MSG(3,"F")="!!"
S MSG(3)=" Please, contact your Network Capital Assets Coordinator,"
S MSG(3)=MSG(3)_" or VSSC"
S MSG(4)=" representative for assistance."
;
DO EN^DDIOL(.MSG)
;
QUIT
;
;------------------------------------------------------------
; Input Variables
; ENTY - type of transmission
; F - Five Year Facility Plan
; A - Project Appliation
; R - Progress Report
Q:$L($G(ENTY))'=1 Q:"FAR"'[ENTY
; check environment
I '$D(^DIC(6910,1,0)) W !,"Your ENG INIT PARAMETERS file (#6910) is not in order.",$C(7) G EXIT
I "FA"[ENTY D PPDOM^ENPLUTL I ENDOMAIN="" G EXIT
I "R"[ENTY D PRDOM^ENPRUTL I ENDOMAIN="" G EXIT
; check for members in mail group
S ENX=$$FIND1^DIC(3.8,"","X","EN PROJECTS")
I 'ENX W $C(7),!,"Mail group EN PROJECTS is missing." G EXIT
D LIST^DIC(3.81,","_ENX_",","","",1,"","","","","","ENQ")
I '$P(ENQ("DILIST",0),U) D G:$D(DIRUT)!'ENX EXIT
. W $C(7),!,"No members found in mail group EN PROJECTS. At least one is required."
. S DIR(0)="Y",DIR("B")="YES"
. S DIR("A")="Should you be added as a member of EN PROJECTS"
. S DIR("?",1)="Members of mail group EN PROJECTS receive messages from"
. S DIR("?",2)="the VISN concerning projects which have been transmitted"
. S DIR("?",3)="from their facility to the VISN Construction Database."
. S DIR("?")="Enter YES to be added to this mail group."
. D ^DIR K DIR Q:$D(DIRUT) I 'Y S ENX="" Q
. K ENXMY S ENXMY(DUZ)=""
. S ENX=$$MG^XMBGRP(ENX,"","","",.ENXMY,"",1)
. K ENXMY
K ENX,ENQ
; select projects
D EN^ENPLS(ENTY,1)
I '$D(^TMP($J,"L")) G EXIT
; validate projects
D EN^ENPLV(ENTY,1)
; what should be done if not all valid?
S ENX=$G(^TMP($J,"L")),ENC("V0")=$P(ENX,U)
S ENC("V1")=$P(ENX,U,3),ENC("V2")=$P(ENX,U,4),ENC("V3")=$P(ENX,U,5)
S ENT("PROJ")=ENC("V2")+ENC("V3")
I 'ENT("PROJ") W !!,"No valid projects to transmit!" G EXIT
I ENC("V1") D G EXIT
. W $C(7),!!,"Since some of the selected projects falied the validated checks,"
. W !,"none of the selected projects will be transmitted."
;I ENC("V1") D G:'Y!$D(DIRUT) EXIT
;. W !!,"Projects which failed the validation checks will not be transmitted."
;. S DIR(0)="Y",DIR("B")="NO"
;. S DIR("A")="Transmit remaining projects which passed the validation checks"
;. S DIR("?")="Answer yes to transmit projects which passed (including those with warnings)."
;. D ^DIR K DIR
RP I "R"[ENTY D G:'Y!$D(DIRUT) EXIT
. S DIR(0)="D^::EP",DIR("A")="REPORTING PERIOD"
. S ENRP=$E($S($E(DT,6,7)<21:$$FMADD^XLFDT(DT,-21),1:DT),1,5)_"00"
. S DIR("B")=$$FMTE^XLFDT(ENRP)
. S DIR("?",1)="Enter the reporting period (month and year) for the"
. S DIR("?",2)="progress reports. Each selected project will be"
. S DIR("?")="updated with this reporting period before transmission."
. D ^DIR K DIR S ENRP=$E(Y,1,5)_"00"
I "R"[ENTY,$E(ENRP,4,5)="00" W $C(7),!,"Month is required." G RP
S DIR(0)="Y",DIR("B")="Y",DIR("A")="Do you want to Queue Transmission"
S DIR("?",1)="Enter 'Y' if you want the project data placed in mail"
S DIR("?")="messages as part of a tasked job."
D ^DIR K DIR G:$D(DIRUT) EXIT I Y D G EXIT
. S ZTRTN="QEN^ENPLX",ZTIO=""
. S ZTDESC="TRAMSIT ENG PROJECT DATA ("_$P("^FYFP^APPL^REPT",U,$L("FAR",ENTY))_")"
. S ZTSAVE("ENTY")="",ZTSAVE("^TMP($J,""L"",")=""
. S ZTSAVE("ENT(")="",ZTSAVE("ENDOMAIN")=""
. S ZTSAVE("ENRP")=""
. S ZTDTH=$H D ^%ZTLOAD
. W !,ENT("PROJ")," ",$S(ENTY="F":"Five Year Plan project",ENTY="A":"Project Application",ENTY="R":"Project Progress Report",1:"")
. W $S(ENT("PROJ")=1:" was",1:"s were")," queued for transmission.",!
QEN ; queued entry point
S END=0
S (ENC("MSG"),ENC("PROJ"))=0
; determine number of msgs needed
S ENT("PACK")=$P("^10^1^5",U,$F("FAR",ENTY))
S ENT("MSG")=ENT("PROJ")\ENT("PACK")+$S(ENT("PROJ")#ENT("PACK"):1,1:0)
;
I $D(ZTQUEUED) D LOCK^ENPLX1 G:END EXIT ; lock valid projects on list
; create/send data (netmail)
S ENPN=""
F S ENPN=$O(^TMP($J,"L",ENPN)) Q:ENPN="" S ENX=^(ENPN) D G:END EXIT
. S ENDA=$P(ENX,U)
. I $P(ENX,U,2)>1 D
. . ; valid project to xmit
. . I '(ENC("PROJ")#ENT("PACK")) D CREATE^ENPLX1 Q:END
. . D:"FA"[ENTY ^ENPLX2,UPD^ENPLX1
. . D:"R"[ENTY REPTPR^ENPLX1,^ENPLX4,REPTPS^ENPLX1
. . S ENC("PROJ")=ENC("PROJ")+1
. . I $E(IOST,1,2)="C-" W "."
I $G(XMZ)'<1 D SEND^ENPLX1
I '$D(ZTQUEUED) D
. W !,ENC("PROJ")," ",$S(ENTY="F":"Five Year Plan project",ENTY="A":"Project Application",ENTY="R":"Project Progress Report",1:"")
. W $S(ENC("PROJ")=1:" was",1:"s were")," transmitted using "
. W ENC("MSG")," mail message",$S(ENC("MSG")=1:"",1:"s"),".",!
EXIT ;
D UNLOCK^ENPLS
K ^TMP($J,"L")
K %,DIR,DIROUT,DIRUT,DTOUT,DUOUT,XMCHAN,X,Y
K ENC,ENCLDT,END,ENDA,ENDOMAIN,ENDT,ENL,ENPN,ENQ
K ENRP,ENT,ENTYT,ENX,ENY
Q
;ENPLX
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENPLX 5349 printed Nov 22, 2024@17:05:23 Page 2
ENPLX ;WISC/SAB-PROJECT TRANSMISSION ;5/12/97
+1 ;;7.0;ENGINEERING;**23,28,70**;Aug 17, 1993
EN(ENTY) ; entry point
+1 ;-------------------------------------------------------------
+2 ;This option is now obsolete
+3 ;
+4 ;Array for message
NEW MSG
+5 SET MSG(1,"F")="!!!"
+6 SET MSG(1)=" This option is now Out of Order. Construction project "
+7 SET MSG(1)=MSG(1)_"data is now "
+8 SET MSG(2)=" entered and reported in a web database at "
+9 SET MSG(2)=MSG(2)_"http://vaww.domain.ext/capassets."
+10 SET MSG(3,"F")="!!"
+11 SET MSG(3)=" Please, contact your Network Capital Assets Coordinator,"
+12 SET MSG(3)=MSG(3)_" or VSSC"
+13 SET MSG(4)=" representative for assistance."
+14 ;
+15 DO EN^DDIOL(.MSG)
+16 ;
+17 QUIT
+18 ;
+19 ;------------------------------------------------------------
+20 ; Input Variables
+21 ; ENTY - type of transmission
+22 ; F - Five Year Facility Plan
+23 ; A - Project Appliation
+24 ; R - Progress Report
+25 if $LENGTH($GET(ENTY))'=1
QUIT
if "FAR"'[ENTY
QUIT
+26 ; check environment
+27 IF '$DATA(^DIC(6910,1,0))
WRITE !,"Your ENG INIT PARAMETERS file (#6910) is not in order.",$CHAR(7)
GOTO EXIT
+28 IF "FA"[ENTY
DO PPDOM^ENPLUTL
IF ENDOMAIN=""
GOTO EXIT
+29 IF "R"[ENTY
DO PRDOM^ENPRUTL
IF ENDOMAIN=""
GOTO EXIT
+30 ; check for members in mail group
+31 SET ENX=$$FIND1^DIC(3.8,"","X","EN PROJECTS")
+32 IF 'ENX
WRITE $CHAR(7),!,"Mail group EN PROJECTS is missing."
GOTO EXIT
+33 DO LIST^DIC(3.81,","_ENX_",","","",1,"","","","","","ENQ")
+34 IF '$PIECE(ENQ("DILIST",0),U)
Begin DoDot:1
+35 WRITE $CHAR(7),!,"No members found in mail group EN PROJECTS. At least one is required."
+36 SET DIR(0)="Y"
SET DIR("B")="YES"
+37 SET DIR("A")="Should you be added as a member of EN PROJECTS"
+38 SET DIR("?",1)="Members of mail group EN PROJECTS receive messages from"
+39 SET DIR("?",2)="the VISN concerning projects which have been transmitted"
+40 SET DIR("?",3)="from their facility to the VISN Construction Database."
+41 SET DIR("?")="Enter YES to be added to this mail group."
+42 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
IF 'Y
SET ENX=""
QUIT
+43 KILL ENXMY
SET ENXMY(DUZ)=""
+44 SET ENX=$$MG^XMBGRP(ENX,"","","",.ENXMY,"",1)
+45 KILL ENXMY
End DoDot:1
if $DATA(DIRUT)!'ENX
GOTO EXIT
+46 KILL ENX,ENQ
+47 ; select projects
+48 DO EN^ENPLS(ENTY,1)
+49 IF '$DATA(^TMP($JOB,"L"))
GOTO EXIT
+50 ; validate projects
+51 DO EN^ENPLV(ENTY,1)
+52 ; what should be done if not all valid?
+53 SET ENX=$GET(^TMP($JOB,"L"))
SET ENC("V0")=$PIECE(ENX,U)
+54 SET ENC("V1")=$PIECE(ENX,U,3)
SET ENC("V2")=$PIECE(ENX,U,4)
SET ENC("V3")=$PIECE(ENX,U,5)
+55 SET ENT("PROJ")=ENC("V2")+ENC("V3")
+56 IF 'ENT("PROJ")
WRITE !!,"No valid projects to transmit!"
GOTO EXIT
+57 IF ENC("V1")
Begin DoDot:1
+58 WRITE $CHAR(7),!!,"Since some of the selected projects falied the validated checks,"
+59 WRITE !,"none of the selected projects will be transmitted."
End DoDot:1
GOTO EXIT
+60 ;I ENC("V1") D G:'Y!$D(DIRUT) EXIT
+61 ;. W !!,"Projects which failed the validation checks will not be transmitted."
+62 ;. S DIR(0)="Y",DIR("B")="NO"
+63 ;. S DIR("A")="Transmit remaining projects which passed the validation checks"
+64 ;. S DIR("?")="Answer yes to transmit projects which passed (including those with warnings)."
+65 ;. D ^DIR K DIR
RP IF "R"[ENTY
Begin DoDot:1
+1 SET DIR(0)="D^::EP"
SET DIR("A")="REPORTING PERIOD"
+2 SET ENRP=$EXTRACT($SELECT($EXTRACT(DT,6,7)<21:$$FMADD^XLFDT(DT,-21),1:DT),1,5)_"00"
+3 SET DIR("B")=$$FMTE^XLFDT(ENRP)
+4 SET DIR("?",1)="Enter the reporting period (month and year) for the"
+5 SET DIR("?",2)="progress reports. Each selected project will be"
+6 SET DIR("?")="updated with this reporting period before transmission."
+7 DO ^DIR
KILL DIR
SET ENRP=$EXTRACT(Y,1,5)_"00"
End DoDot:1
if 'Y!$DATA(DIRUT)
GOTO EXIT
+8 IF "R"[ENTY
IF $EXTRACT(ENRP,4,5)="00"
WRITE $CHAR(7),!,"Month is required."
GOTO RP
+9 SET DIR(0)="Y"
SET DIR("B")="Y"
SET DIR("A")="Do you want to Queue Transmission"
+10 SET DIR("?",1)="Enter 'Y' if you want the project data placed in mail"
+11 SET DIR("?")="messages as part of a tasked job."
+12 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO EXIT
IF Y
Begin DoDot:1
+13 SET ZTRTN="QEN^ENPLX"
SET ZTIO=""
+14 SET ZTDESC="TRAMSIT ENG PROJECT DATA ("_$PIECE("^FYFP^APPL^REPT",U,$LENGTH("FAR",ENTY))_")"
+15 SET ZTSAVE("ENTY")=""
SET ZTSAVE("^TMP($J,""L"",")=""
+16 SET ZTSAVE("ENT(")=""
SET ZTSAVE("ENDOMAIN")=""
+17 SET ZTSAVE("ENRP")=""
+18 SET ZTDTH=$HOROLOG
DO ^%ZTLOAD
+19 WRITE !,ENT("PROJ")," ",$SELECT(ENTY="F":"Five Year Plan project",ENTY="A":"Project Application",ENTY="R":"Project Progress Report",1:"")
+20 WRITE $SELECT(ENT("PROJ")=1:" was",1:"s were")," queued for transmission.",!
End DoDot:1
GOTO EXIT
QEN ; queued entry point
+1 SET END=0
+2 SET (ENC("MSG"),ENC("PROJ"))=0
+3 ; determine number of msgs needed
+4 SET ENT("PACK")=$PIECE("^10^1^5",U,$FIND("FAR",ENTY))
+5 SET ENT("MSG")=ENT("PROJ")\ENT("PACK")+$SELECT(ENT("PROJ")#ENT("PACK"):1,1:0)
+6 ;
+7 ; lock valid projects on list
IF $DATA(ZTQUEUED)
DO LOCK^ENPLX1
if END
GOTO EXIT
+8 ; create/send data (netmail)
+9 SET ENPN=""
+10 FOR
SET ENPN=$ORDER(^TMP($JOB,"L",ENPN))
if ENPN=""
QUIT
SET ENX=^(ENPN)
Begin DoDot:1
+11 SET ENDA=$PIECE(ENX,U)
+12 IF $PIECE(ENX,U,2)>1
Begin DoDot:2
+13 ; valid project to xmit
+14 IF '(ENC("PROJ")#ENT("PACK"))
DO CREATE^ENPLX1
if END
QUIT
+15 if "FA"[ENTY
DO ^ENPLX2
DO UPD^ENPLX1
+16 if "R"[ENTY
DO REPTPR^ENPLX1
DO ^ENPLX4
DO REPTPS^ENPLX1
+17 SET ENC("PROJ")=ENC("PROJ")+1
+18 IF $EXTRACT(IOST,1,2)="C-"
WRITE "."
End DoDot:2
End DoDot:1
if END
GOTO EXIT
+19 IF $GET(XMZ)'<1
DO SEND^ENPLX1
+20 IF '$DATA(ZTQUEUED)
Begin DoDot:1
+21 WRITE !,ENC("PROJ")," ",$SELECT(ENTY="F":"Five Year Plan project",ENTY="A":"Project Application",ENTY="R":"Project Progress Report",1:"")
+22 WRITE $SELECT(ENC("PROJ")=1:" was",1:"s were")," transmitted using "
+23 WRITE ENC("MSG")," mail message",$SELECT(ENC("MSG")=1:"",1:"s"),".",!
End DoDot:1
EXIT ;
+1 DO UNLOCK^ENPLS
+2 KILL ^TMP($JOB,"L")
+3 KILL %,DIR,DIROUT,DIRUT,DTOUT,DUOUT,XMCHAN,X,Y
+4 KILL ENC,ENCLDT,END,ENDA,ENDOMAIN,ENDT,ENL,ENPN,ENQ
+5 KILL ENRP,ENT,ENTYT,ENX,ENY
+6 QUIT
+7 ;ENPLX