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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENPLSV 1822 printed Nov 22, 2024@17:05:10 Page 2
ENPLSV ;WISC/SAB-PROJECT COMMUNICATION SERVER ;5/16/95
+1 ;;7.0;ENGINEERING;**11,23**;Aug 17, 1993
EN ;
+1 DO INIT
+2 DO GETC
+3 if 'ENABORT
DO LOAD
+4 if 'ENABORT
DO SAVECC
+5 if 'ENABORT
DO CM^ENPLSV1
+6 IF 'ENABORT
FOR
SET ENI=$ORDER(^TMP($JOB,ENI))
if 'ENI
QUIT
SET ENREC=^(ENI)
SET ENRSEG=$PIECE(ENREC,U)
DO @(ENRSEG_"^ENPLSV2")
+7 if $GET(ENDA)>0
LOCK -^ENG("PROJ",ENDA)
+8 if 'ENABORT
DO SM
+9 DO WRAPUP
+10 QUIT
INIT ; Initialization
+1 SET ENABORT=0
SET $PIECE(ENBLANK," ",81)=""
+2 KILL ^TMP($JOB)
+3 SET ENXMZ=XQMSG
SET ENXMSER="S."_XQSOP
+4 QUIT
GETC ; Get Communication Information
+1 FOR
XECUTE XMREC
if XMER
SET ENABORT=1
if ($PIECE(XMRG,U)="ENG")!ENABORT
QUIT
+2 IF 'ENABORT
Begin DoDot:1
+3 SET ENCCODE=$PIECE(XMRG,U,3)
SET ENCTYPE=$EXTRACT(ENCCODE,2,4)
+4 SET ENCDATE=$PIECE(XMRG,U,4)
SET ENCTIME=$PIECE(XMRG,U,5)
+5 SET ENCSITE=$PIECE(XMRG,U,2)
SET ENCTZD=$$TZD^ENPLUTL($$LTZ^ENPLUTL,$PIECE(XMRG,U,6))
+6 SET ENSCODE=$SELECT($EXTRACT(ENCCODE)="F":"5-Yr",1:"Appl")
+7 SET ENSFIELD=$SELECT($EXTRACT(ENCCODE)="F":"181.1",$EXTRACT(ENCCODE)="A":"251",1:"")
+8 SET ENSTEXT=$SELECT($EXTRACT(ENCCODE)="F":"5-Yr Plan Project",1:"Proj. Application")
End DoDot:1
+9 QUIT
LOAD ; Load Message into ^TMP
+1 SET ENI=0
FOR
XECUTE XMREC
if XMER!($EXTRACT(XMRG,1)="$")
QUIT
SET ENI=ENI+1
SET ^TMP($JOB,ENI)=XMRG
+2 QUIT
SAVECC ; Save Communication Comments (if any) & load first "A" segment
+1 SET ENI=""
FOR
SET ENI=$ORDER(^TMP($JOB,ENI))
if 'ENI
QUIT
SET ENREC=^(ENI)
if $PIECE(ENREC,U)="A"
QUIT
SET ^TMP($JOB,"ENCC",ENI)=$PIECE(ENREC,U,5)
+2 IF $PIECE(ENREC,U)'="A"
SET ENABORT=1
+3 IF 'ENABORT
SET ENRSEG=$PIECE(ENREC,U)
DO A^ENPLSV2
+4 QUIT
SM ; Send Message
+1 SET XMDUN="Regional Construction Database"
+2 SET ^XMB(3.9,XMZ,2,0)="^3.92A^"_ENL_"^"_ENL_"^"_DT
+3 SET XMY("G.EN PROJECTS")=""
+4 DO ENT1^XMD
+5 QUIT
WRAPUP ;
+1 IF 'ENABORT
SET XMZ=ENXMZ
SET XMSER=ENXMSER
DO REMSBMSG^XMA1C
+2 KILL ^TMP($JOB),ENABORT,ENBLANK
+3 KILL ENCCODE,ENCDATE,ENCSITE,ENCTIME,ENCTYPE,ENCTZD,ENDA,ENDT,ENI,ENJ,ENL
+4 KILL ENPACT,ENPCOM,ENPDA1,ENPDA2,ENPNBR,ENPREV,ENPSTA,ENPTI1,ENPTI2,ENPTTL
+5 KILL ENREC,ENRSEG,ENSCODE,ENSFIELD,ENSTEXT,ENXMZ,ENXMSER
+6 KILL ENWP,ENWP3,ENWP4,X,Y
+7 QUIT
+8 ;ENPLSV