ENWARD ;(WASH ISC)/DH-Access to Electronic Work Orders ;1.6.97
;;7.0;ENGINEERING;**35**;Aug 17, 1993
WRDEDT ;Edit electronic work orders
S DIC="^ENG(6920,",DIC(0)="AEQM",DIC("S")="I $D(^(1)),$P(^(1),U,1)=DUZ,$P(^(0),U,1)=$P(^(0),U,6)"
W !! D ^DIC K DIC("S") S DA=+Y G:DA'>0 EXIT
I $D(^ENG(6920,DA,5)),$P(^(5),U,2)]"" W !!,"This work order has been closed out.",*7 G WRDEDT
L +^ENG(6920,DA):5 I '$T W !!,"This entry being edited by another user. Please try later.",*7 G WRDEDT
N ENLOCK S ENLOCK=DA
S DIE="^ENG(6920,",DR=$S($D(^DIE("B","ENZWOWARD")):"[ENZWOWARD]",1:"[ENWOWARD]")
D ^DIE L -^ENG(6920,ENLOCK)
WRDEDT2 W !,"Print this work order" S %=2 D YN^DICN G:%=2 WRDEDT I %=0 W !,"Please answer 'Y'es or 'N'o." G WRDEDT2
D P^ENEWOD
G WRDEDT
;
WRDCK ;Display electronic work order
D SEL^ENEWOD
;
EXIT K ENSHKEY,ENSHABR,DIC,DR,DA,ENA,ENDSTAT,ENWO
K EN,ENB,ENORIG,ENX,ENNX
Q
;ENWARD
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENWARD 918 printed Dec 13, 2024@01:56:06 Page 2
ENWARD ;(WASH ISC)/DH-Access to Electronic Work Orders ;1.6.97
+1 ;;7.0;ENGINEERING;**35**;Aug 17, 1993
WRDEDT ;Edit electronic work orders
+1 SET DIC="^ENG(6920,"
SET DIC(0)="AEQM"
SET DIC("S")="I $D(^(1)),$P(^(1),U,1)=DUZ,$P(^(0),U,1)=$P(^(0),U,6)"
+2 WRITE !!
DO ^DIC
KILL DIC("S")
SET DA=+Y
if DA'>0
GOTO EXIT
+3 IF $DATA(^ENG(6920,DA,5))
IF $PIECE(^(5),U,2)]""
WRITE !!,"This work order has been closed out.",*7
GOTO WRDEDT
+4 LOCK +^ENG(6920,DA):5
IF '$TEST
WRITE !!,"This entry being edited by another user. Please try later.",*7
GOTO WRDEDT
+5 NEW ENLOCK
SET ENLOCK=DA
+6 SET DIE="^ENG(6920,"
SET DR=$SELECT($DATA(^DIE("B","ENZWOWARD")):"[ENZWOWARD]",1:"[ENWOWARD]")
+7 DO ^DIE
LOCK -^ENG(6920,ENLOCK)
WRDEDT2 WRITE !,"Print this work order"
SET %=2
DO YN^DICN
if %=2
GOTO WRDEDT
IF %=0
WRITE !,"Please answer 'Y'es or 'N'o."
GOTO WRDEDT2
+1 DO P^ENEWOD
+2 GOTO WRDEDT
+3 ;
WRDCK ;Display electronic work order
+1 DO SEL^ENEWOD
+2 ;
EXIT KILL ENSHKEY,ENSHABR,DIC,DR,DA,ENA,ENDSTAT,ENWO
+1 KILL EN,ENB,ENORIG,ENX,ENNX
+2 QUIT
+3 ;ENWARD