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

91 lines
3.5 KiB
Mathematica

ENPLX2 ;WISC/SAB-XMIT SEGMENTS FOR FYFP,APPLICATION ;7/7/95
;;7.0;ENGINEERING;**23**;Aug 17, 1993
; Input Variables
; ENDA - ien of project
; ENL - last line written in message text
; ENTY - type of xmit (F,A)
; XMZ - message number
EN ; entry
N ENC,ENFLD,ENI,ENT,ENX,ENY
S ENY0=$G(^ENG("PROJ",ENDA,0)) ; A,C
S ENY5=$G(^ENG("PROJ",ENDA,5)) ; C,D
S ENY15=$G(^ENG("PROJ",ENDA,15)) ; D,E,J,K
S ENY24=$G(^ENG("PROJ",ENDA,24)) ; C,D
S ENY52=$G(^ENG("PROJ",ENDA,52)) ; B,C
A ; seg A
S ENX="A^"_$P(ENY0,U)_U_$P(ENY0,U,3)_U_$$GET1^DIQ(6925,ENDA_",","3:99")
S ENX=ENX_U_$P(ENY0,U,6)_U_$$GET1^DIQ(6925,ENDA_",",6)_"^|"
S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
B ; seg B
S ENX="B^"_$P($G(^ENG("PROJ",ENDA,52)),U,6)
S ENX=ENX_U_$$GET1^DIQ(6925,ENDA_",",158.1)
S ENX=ENX_U_$$GET1^DIQ(6925,ENDA_",",158.2)
S ENX=ENX_U_$$GET1^DIQ(6925,ENDA_",",176)
S ENX=ENX_U_$$GET1^DIQ(6925,ENDA_",",158.8)
S ENX=ENX_U_$P($G(^ENG("PROJ",ENDA,52)),U,10)_"^|"
S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
C ; seg C
S ENX="C^"_$P(ENY5,U,7)
S ENX=ENX_U_$P(ENY0,U,7)
S ENX=ENX_U_$P(ENY52,U,3)_U_$P(ENY52,U,4)_U_$P(ENY52,U,5)_U_$P(ENY24,U)
S ENX=ENX_U_$P(ENY24,U,2)_U_$P(ENY24,U,3)_U_$P(ENY24,U,4)
S ENX=ENX_U_$P(ENY24,U,5)_U_$P(ENY24,U,6)_U_$P(ENY24,U,7)_"^|"
S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
D ; seg D
S ENY19=$G(^ENG("PROJ",ENDA,19))
S ENX="D^"_$P(ENY24,U,8)_U_""
S ENX=ENX_U_$$GET1^DIQ(6925,ENDA_",",212)
S ENX=ENX_U_$$GET1^DIQ(6925,ENDA_",",181.1)
S ENX=ENX_U_$S($P(ENY15,U,19)]"":$P(ENY15,U,19)+17000000\1,1:"")
S ENX=ENX_U_$P(ENY5,U,2)
S ENX=ENX_U_$P($G(^ENG("PROJ",ENDA,1)),U,1)
S ENX=ENX_U_$P(ENY19,U,10)_U_$P(ENY19,U,11)_"^|"
S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
K ENY19
E ; seg E
S ENY55=$G(^ENG("PROJ",ENDA,55))
S ENX="E^"_$P(ENY55,U)_U_$P(ENY55,U,2)_U_$P(ENY55,U,3)
S ENX=ENX_U_$P(ENY55,U,4)_U_$P(ENY55,U,5)_U_$P(ENY55,U,6)
S ENX=ENX_U_$P(ENY55,U,7)_U_$P(ENY55,U,8)_U_$P(ENY55,U,9)
S ENX=ENX_U_$P(ENY15,U,3)_"^|"
S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
K ENY55
F ; seg F (citations)
S ENI=0 F ENT=0:1 S ENI=$O(^ENG("PROJ",ENDA,21,ENI)) Q:'ENI
I ENT S ENI=0 F ENC=1:1 S ENI=$O(^ENG("PROJ",ENDA,21,ENI)) Q:'ENI D
. S ENY=$G(^ENG("PROJ",ENDA,21,ENI,0)) Q:ENY=""
. S ENX="F^"_ENC_U_ENT_U_$P(ENY,U)
. S ENX=ENX_U_$S($P(ENY,U,3)]"":$P(ENY,U,3)+17000000\1,1:"")
. S ENX=ENX_U_$$GET1^DIQ(6925.0164,ENI_","_ENDA_",",3)
. S ENX=ENX_U_$P(ENY,U,5)_U_$P(ENY,U,6)_U_$P(ENY,U,7)_U_$P(ENY,U,8)_"^|"
. S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
H ; seg H (equipment > $250K)
S ENI=0 F ENT=0:1 S ENI=$O(^ENG("PROJ",ENDA,25,ENI)) Q:'ENI
I ENT S ENI=0 F ENC=1:1 S ENI=$O(^ENG("PROJ",ENDA,25,ENI)) Q:'ENI D
. S ENY=$G(^ENG("PROJ",ENDA,25,ENI,0)) Q:ENY=""
. S ENX="H^"_ENC_U_ENT_U_$P(ENY,U)_U_$P(ENY,U,2)_U_$P(ENY,U,3)
. S ENX=ENX_U_$P(ENY,U,4)_"^|"
. S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
I ; seg I (word processing for FYFP)
F ENFLD=192,192.3 D WP
; additinal 5-Yr or Application Segments
I ENTY="F" D BLDG^ENPLX3
I ENTY="A" D EN^ENPLX3
EX ; exit
K ENY0,ENY5,ENY15,ENY24,ENY52
Q
WP ; (word processing field for ENFLD in seg I)
N DIWL,DIWR,DIWF,ENGBL,ENODE
K ^UTILITY($J,"W")
S DIWL=1,DIWR="",DIWF="|C76"
S ENODE=$P($$GET1^DID(6925,ENFLD,"","GLOBAL SUBSCRIPT LOCATION"),";")
S ENGBL="^ENG(""PROJ"",ENDA,ENODE,ENI)"
S ENI=0 F S ENI=$O(@ENGBL) Q:'ENI S X=$G(^(ENI,0)) D:X]"" ^DIWP
S ENT=$G(^UTILITY($J,"W",1))+0
I ENT S ENI=0 F ENC=1:1 S ENI=$O(^UTILITY($J,"W",1,ENI)) Q:'ENI D
. S ENX="I^"_ENFLD_U_ENC_U_ENT_U_$E(^UTILITY($J,"W",1,ENI,0),1,220)_"^|"
. S ENL=ENL+1,^XMB(3.9,XMZ,2,ENL,0)=ENX
K ^UTILITY($J,"W"),X
Q
;ENPLX2