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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENWOINV 1357 printed Dec 13, 2024@01:56:16 Page 2
ENWOINV ;(WIRMFO)/DLM/DH/SAB-EQUIPMENT TO WORK ORDER LINKAGE ;2.27.97
+1 ;;7.0;ENGINEERING;**35**;Aug 17, 1993
+2 QUIT
+3 ;
ST ; Mumps x-ref set logic: WORK ORDER file EQUIPMENT ID# field
+1 ; Expects IEN to Work Order File as loc var DA
+2 NEW ENDVTYP,ENINN,ENMAN,ENT1,ENT3,ENTWO,ENWON,ENX
+3 SET ENWON=DA
SET ENINN=$PIECE($GET(^ENG(6920,ENWON,3)),U,8)
+4 ; no Equipment Inv. file IEN
if ENINN=""
QUIT
+5 SET ENTWO=$GET(^ENG(6920,ENWON,3))
+6 SET ENT1=$GET(^ENG(6914,ENINN,1))
SET ENT3=$GET(^ENG(6914,ENINN,3))
+7 SET ENDVTYP=$$GET1^DIQ(6914,ENINN,6)
+8 SET ENMAN=$$GET1^DIQ(6914,ENINN,1,"I")
+9 SET ^ENG(6920,ENWON,3)=$PIECE(ENT3,U,6)_U_ENDVTYP_U_U_$PIECE(ENT3,U,2)_U_$PIECE(ENT3,U,7)_U_$PIECE(ENT1,U,2)_U_$PIECE(ENT1,U,3)_U_ENINN_U_ENMAN_U_$PIECE(ENTWO,U,10,99)
+10 SET ENTWO=^ENG(6920,ENWON,3)
+11 if $PIECE(ENTWO,U)]""
SET ^ENG(6920,"E",$EXTRACT($PIECE(ENTWO,U),1,30),ENWON)=""
+12 if $PIECE(ENTWO,U,5)]""
SET ^ENG(6920,"F",$EXTRACT($PIECE(ENTWO,U,5),1,30),ENWON)=""
+13 IF $PIECE(^ENG(6920,ENWON,0),U,4)=""
SET ENX=$PIECE(ENT3,U,5)
IF ENX]""
SET $PIECE(^(0),U,4)=ENX
SET ^ENG(6920,"C",ENX,ENWON)=""
+14 QUIT
+15 ;
KI ; Mumps x-ref kill logic: WORK ORDER file EQUIPMENT ID# field
+1 ; Expects IEN to Work Order File as loc var DA
+2 NEW ENTWO,ENWON
+3 SET ENWON=DA
SET ENTWO=$GET(^ENG(6920,ENWON,3))
+4 if $PIECE(ENTWO,U)]""
KILL ^ENG(6920,"E",$EXTRACT($PIECE(ENTWO,U,1),1,30),ENWON)
+5 if $PIECE(ENTWO,U,5)]""
KILL ^ENG(6920,"F",$EXTRACT($PIECE(ENTWO,U,5),1,30),ENWON)
+6 SET ^ENG(6920,ENWON,3)="^^^^^^^"_$PIECE(ENTWO,U,8)_"^^"_$PIECE(ENTWO,U,10,99)
+7 QUIT
+8 ;
+9 ;ENWOINV