ENWOST ;(WASH ISC)/DLM/JED-Incomp Engineering Work Orders ;2.7.97
;;7.0;ENGINEERING;**6,35**;Aug 17, 1993
;
V Q ;Option ENWO-STATUS-(HC) no longer supported
;
E ; By employee
D SSHOP^ENWO G:ENSHKEY'>0 EXIT
S DIC="^ENG(""EMP"",",DIC("A")="Select EMPLOYEE NAME (press <ENTER> for unassigned): ",DIC(0)="AEQM" D ^DIC S ENEMP=+Y
I ENEMP'>0 D
. R !,"Type 'NOT' to get unassigned work orders: EXIT// ",X:DTIME
. I "^NOT^Not^not^"[(U_X_U) S ENEMP=""
G:ENEMP<0 EXIT
S ENBY="EMP" G COMN
;
ROOM ; By specific room (from Space File #6928)
D SSHOP^ENWO G:ENSHKEY'>0 EXIT
S DIC="^ENG(""SP"",",DIC(0)="AEQM" D ^DIC G:Y'>0 EXIT S ENROOM=+Y
S ENBY="ROOM" G COMN
;
L ;By location
D SSHOP^ENWO G:ENSHKEY'>0 EXIT
S DIR(0)="Y",DIR("A")="Should all LOCATIONS be included",DIR("B")="YES"
S DIR("?",1)="Enter 'NO' if you want to screen your list by DIVISION, BUILDING, WING,"
S DIR("?",2)="and/or ROOM. If you enter 'YES' then all locations will be included and the"
S DIR("?")="sort order will be DIVISION, BUILDING, WING, and finally ROOM."
D ^DIR K DIR Q:$D(DIRUT)
S ENSRT("LOC","ALL")=Y S:Y ENSRT("BY")="DBWR"
D:'Y GEN^ENSPSRT
I '$D(ENSRT("BY")) G EXIT
S ENBY="LOC" G COMN
;
O ;By service
D SSHOP^ENWO G:ENSHKEY'>0 EXIT
S DIC="^DIC(49,",DIC(0)="AEQM" D ^DIC G:Y'>0 EXIT S ENONR=+Y
S ENBY="ONR" G COMN
;
S ;By shop
D SSHOP^ENWO G:ENSHKEY'>0 EXIT
S ENBY="SHOP"
COMN D AGE G:ENDLQ="^" EXIT
D PM G:ENPMINC'?1N EXIT
D COUNT G:ENSUM'?1N EXIT
ALL K ENSHKEY("ALL") W !,"For ALL shops (say 'NO' if you only want ",$P(^DIC(6922,ENSHKEY,0),U),")"
S %=2 D YN^DICN G:%<0 EXIT G:%=0 ALL
S:%=1 ENSHKEY("ALL")=1
D DEV^ENLIB G:POP EXIT
I $D(IO("Q")) S ZTION=ION,ZTRTN="CONT^ENWOST",ZTDESC="Print Incomplete Work Orders",ZTSAVE("EN*")="" D ^%ZTLOAD K IO("Q"),ZTSK D HOME^%ZIS G EXIT
CONT U IO I ENSUM D ^ENWOP2 G EXIT
D ^ENWOP
G EXIT
;
AGE S DIR(0)="N^0:999:0",DIR("A")="At least how many days old?"
S DIR("B")=0
D ^DIR K DIR S ENDLQ=Y
Q
;
PM S DIR(0)="Y",DIR("A")="Include PM Work Orders",DIR("B")="NO"
S DIR("??")="^D HLPPM^ENWOST"
D ^DIR K DIR S ENPMINC=Y
Q
;
COUNT S DIR(0)="Y",DIR("A")="Count(s) only",DIR("B")="NO"
D ^DIR K DIR S ENSUM=Y
Q
;
EXIT K A,B,C,J,DIC,DIE,DA,DN,DNX,L,R,X,EN,ENDLQ,ENEMP,ENONR,ENRLOC,ENBY,ENSHKEY("ALL"),ENPMINC
K ENSUM,ENSRT,ENROOM
I $E(IOST,1,2)="P-",'$D(ZTQUEUED) D ^%ZISC
S:$D(ZTQUEUED) ZTREQ="@"
Q
;
HLPPM W !!,"If you answer 'YES' the Incomplete Work Order list will contain PM work",!,"orders. To get a list of 'regular' work orders only, just say 'NO'.",!!
Q
;ENWOST
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENWOST 2605 printed Dec 13, 2024@01:56:29 Page 2
ENWOST ;(WASH ISC)/DLM/JED-Incomp Engineering Work Orders ;2.7.97
+1 ;;7.0;ENGINEERING;**6,35**;Aug 17, 1993
+2 ;
V ;Option ENWO-STATUS-(HC) no longer supported
QUIT
+1 ;
E ; By employee
+1 DO SSHOP^ENWO
if ENSHKEY'>0
GOTO EXIT
+2 SET DIC="^ENG(""EMP"","
SET DIC("A")="Select EMPLOYEE NAME (press <ENTER> for unassigned): "
SET DIC(0)="AEQM"
DO ^DIC
SET ENEMP=+Y
+3 IF ENEMP'>0
Begin DoDot:1
+4 READ !,"Type 'NOT' to get unassigned work orders: EXIT// ",X:DTIME
+5 IF "^NOT^Not^not^"[(U_X_U)
SET ENEMP=""
End DoDot:1
+6 if ENEMP<0
GOTO EXIT
+7 SET ENBY="EMP"
GOTO COMN
+8 ;
ROOM ; By specific room (from Space File #6928)
+1 DO SSHOP^ENWO
if ENSHKEY'>0
GOTO EXIT
+2 SET DIC="^ENG(""SP"","
SET DIC(0)="AEQM"
DO ^DIC
if Y'>0
GOTO EXIT
SET ENROOM=+Y
+3 SET ENBY="ROOM"
GOTO COMN
+4 ;
L ;By location
+1 DO SSHOP^ENWO
if ENSHKEY'>0
GOTO EXIT
+2 SET DIR(0)="Y"
SET DIR("A")="Should all LOCATIONS be included"
SET DIR("B")="YES"
+3 SET DIR("?",1)="Enter 'NO' if you want to screen your list by DIVISION, BUILDING, WING,"
+4 SET DIR("?",2)="and/or ROOM. If you enter 'YES' then all locations will be included and the"
+5 SET DIR("?")="sort order will be DIVISION, BUILDING, WING, and finally ROOM."
+6 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+7 SET ENSRT("LOC","ALL")=Y
if Y
SET ENSRT("BY")="DBWR"
+8 if 'Y
DO GEN^ENSPSRT
+9 IF '$DATA(ENSRT("BY"))
GOTO EXIT
+10 SET ENBY="LOC"
GOTO COMN
+11 ;
O ;By service
+1 DO SSHOP^ENWO
if ENSHKEY'>0
GOTO EXIT
+2 SET DIC="^DIC(49,"
SET DIC(0)="AEQM"
DO ^DIC
if Y'>0
GOTO EXIT
SET ENONR=+Y
+3 SET ENBY="ONR"
GOTO COMN
+4 ;
S ;By shop
+1 DO SSHOP^ENWO
if ENSHKEY'>0
GOTO EXIT
+2 SET ENBY="SHOP"
COMN DO AGE
if ENDLQ="^"
GOTO EXIT
+1 DO PM
if ENPMINC'?1N
GOTO EXIT
+2 DO COUNT
if ENSUM'?1N
GOTO EXIT
ALL KILL ENSHKEY("ALL")
WRITE !,"For ALL shops (say 'NO' if you only want ",$PIECE(^DIC(6922,ENSHKEY,0),U),")"
+1 SET %=2
DO YN^DICN
if %<0
GOTO EXIT
if %=0
GOTO ALL
+2 if %=1
SET ENSHKEY("ALL")=1
+3 DO DEV^ENLIB
if POP
GOTO EXIT
+4 IF $DATA(IO("Q"))
SET ZTION=ION
SET ZTRTN="CONT^ENWOST"
SET ZTDESC="Print Incomplete Work Orders"
SET ZTSAVE("EN*")=""
DO ^%ZTLOAD
KILL IO("Q"),ZTSK
DO HOME^%ZIS
GOTO EXIT
CONT USE IO
IF ENSUM
DO ^ENWOP2
GOTO EXIT
+1 DO ^ENWOP
+2 GOTO EXIT
+3 ;
AGE SET DIR(0)="N^0:999:0"
SET DIR("A")="At least how many days old?"
+1 SET DIR("B")=0
+2 DO ^DIR
KILL DIR
SET ENDLQ=Y
+3 QUIT
+4 ;
PM SET DIR(0)="Y"
SET DIR("A")="Include PM Work Orders"
SET DIR("B")="NO"
+1 SET DIR("??")="^D HLPPM^ENWOST"
+2 DO ^DIR
KILL DIR
SET ENPMINC=Y
+3 QUIT
+4 ;
COUNT SET DIR(0)="Y"
SET DIR("A")="Count(s) only"
SET DIR("B")="NO"
+1 DO ^DIR
KILL DIR
SET ENSUM=Y
+2 QUIT
+3 ;
EXIT KILL A,B,C,J,DIC,DIE,DA,DN,DNX,L,R,X,EN,ENDLQ,ENEMP,ENONR,ENRLOC,ENBY,ENSHKEY("ALL"),ENPMINC
+1 KILL ENSUM,ENSRT,ENROOM
+2 IF $EXTRACT(IOST,1,2)="P-"
IF '$DATA(ZTQUEUED)
DO ^%ZISC
+3 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+4 QUIT
+5 ;
HLPPM WRITE !!,"If you answer 'YES' the Incomplete Work Order list will contain PM work",!,"orders. To get a list of 'regular' work orders only, just say 'NO'.",!!
+1 QUIT
+2 ;ENWOST