ENY2K2 ;(WASH ISC)/DH-Generate Y2K Worklists ;5.4.98
;;7.0;ENGINEERING;**51**;Aug 17, 1993
;
Y2L ; produce Y2K worklist
W @IOF,?32,"GENERATE Y2K WORK LIST",!,?31,"VERSION ",^ENG("VERSION"),!!
W !!,"Print Y2K Work Orders for Equipment Records whose ESTIMATED Y2K COMPLIANCE"
S Y=$E(DT,1,5)_"00",%DT="AEF",%DT("A")="DATE is on or before what date: " D ^%DT G:Y'>0 OUT S ENY2DT=Y S ENPMYR=1700+$E(Y,1,3) X ^DD("DD") S ENY2DT("E")=Y
W !!,"NOTE: Equipment that is CONDITIONALLY COMPLIANT for Y2K and has no ESTIMATED",!," Y2K COMPLIANCE DATE will always appear on Y2K worklists."
;
LSTSRT K ENSRT
W !!,"Y2K work lists are collections of Y2K work orders for equipment whose Y2K",!,"CATEGORY is CONDITIONALLY COMPLIANT. They are always sorted by ASSIGNED SHOP"
W !,"with page breaks between each shop. If you request it, they will be sorted",!,"by ASSIGNED TECH (with page breaks) within each shop."
W !!,"Beyond that, how would you like your worklist to be sorted?"
S X="" R !!," (E,P,I,L,C,S or ? for Help) L// ",X:DTIME Q:$E(X)="^" S:X="" X="L" I $L(X)>1!("EPILCS"'[X) D LSTH1^ENEQPMS4 G LSTSRT
S ENSRT=X,ENSRT("ALL")=1 S:X="L" ENSRT("LOC")=1
;
LSTSRT1 S ENSRT("A")=$S(ENSRT="E":"ENTRY NUMBER",ENSRT="P":"PM NUMBER",ENSRT="I":"LOCAL ID",ENSRT="L":"LOCATION",ENSRT="C":"CATEGORY",ENSRT="S":"SERVICE",1:"")
G:ENSRT("A")="" OUT
I ENSRT'="P" S ENSRT("ALL")=0 D SPL0^ENEQPMS3 G:X=U OUT
I "EP"[ENSRT S ENSRT("LOC")=0
I "EPL"'[ENSRT D G:$D(DIRUT) OUT
. W !!,"Within "_ENSRT("A")_", shall worklist be sorted by LOCATION?"
. S DIR(0)="Y",DIR("B")="YES"
. S DIR("?",1)="If you want this list to be ordered by LOCATION within "_ENSRT("A")_","
. S DIR("?",2)="please enter 'YES', otherwise enter 'NO' and items will be ordered by"
. S DIR("?")="EQUIPMENT ENTRY NUMBER."
. D ^DIR K DIR Q:$D(DIRUT)
. S ENSRT("LOC")=$S(Y:1,1:0)
. I ENSRT("LOC") D
.. S DIR(0)="Y",DIR("A")="Shall all LOCATIONS be included",DIR("B")="YES"
.. S DIR("?",1)="Enter 'NO' if you want to screen your worklist by DIVISION, BUILDING, WING,"
.. S DIR("?",2)="and/or ROOM. If you enter 'YES' then all LOCATIONS will be included. The"
.. S DIR("?")="sort order will be DIVISION, BUILDING, WING, and finally ROOM."
.. D ^DIR K DIR Q:$D(DIRUT)
.. S ENSRT("LOC","ALL")=$S(Y:1,1:0) S:Y ENSRT("BY")="DBWR"
.. D:'ENSRT("LOC","ALL") GEN^ENSPSRT
;
LSTTEK S DIR(0)="Y",DIR("A")="Shall worklist be sorted by Y2K TECHNICIAN",DIR("B")="YES"
S DIR("?",1)="Enter 'YES' if you want your worklist sorted by Y2K TECHNICIAN, with page"
S DIR("?",2)="breaks between each TECH. If you enter 'NO' then equipment items will be"
S DIR("?")="selected without regard to RESPONSIBLE TECH."
D ^DIR K DIR G:$D(DIRUT) OUT
I 'Y S ENTECH=0,ENTECH("ALL")=1 G LSTOOS
;
LSTTEK1 W !,"For all TECH's: " S %=1 D YN^DICN G:%<0 OUT I %<1 W !,"You may select all TECH's or one specific TECH. Enter 'Y'es for a worklist",!,"which includes all equipment, regardless of Y2K TECHNICIAN." G LSTTEK1
I %=1 S ENTECH="ALL",ENTECH("ALL")=1 G LSTOOS
S DIC="^ENG(""EMP"",",DIC(0)="AEMQ" D ^DIC G:Y<0 OUT S ENTECH=+Y,ENTECH("ALL")=0
;
LSTOOS S DIR("A")="Shall 'OUT OF SERVICE' equipment be included in worklist"
S DIR(0)="Y",DIR("B")="YES"
S DIR("?",1)="Enter 'YES' if you want equipment entries with a USE STATUS of 'OUT OF"
S DIR("?")="SERVICE' to appear on this PM worklist. Otherwise enter 'NO'."
D ^DIR K DIR G:$D(DIRUT) OUT
S ENSRT("OOS")=Y
;
LST01 W !,"For all shops"
S ENSHKEY="ALL"
S DIR(0)="Y",DIR("B")="YES",DIR("?")="You may generate worklists for all shops or for one particular shop."
D ^DIR K DIR G:$D(DIRUT) OUT
I 'Y S ENSHKEY="" D SSHOP^ENWO G:ENSHKEY=-1 OUT
D DEV^ENLIB G:POP OUT I $D(IO("Q")) D G OUT
. K IO("Q")
. S ZTIO=ION,ZTRTN="ENTRY^ENY2K3",ZTSAVE("EN*")="",ZTDESC="Generate Y2K Worklist" D ^%ZTLOAD K ZTSK D HOME^%ZIS
D ENTRY^ENY2K3
;
OUT K K,ENY2DT,ENA,ENHZS,ENSHOP,ENSHKEY,ENEQDT,ENDA,ENSRT,ENTECH,ENMNTH,%DT,DIC,DNX,ENERR
Q
;
MSG R !,"Press <RETURN> to continue...",X:DTIME
Q
;ENY2K2
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2K2 4060 printed Nov 22, 2024@17:07:22 Page 2
ENY2K2 ;(WASH ISC)/DH-Generate Y2K Worklists ;5.4.98
+1 ;;7.0;ENGINEERING;**51**;Aug 17, 1993
+2 ;
Y2L ; produce Y2K worklist
+1 WRITE @IOF,?32,"GENERATE Y2K WORK LIST",!,?31,"VERSION ",^ENG("VERSION"),!!
+2 WRITE !!,"Print Y2K Work Orders for Equipment Records whose ESTIMATED Y2K COMPLIANCE"
+3 SET Y=$EXTRACT(DT,1,5)_"00"
SET %DT="AEF"
SET %DT("A")="DATE is on or before what date: "
DO ^%DT
if Y'>0
GOTO OUT
SET ENY2DT=Y
SET ENPMYR=1700+$EXTRACT(Y,1,3)
XECUTE ^DD("DD")
SET ENY2DT("E")=Y
+4 WRITE !!,"NOTE: Equipment that is CONDITIONALLY COMPLIANT for Y2K and has no ESTIMATED",!," Y2K COMPLIANCE DATE will always appear on Y2K worklists."
+5 ;
LSTSRT KILL ENSRT
+1 WRITE !!,"Y2K work lists are collections of Y2K work orders for equipment whose Y2K",!,"CATEGORY is CONDITIONALLY COMPLIANT. They are always sorted by ASSIGNED SHOP"
+2 WRITE !,"with page breaks between each shop. If you request it, they will be sorted",!,"by ASSIGNED TECH (with page breaks) within each shop."
+3 WRITE !!,"Beyond that, how would you like your worklist to be sorted?"
+4 SET X=""
READ !!," (E,P,I,L,C,S or ? for Help) L// ",X:DTIME
if $EXTRACT(X)="^"
QUIT
if X=""
SET X="L"
IF $LENGTH(X)>1!("EPILCS"'[X)
DO LSTH1^ENEQPMS4
GOTO LSTSRT
+5 SET ENSRT=X
SET ENSRT("ALL")=1
if X="L"
SET ENSRT("LOC")=1
+6 ;
LSTSRT1 SET ENSRT("A")=$SELECT(ENSRT="E":"ENTRY NUMBER",ENSRT="P":"PM NUMBER",ENSRT="I":"LOCAL ID",ENSRT="L":"LOCATION",ENSRT="C":"CATEGORY",ENSRT="S":"SERVICE",1:"")
+1 if ENSRT("A")=""
GOTO OUT
+2 IF ENSRT'="P"
SET ENSRT("ALL")=0
DO SPL0^ENEQPMS3
if X=U
GOTO OUT
+3 IF "EP"[ENSRT
SET ENSRT("LOC")=0
+4 IF "EPL"'[ENSRT
Begin DoDot:1
+5 WRITE !!,"Within "_ENSRT("A")_", shall worklist be sorted by LOCATION?"
+6 SET DIR(0)="Y"
SET DIR("B")="YES"
+7 SET DIR("?",1)="If you want this list to be ordered by LOCATION within "_ENSRT("A")_","
+8 SET DIR("?",2)="please enter 'YES', otherwise enter 'NO' and items will be ordered by"
+9 SET DIR("?")="EQUIPMENT ENTRY NUMBER."
+10 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+11 SET ENSRT("LOC")=$SELECT(Y:1,1:0)
+12 IF ENSRT("LOC")
Begin DoDot:2
+13 SET DIR(0)="Y"
SET DIR("A")="Shall all LOCATIONS be included"
SET DIR("B")="YES"
+14 SET DIR("?",1)="Enter 'NO' if you want to screen your worklist by DIVISION, BUILDING, WING,"
+15 SET DIR("?",2)="and/or ROOM. If you enter 'YES' then all LOCATIONS will be included. The"
+16 SET DIR("?")="sort order will be DIVISION, BUILDING, WING, and finally ROOM."
+17 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+18 SET ENSRT("LOC","ALL")=$SELECT(Y:1,1:0)
if Y
SET ENSRT("BY")="DBWR"
+19 if 'ENSRT("LOC","ALL")
DO GEN^ENSPSRT
End DoDot:2
End DoDot:1
if $DATA(DIRUT)
GOTO OUT
+20 ;
LSTTEK SET DIR(0)="Y"
SET DIR("A")="Shall worklist be sorted by Y2K TECHNICIAN"
SET DIR("B")="YES"
+1 SET DIR("?",1)="Enter 'YES' if you want your worklist sorted by Y2K TECHNICIAN, with page"
+2 SET DIR("?",2)="breaks between each TECH. If you enter 'NO' then equipment items will be"
+3 SET DIR("?")="selected without regard to RESPONSIBLE TECH."
+4 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO OUT
+5 IF 'Y
SET ENTECH=0
SET ENTECH("ALL")=1
GOTO LSTOOS
+6 ;
LSTTEK1 WRITE !,"For all TECH's: "
SET %=1
DO YN^DICN
if %<0
GOTO OUT
IF %<1
WRITE !,"You may select all TECH's or one specific TECH. Enter 'Y'es for a worklist",!,"which includes all equipment, regardless of Y2K TECHNICIAN."
GOTO LSTTEK1
+1 IF %=1
SET ENTECH="ALL"
SET ENTECH("ALL")=1
GOTO LSTOOS
+2 SET DIC="^ENG(""EMP"","
SET DIC(0)="AEMQ"
DO ^DIC
if Y<0
GOTO OUT
SET ENTECH=+Y
SET ENTECH("ALL")=0
+3 ;
LSTOOS SET DIR("A")="Shall 'OUT OF SERVICE' equipment be included in worklist"
+1 SET DIR(0)="Y"
SET DIR("B")="YES"
+2 SET DIR("?",1)="Enter 'YES' if you want equipment entries with a USE STATUS of 'OUT OF"
+3 SET DIR("?")="SERVICE' to appear on this PM worklist. Otherwise enter 'NO'."
+4 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO OUT
+5 SET ENSRT("OOS")=Y
+6 ;
LST01 WRITE !,"For all shops"
+1 SET ENSHKEY="ALL"
+2 SET DIR(0)="Y"
SET DIR("B")="YES"
SET DIR("?")="You may generate worklists for all shops or for one particular shop."
+3 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO OUT
+4 IF 'Y
SET ENSHKEY=""
DO SSHOP^ENWO
if ENSHKEY=-1
GOTO OUT
+5 DO DEV^ENLIB
if POP
GOTO OUT
IF $DATA(IO("Q"))
Begin DoDot:1
+6 KILL IO("Q")
+7 SET ZTIO=ION
SET ZTRTN="ENTRY^ENY2K3"
SET ZTSAVE("EN*")=""
SET ZTDESC="Generate Y2K Worklist"
DO ^%ZTLOAD
KILL ZTSK
DO HOME^%ZIS
End DoDot:1
GOTO OUT
+8 DO ENTRY^ENY2K3
+9 ;
OUT KILL K,ENY2DT,ENA,ENHZS,ENSHOP,ENSHKEY,ENEQDT,ENDA,ENSRT,ENTECH,ENMNTH,%DT,DIC,DNX,ENERR
+1 QUIT
+2 ;
MSG READ !,"Press <RETURN> to continue...",X:DTIME
+1 QUIT
+2 ;ENY2K2