VistA-WorldVistAEHR/r/ENGINEERING-EN/ENWOINV.m

31 lines
1.3 KiB
Mathematica

ENWOINV ;(WIRMFO)/DLM/DH/SAB-EQUIPMENT TO WORK ORDER LINKAGE ;2.27.97
;;7.0;ENGINEERING;**35**;Aug 17, 1993
Q
;
ST ; Mumps x-ref set logic: WORK ORDER file EQUIPMENT ID# field
; Expects IEN to Work Order File as loc var DA
N ENDVTYP,ENINN,ENMAN,ENT1,ENT3,ENTWO,ENWON,ENX
S ENWON=DA,ENINN=$P($G(^ENG(6920,ENWON,3)),U,8)
Q:ENINN="" ; no Equipment Inv. file IEN
S ENTWO=$G(^ENG(6920,ENWON,3))
S ENT1=$G(^ENG(6914,ENINN,1)),ENT3=$G(^ENG(6914,ENINN,3))
S ENDVTYP=$$GET1^DIQ(6914,ENINN,6)
S ENMAN=$$GET1^DIQ(6914,ENINN,1,"I")
S ^ENG(6920,ENWON,3)=$P(ENT3,U,6)_U_ENDVTYP_U_U_$P(ENT3,U,2)_U_$P(ENT3,U,7)_U_$P(ENT1,U,2)_U_$P(ENT1,U,3)_U_ENINN_U_ENMAN_U_$P(ENTWO,U,10,99)
S ENTWO=^ENG(6920,ENWON,3)
S:$P(ENTWO,U)]"" ^ENG(6920,"E",$E($P(ENTWO,U),1,30),ENWON)=""
S:$P(ENTWO,U,5)]"" ^ENG(6920,"F",$E($P(ENTWO,U,5),1,30),ENWON)=""
I $P(^ENG(6920,ENWON,0),U,4)="" S ENX=$P(ENT3,U,5) I ENX]"" S $P(^(0),U,4)=ENX,^ENG(6920,"C",ENX,ENWON)=""
Q
;
KI ; Mumps x-ref kill logic: WORK ORDER file EQUIPMENT ID# field
; Expects IEN to Work Order File as loc var DA
N ENTWO,ENWON
S ENWON=DA,ENTWO=$G(^ENG(6920,ENWON,3))
K:$P(ENTWO,U)]"" ^ENG(6920,"E",$E($P(ENTWO,U,1),1,30),ENWON)
K:$P(ENTWO,U,5)]"" ^ENG(6920,"F",$E($P(ENTWO,U,5),1,30),ENWON)
S ^ENG(6920,ENWON,3)="^^^^^^^"_$P(ENTWO,U,8)_"^^"_$P(ENTWO,U,10,99)
Q
;
;ENWOINV