ENWOD1 ;(WASH ISC)/DLM/DH-Formatted Work Order Display ;1.28.97
;;7.0;ENGINEERING;**35**;Aug 17, 1993
; Expects DA as work order IEN
ST N X S ENDSTAT=32 F X=1:1:33 S EN(X)=""
FDAT G:'$D(^ENG(6920,DA,0)) EXIT S X(0)=^(0) S ENWO=$P(X(0),U,1),EN(2)=$P(X(0),U,2),EN(3)=$P(X(0),U,3),EN(4)=$P(X(0),U,4),EN(5)=$P(X(0),U,5) S:$E(ENWO,1,3)="PM-" ENDSTAT=35.2
I EN(3)]"" S EN(3)=$$EXTERNAL^DILFD(6920,2,"",EN(3))
I EN(4)=+EN(4),$D(^ENG("SP",EN(4),0)) S EN(4)=$P(^(0),U)
FDAT1 I $D(^ENG(6920,DA,1)) S X(1)=^(1),EN(10)=$P(X(1),U,1),EN(7)=$P(X(1),U,2),EN(8)=$P(X(1),U,3),EN(9)=$P(X(1),U,4)
I $D(^ENG(6920,DA,2)) S X(2)=^(2),EN(11)=$P(X(2),U,1),EN(1)=$P(X(2),U,2),EN(13)=$P(X(2),U,3) D SSH
I EN(13)]"" S EN(13)=$$EXTERNAL^DILFD(6920,17,"",EN(13))
FDAT3 I $D(^ENG(6920,DA,3)) S X(3)=^(3),EN(22)=$P(X(3),U),EN(16)=$P(X(3),U,2),EN(21)=$P(X(3),U,4),EN(15)=$P(X(3),U,5),EN(19)=$P(X(3),U,6),EN(20)=$P(X(3),U,7),EN(14)=$P(X(3),U,8)
I EN(14) S EN(17)=$$GET1^DIQ(6914,EN(14),53)
S EN(18)=$$GET1^DIQ(6920,DA,21.9)
I $D(^ENG(6920,DA,4)) S X(4)=^(4),EN(12)=$P(X(4),U,1),EN(23)=$P(X(4),U,2),EN(29)=$P(X(4),U,4) I ENDSTAT=32 S EN(6)=$P(X(4),U,3)
FDAT5 I $D(^ENG(6920,DA,5)) S X(5)=^(5),EN(31)=$P(X(5),U,2),EN(26)=$P(X(5),U,3),EN(27)=$P(X(5),U,4),EN(25)=$P(X(5),U,5),EN(28)=$P(X(5),U,6),EN(32)=$P(X(5),U,7) S:ENDSTAT=35.2 EN(6)=$P(X(5),U,8)
ACT I $D(^ENG(6920,DA,8)) D
. F I=0:0 S I=$O(^ENG(6920,DA,8,I)) Q:I'>0!($L(EN(24))=8) S J=$P(^ENG(6920,DA,8,I,0),U),EN(24)=EN(24)_$P(^ENG(6920.1,J,0),U,2)
I EN(25)]"",$D(^DIC(6921,EN(25),0)) S EN(25)=$P(^(0),U,1)
MTEC S (EN(30,1),EN(30,2))="" I $D(^ENG(6920,DA,7,0)) S ENJ=101 D MTECH
I EN(6)]"" S EN(6)=$$EXTERNAL^DILFD(6920,ENDSTAT,"",EN(6))
I EN(10)]"",$D(^VA(200,EN(10),0)) S EN(10)=$P(^(0),U)
SSH I EN(11)]"",$D(^DIC(6922,EN(11),0))>0 S EN(11)=$P(^DIC(6922,EN(11),0),U)
Q
;
MTECH F ENTNX=0:0 S ENTNX=$O(^ENG(6920,DA,7,ENTNX)) Q:ENTNX'>0 D
. S EN(ENJ)=$P(^(ENTNX,0),U),EN(ENJ,1)=$P(^(0),U,2),EN(ENJ,2)=$P(^(0),U,3)
. S:EN(ENJ,2)]"" EN(ENJ,2)=$S($D(^DIC(6922,EN(ENJ,2),0)):$P(^(0),U,1),1:"") S ENJ=ENJ+1
Q
EXIT ;
K ENDSTAT
Q
;ENWOD1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENWOD1 2104 printed Dec 13, 2024@01:56:13 Page 2
ENWOD1 ;(WASH ISC)/DLM/DH-Formatted Work Order Display ;1.28.97
+1 ;;7.0;ENGINEERING;**35**;Aug 17, 1993
+2 ; Expects DA as work order IEN
ST NEW X
SET ENDSTAT=32
FOR X=1:1:33
SET EN(X)=""
FDAT if '$DATA(^ENG(6920,DA,0))
GOTO EXIT
SET X(0)=^(0)
SET ENWO=$PIECE(X(0),U,1)
SET EN(2)=$PIECE(X(0),U,2)
SET EN(3)=$PIECE(X(0),U,3)
SET EN(4)=$PIECE(X(0),U,4)
SET EN(5)=$PIECE(X(0),U,5)
if $EXTRACT(ENWO,1,3)="PM-"
SET ENDSTAT=35.2
+1 IF EN(3)]""
SET EN(3)=$$EXTERNAL^DILFD(6920,2,"",EN(3))
+2 IF EN(4)=+EN(4)
IF $DATA(^ENG("SP",EN(4),0))
SET EN(4)=$PIECE(^(0),U)
FDAT1 IF $DATA(^ENG(6920,DA,1))
SET X(1)=^(1)
SET EN(10)=$PIECE(X(1),U,1)
SET EN(7)=$PIECE(X(1),U,2)
SET EN(8)=$PIECE(X(1),U,3)
SET EN(9)=$PIECE(X(1),U,4)
+1 IF $DATA(^ENG(6920,DA,2))
SET X(2)=^(2)
SET EN(11)=$PIECE(X(2),U,1)
SET EN(1)=$PIECE(X(2),U,2)
SET EN(13)=$PIECE(X(2),U,3)
DO SSH
+2 IF EN(13)]""
SET EN(13)=$$EXTERNAL^DILFD(6920,17,"",EN(13))
FDAT3 IF $DATA(^ENG(6920,DA,3))
SET X(3)=^(3)
SET EN(22)=$PIECE(X(3),U)
SET EN(16)=$PIECE(X(3),U,2)
SET EN(21)=$PIECE(X(3),U,4)
SET EN(15)=$PIECE(X(3),U,5)
SET EN(19)=$PIECE(X(3),U,6)
SET EN(20)=$PIECE(X(3),U,7)
SET EN(14)=$PIECE(X(3),U,8)
+1 IF EN(14)
SET EN(17)=$$GET1^DIQ(6914,EN(14),53)
+2 SET EN(18)=$$GET1^DIQ(6920,DA,21.9)
+3 IF $DATA(^ENG(6920,DA,4))
SET X(4)=^(4)
SET EN(12)=$PIECE(X(4),U,1)
SET EN(23)=$PIECE(X(4),U,2)
SET EN(29)=$PIECE(X(4),U,4)
IF ENDSTAT=32
SET EN(6)=$PIECE(X(4),U,3)
FDAT5 IF $DATA(^ENG(6920,DA,5))
SET X(5)=^(5)
SET EN(31)=$PIECE(X(5),U,2)
SET EN(26)=$PIECE(X(5),U,3)
SET EN(27)=$PIECE(X(5),U,4)
SET EN(25)=$PIECE(X(5),U,5)
SET EN(28)=$PIECE(X(5),U,6)
SET EN(32)=$PIECE(X(5),U,7)
if ENDSTAT=35.2
SET EN(6)=$PIECE(X(5),U,8)
ACT IF $DATA(^ENG(6920,DA,8))
Begin DoDot:1
+1 FOR I=0:0
SET I=$ORDER(^ENG(6920,DA,8,I))
if I'>0!($LENGTH(EN(24))=8)
QUIT
SET J=$PIECE(^ENG(6920,DA,8,I,0),U)
SET EN(24)=EN(24)_$PIECE(^ENG(6920.1,J,0),U,2)
End DoDot:1
+2 IF EN(25)]""
IF $DATA(^DIC(6921,EN(25),0))
SET EN(25)=$PIECE(^(0),U,1)
MTEC SET (EN(30,1),EN(30,2))=""
IF $DATA(^ENG(6920,DA,7,0))
SET ENJ=101
DO MTECH
+1 IF EN(6)]""
SET EN(6)=$$EXTERNAL^DILFD(6920,ENDSTAT,"",EN(6))
+2 IF EN(10)]""
IF $DATA(^VA(200,EN(10),0))
SET EN(10)=$PIECE(^(0),U)
SSH IF EN(11)]""
IF $DATA(^DIC(6922,EN(11),0))>0
SET EN(11)=$PIECE(^DIC(6922,EN(11),0),U)
+1 QUIT
+2 ;
MTECH FOR ENTNX=0:0
SET ENTNX=$ORDER(^ENG(6920,DA,7,ENTNX))
if ENTNX'>0
QUIT
Begin DoDot:1
+1 SET EN(ENJ)=$PIECE(^(ENTNX,0),U)
SET EN(ENJ,1)=$PIECE(^(0),U,2)
SET EN(ENJ,2)=$PIECE(^(0),U,3)
+2 if EN(ENJ,2)]""
SET EN(ENJ,2)=$SELECT($DATA(^DIC(6922,EN(ENJ,2),0)):$PIECE(^(0),U,1),1:"")
SET ENJ=ENJ+1
End DoDot:1
+3 QUIT
EXIT ;
+1 KILL ENDSTAT
+2 QUIT
+3 ;ENWOD1