source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENPLX.m@ 1361

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

initial load of WorldVistAEHR

File size: 5.1 KB
Line 
1ENPLX ;WISC/SAB-PROJECT TRANSMISSION ;5/12/97
2 ;;7.0;ENGINEERING;**23,28,70**;Aug 17, 1993
3EN(ENTY) ; entry point
4 ;-------------------------------------------------------------
5 ;This option is now obsolete
6 ;
7 NEW MSG ;Array for message
8 S MSG(1,"F")="!!!"
9 S MSG(1)=" This option is now Out of Order. Construction project "
10 S MSG(1)=MSG(1)_"data is now "
11 S MSG(2)=" entered and reported in a web database at "
12 S MSG(2)=MSG(2)_"http://vaww.va.gov/capassets."
13 S MSG(3,"F")="!!"
14 S MSG(3)=" Please, contact your Network Capital Assets Coordinator,"
15 S MSG(3)=MSG(3)_" or VSSC"
16 S MSG(4)=" representative for assistance."
17 ;
18 DO EN^DDIOL(.MSG)
19 ;
20 QUIT
21 ;
22 ;------------------------------------------------------------
23 ; Input Variables
24 ; ENTY - type of transmission
25 ; F - Five Year Facility Plan
26 ; A - Project Appliation
27 ; R - Progress Report
28 Q:$L($G(ENTY))'=1 Q:"FAR"'[ENTY
29 ; check environment
30 I '$D(^DIC(6910,1,0)) W !,"Your ENG INIT PARAMETERS file (#6910) is not in order.",$C(7) G EXIT
31 I "FA"[ENTY D PPDOM^ENPLUTL I ENDOMAIN="" G EXIT
32 I "R"[ENTY D PRDOM^ENPRUTL I ENDOMAIN="" G EXIT
33 ; check for members in mail group
34 S ENX=$$FIND1^DIC(3.8,"","X","EN PROJECTS")
35 I 'ENX W $C(7),!,"Mail group EN PROJECTS is missing." G EXIT
36 D LIST^DIC(3.81,","_ENX_",","","",1,"","","","","","ENQ")
37 I '$P(ENQ("DILIST",0),U) D G:$D(DIRUT)!'ENX EXIT
38 . W $C(7),!,"No members found in mail group EN PROJECTS. At least one is required."
39 . S DIR(0)="Y",DIR("B")="YES"
40 . S DIR("A")="Should you be added as a member of EN PROJECTS"
41 . S DIR("?",1)="Members of mail group EN PROJECTS receive messages from"
42 . S DIR("?",2)="the VISN concerning projects which have been transmitted"
43 . S DIR("?",3)="from their facility to the VISN Construction Database."
44 . S DIR("?")="Enter YES to be added to this mail group."
45 . D ^DIR K DIR Q:$D(DIRUT) I 'Y S ENX="" Q
46 . K ENXMY S ENXMY(DUZ)=""
47 . S ENX=$$MG^XMBGRP(ENX,"","","",.ENXMY,"",1)
48 . K ENXMY
49 K ENX,ENQ
50 ; select projects
51 D EN^ENPLS(ENTY,1)
52 I '$D(^TMP($J,"L")) G EXIT
53 ; validate projects
54 D EN^ENPLV(ENTY,1)
55 ; what should be done if not all valid?
56 S ENX=$G(^TMP($J,"L")),ENC("V0")=$P(ENX,U)
57 S ENC("V1")=$P(ENX,U,3),ENC("V2")=$P(ENX,U,4),ENC("V3")=$P(ENX,U,5)
58 S ENT("PROJ")=ENC("V2")+ENC("V3")
59 I 'ENT("PROJ") W !!,"No valid projects to transmit!" G EXIT
60 I ENC("V1") D G EXIT
61 . W $C(7),!!,"Since some of the selected projects falied the validated checks,"
62 . W !,"none of the selected projects will be transmitted."
63 ;I ENC("V1") D G:'Y!$D(DIRUT) EXIT
64 ;. W !!,"Projects which failed the validation checks will not be transmitted."
65 ;. S DIR(0)="Y",DIR("B")="NO"
66 ;. S DIR("A")="Transmit remaining projects which passed the validation checks"
67 ;. S DIR("?")="Answer yes to transmit projects which passed (including those with warnings)."
68 ;. D ^DIR K DIR
69RP I "R"[ENTY D G:'Y!$D(DIRUT) EXIT
70 . S DIR(0)="D^::EP",DIR("A")="REPORTING PERIOD"
71 . S ENRP=$E($S($E(DT,6,7)<21:$$FMADD^XLFDT(DT,-21),1:DT),1,5)_"00"
72 . S DIR("B")=$$FMTE^XLFDT(ENRP)
73 . S DIR("?",1)="Enter the reporting period (month and year) for the"
74 . S DIR("?",2)="progress reports. Each selected project will be"
75 . S DIR("?")="updated with this reporting period before transmission."
76 . D ^DIR K DIR S ENRP=$E(Y,1,5)_"00"
77 I "R"[ENTY,$E(ENRP,4,5)="00" W $C(7),!,"Month is required." G RP
78 S DIR(0)="Y",DIR("B")="Y",DIR("A")="Do you want to Queue Transmission"
79 S DIR("?",1)="Enter 'Y' if you want the project data placed in mail"
80 S DIR("?")="messages as part of a tasked job."
81 D ^DIR K DIR G:$D(DIRUT) EXIT I Y D G EXIT
82 . S ZTRTN="QEN^ENPLX",ZTIO=""
83 . S ZTDESC="TRAMSIT ENG PROJECT DATA ("_$P("^FYFP^APPL^REPT",U,$L("FAR",ENTY))_")"
84 . S ZTSAVE("ENTY")="",ZTSAVE("^TMP($J,""L"",")=""
85 . S ZTSAVE("ENT(")="",ZTSAVE("ENDOMAIN")=""
86 . S ZTSAVE("ENRP")=""
87 . S ZTDTH=$H D ^%ZTLOAD
88 . W !,ENT("PROJ")," ",$S(ENTY="F":"Five Year Plan project",ENTY="A":"Project Application",ENTY="R":"Project Progress Report",1:"")
89 . W $S(ENT("PROJ")=1:" was",1:"s were")," queued for transmission.",!
90QEN ; queued entry point
91 S END=0
92 S (ENC("MSG"),ENC("PROJ"))=0
93 ; determine number of msgs needed
94 S ENT("PACK")=$P("^10^1^5",U,$F("FAR",ENTY))
95 S ENT("MSG")=ENT("PROJ")\ENT("PACK")+$S(ENT("PROJ")#ENT("PACK"):1,1:0)
96 ;
97 I $D(ZTQUEUED) D LOCK^ENPLX1 G:END EXIT ; lock valid projects on list
98 ; create/send data (netmail)
99 S ENPN=""
100 F S ENPN=$O(^TMP($J,"L",ENPN)) Q:ENPN="" S ENX=^(ENPN) D G:END EXIT
101 . S ENDA=$P(ENX,U)
102 . I $P(ENX,U,2)>1 D
103 . . ; valid project to xmit
104 . . I '(ENC("PROJ")#ENT("PACK")) D CREATE^ENPLX1 Q:END
105 . . D:"FA"[ENTY ^ENPLX2,UPD^ENPLX1
106 . . D:"R"[ENTY REPTPR^ENPLX1,^ENPLX4,REPTPS^ENPLX1
107 . . S ENC("PROJ")=ENC("PROJ")+1
108 . . I $E(IOST,1,2)="C-" W "."
109 I $G(XMZ)'<1 D SEND^ENPLX1
110 I '$D(ZTQUEUED) D
111 . W !,ENC("PROJ")," ",$S(ENTY="F":"Five Year Plan project",ENTY="A":"Project Application",ENTY="R":"Project Progress Report",1:"")
112 . W $S(ENC("PROJ")=1:" was",1:"s were")," transmitted using "
113 . W ENC("MSG")," mail message",$S(ENC("MSG")=1:"",1:"s"),".",!
114EXIT ;
115 D UNLOCK^ENPLS
116 K ^TMP($J,"L")
117 K %,DIR,DIROUT,DIRUT,DTOUT,DUOUT,XMCHAN,X,Y
118 K ENC,ENCLDT,END,ENDA,ENDOMAIN,ENDT,ENL,ENPN,ENQ
119 K ENRP,ENT,ENTYT,ENX,ENY
120 Q
121 ;ENPLX
Note: See TracBrowser for help on using the repository browser.