VistA-FOIAVistA/r/ENGINEERING-EN/ENPLSV.m

52 lines
1.7 KiB
Mathematica

ENPLSV ;WISC/SAB-PROJECT COMMUNICATION SERVER ;5/16/95
;;7.0;ENGINEERING;**11,23**;Aug 17, 1993
EN ;
D INIT
D GETC
D:'ENABORT LOAD
D:'ENABORT SAVECC
D:'ENABORT CM^ENPLSV1
I 'ENABORT F S ENI=$O(^TMP($J,ENI)) Q:'ENI S ENREC=^(ENI),ENRSEG=$P(ENREC,U) D @(ENRSEG_"^ENPLSV2")
L:$G(ENDA)>0 -^ENG("PROJ",ENDA)
D:'ENABORT SM
D WRAPUP
Q
INIT ; Initialization
S ENABORT=0,$P(ENBLANK," ",81)=""
K ^TMP($J)
S ENXMZ=XQMSG,ENXMSER="S."_XQSOP
Q
GETC ; Get Communication Information
F X XMREC S:XMER ENABORT=1 Q:($P(XMRG,U)="ENG")!ENABORT
I 'ENABORT D
.S ENCCODE=$P(XMRG,U,3),ENCTYPE=$E(ENCCODE,2,4)
.S ENCDATE=$P(XMRG,U,4),ENCTIME=$P(XMRG,U,5)
.S ENCSITE=$P(XMRG,U,2),ENCTZD=$$TZD^ENPLUTL($$LTZ^ENPLUTL,$P(XMRG,U,6))
.S ENSCODE=$S($E(ENCCODE)="F":"5-Yr",1:"Appl")
.S ENSFIELD=$S($E(ENCCODE)="F":"181.1",$E(ENCCODE)="A":"251",1:"")
.S ENSTEXT=$S($E(ENCCODE)="F":"5-Yr Plan Project",1:"Proj. Application")
Q
LOAD ; Load Message into ^TMP
S ENI=0 F X XMREC Q:XMER!($E(XMRG,1)="$") S ENI=ENI+1,^TMP($J,ENI)=XMRG
Q
SAVECC ; Save Communication Comments (if any) & load first "A" segment
S ENI="" F S ENI=$O(^TMP($J,ENI)) Q:'ENI S ENREC=^(ENI) Q:$P(ENREC,U)="A" S ^TMP($J,"ENCC",ENI)=$P(ENREC,U,5)
I $P(ENREC,U)'="A" S ENABORT=1
I 'ENABORT S ENRSEG=$P(ENREC,U) D A^ENPLSV2
Q
SM ; Send Message
S XMDUN="Regional Construction Database"
S ^XMB(3.9,XMZ,2,0)="^3.92A^"_ENL_"^"_ENL_"^"_DT
S XMY("G.EN PROJECTS")=""
D ENT1^XMD
Q
WRAPUP ;
I 'ENABORT S XMZ=ENXMZ,XMSER=ENXMSER D REMSBMSG^XMA1C
K ^TMP($J),ENABORT,ENBLANK
K ENCCODE,ENCDATE,ENCSITE,ENCTIME,ENCTYPE,ENCTZD,ENDA,ENDT,ENI,ENJ,ENL
K ENPACT,ENPCOM,ENPDA1,ENPDA2,ENPNBR,ENPREV,ENPSTA,ENPTI1,ENPTI2,ENPTTL
K ENREC,ENRSEG,ENSCODE,ENSFIELD,ENSTEXT,ENXMZ,ENXMSER
K ENWP,ENWP3,ENWP4,X,Y
Q
;ENPLSV