ENEQPMS1 ;(WASH ISC)/DH-Generate PMI Worklists ;1/24/2001
;;7.0;ENGINEERING;**35,42,68**;Aug 17, 1993
WK ;Produce weekly PM worklist
W @IOF,?25,"GENERATE WEEKLY PM LIST(S)",!,?31,"VERSION ",^ENG("VERSION"),!!
S ENDATE=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3),Y=$E(DT,1,5)_"00" X ^DD("DD")
S %DT("A")="Select Month: ",%DT("B")=Y,%DT="AEFMX" D ^%DT G:Y'>0 OUT S ENPMDT=$E(Y,2,5),ENPMMN=$E(Y,4,5) S:$E(ENPMMN)=0 ENPMMN=$E(ENPMMN,2,2)
WK1 R !,"Week number (enter an integer from 1 to 5, or '^' to escape): ",X:DTIME G:X="^" OUT I X?1N,X>0,X<6 S ENPMWK=X,ENPM="W"_X G LSTSRT
W "??",*7 G WK1
;
MNTH ;Produce monthly PM worklist
S ENPM="M" W @IOF,?25,"GENERATE MONTHLY PM LIST(S)",!,?31,"VERSION ",^ENG("VERSION"),!!
S ENDATE=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3),Y=$E(DT,1,5)_"00" X ^DD("DD")
S %DT("A")="Select Month: ",%DT("B")=Y,%DT="AEFMX" D ^%DT G:Y'>0 OUT S ENPMDT=$E(Y,2,5),ENPMMN=$E(Y,4,5) S:$E(ENPMMN)="0" ENPMMN=$E(ENPMMN,2,2) S ENPMYR=1700+$E(Y,1,3)
;
LSTSRT K ENSRT S I=$O(^ENG(6910.2,"B","PM SORT",0)) I I>0,$D(^ENG(6910.2,I,0)) S ENSRT=$P(^(0),U,2) I ENSRT?1U,"EPILCS"[ENSRT S ENSRT("ALL")=1 S:ENSRT="L" ENSRT("LOC")=1 G LSTSRT1
S X="" R !,"Sort by: (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 RESPONSIBLE TECHNICIAN",DIR("B")="YES"
S DIR("?",1)="Enter 'YES' if you want your worklist sorted by RESPONSIBLE TECHNICIAN, with"
S DIR("?",2)="page breaks between each TECH. If you enter 'NO' then equipment items will"
S DIR("?")="be 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 RESPONSIBLE 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
;
LST0 Q:'$D(ENPM) K ENCRIT R !,"For what levels of CRITICALITY: ALL// ",X:DTIME G:X="^" OUT I X=""!(X="ALL") S ENCRIT("ALL")="" G LST01
I $E(X)="?" D LSTH0 G LST0
I X'?1.2N1P.N!(X'["-") W "??",*7 D LSTH0 G LST0
S ENCRIT("FR")=$P(X,"-",1),ENCRIT("TO")=$P(X,"-",2) I ENCRIT("FR")>ENCRIT("TO") W "??",*7 D LSTH0 G LST0
S DIR("A",1)="Should equipment for which no CRITICALITY has been recorded be included on"
S DIR("A")="this worklist",DIR("B")="YES",DIR(0)="Y"
S DIR("?")="If we don't know the CRITICALITY do you want to see the equipment?"
D ^DIR K DIR G:$D(DIRUT) OUT
S ENCRIT("NULL")=Y
;
LST01 W !,"For all shops" S %=1 D YN^DICN Q:%<0 G:%=1 LST1 I %=0 W !,"You may generate worklists for ALL shops or for ONE PARTICULAR shop." G LST01
D SSHOP^ENWO G:ENSHKEY=-1 OUT D DEV^ENLIB G:POP OUT I $D(IO("Q")) K IO("Q") S ZTIO=ION,ZTRTN="NTRY^ENEQPMS2",ZTSAVE("EN*")="",ZTDESC="Generate Engineering PMI List" D ^%ZTLOAD K ZTSK D HOME^%ZIS G OUT
D NTRY^ENEQPMS2 ;One shop
G OUT
;
LST1 D DEV^ENLIB G:POP OUT I $D(IO("Q")) K IO("Q") S ZTIO=ION,ZTRTN="MNTRY^ENEQPMS2",ZTSAVE("EN*")="",ZTDESC="Generate Engineering PMI List" D ^%ZTLOAD K ZTSK D HOME^%ZIS G OUT
D MNTRY^ENEQPMS2 ;All shops
;
OUT K K,S,%OPT,%O,ENDATE,ENPM,ENPMDT,ENA,ENHZS,ENPMWK,ENSHOP,ENSHKEY,ENPMMN,ENSTMN,ENSTYR,ENCRIT,ENDA,ENSRT,ENTECH,ENMNTH,%DT,DIC,DNX,ENERR,ENMN
Q
;
MSG R !,"Press <RETURN> to continue...",X:DTIME Q
;
LSTH0 W !,"This feature enables you to print a 'partial' PMI list, containing only those",!,"devices whose 'CRITICALITY' falls within a certain range."
W !!,"For example, if your site ranks devices from 1 to 10 (10 being most critical)",!,"and circumstances are such that you only have resources for a limited number"
W !,"of PMI's in a given month, you may wish to enter something like '6-10'. This",!,"will mean that PMI's which would normally be scheduled for devices in the"
W !,"criticality range 1-5 will be suppressed, as will entries with 'CRITICALITY'",!,"greater than 10, but since your site only uses 1 thru 10 there shouldn't be",!,"any."
W !!,"The system will not attempt to re-schedule these PMI's for the next month,"
W !,"because that would tend to defeat any efforts to balance the PM work load."
W !!,"In short, this feature is not intended for routine use but rather as a sys-",!,"tematic approach to dealing with an exceptional situation."
W !!,"Entries must be in the form 'M-N' where M and N are integers in the range of",!,"1 to 99 and M is less than or equal to N."
Q
;ENEQPMS1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQPMS1 6203 printed Oct 16, 2024@17:53:42 Page 2
ENEQPMS1 ;(WASH ISC)/DH-Generate PMI Worklists ;1/24/2001
+1 ;;7.0;ENGINEERING;**35,42,68**;Aug 17, 1993
WK ;Produce weekly PM worklist
+1 WRITE @IOF,?25,"GENERATE WEEKLY PM LIST(S)",!,?31,"VERSION ",^ENG("VERSION"),!!
+2 SET ENDATE=$EXTRACT(DT,4,5)_"/"_$EXTRACT(DT,6,7)_"/"_$EXTRACT(DT,2,3)
SET Y=$EXTRACT(DT,1,5)_"00"
XECUTE ^DD("DD")
+3 SET %DT("A")="Select Month: "
SET %DT("B")=Y
SET %DT="AEFMX"
DO ^%DT
if Y'>0
GOTO OUT
SET ENPMDT=$EXTRACT(Y,2,5)
SET ENPMMN=$EXTRACT(Y,4,5)
if $EXTRACT(ENPMMN)=0
SET ENPMMN=$EXTRACT(ENPMMN,2,2)
WK1 READ !,"Week number (enter an integer from 1 to 5, or '^' to escape): ",X:DTIME
if X="^"
GOTO OUT
IF X?1N
IF X>0
IF X<6
SET ENPMWK=X
SET ENPM="W"_X
GOTO LSTSRT
+1 WRITE "??",*7
GOTO WK1
+2 ;
MNTH ;Produce monthly PM worklist
+1 SET ENPM="M"
WRITE @IOF,?25,"GENERATE MONTHLY PM LIST(S)",!,?31,"VERSION ",^ENG("VERSION"),!!
+2 SET ENDATE=$EXTRACT(DT,4,5)_"/"_$EXTRACT(DT,6,7)_"/"_$EXTRACT(DT,2,3)
SET Y=$EXTRACT(DT,1,5)_"00"
XECUTE ^DD("DD")
+3 SET %DT("A")="Select Month: "
SET %DT("B")=Y
SET %DT="AEFMX"
DO ^%DT
if Y'>0
GOTO OUT
SET ENPMDT=$EXTRACT(Y,2,5)
SET ENPMMN=$EXTRACT(Y,4,5)
if $EXTRACT(ENPMMN)="0"
SET ENPMMN=$EXTRACT(ENPMMN,2,2)
SET ENPMYR=1700+$EXTRACT(Y,1,3)
+4 ;
LSTSRT KILL ENSRT
SET I=$ORDER(^ENG(6910.2,"B","PM SORT",0))
IF I>0
IF $DATA(^ENG(6910.2,I,0))
SET ENSRT=$PIECE(^(0),U,2)
IF ENSRT?1U
IF "EPILCS"[ENSRT
SET ENSRT("ALL")=1
if ENSRT="L"
SET ENSRT("LOC")=1
GOTO LSTSRT1
+1 SET X=""
READ !,"Sort by: (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
+2 SET ENSRT=X
SET ENSRT("ALL")=1
if X="L"
SET ENSRT("LOC")=1
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 RESPONSIBLE TECHNICIAN"
SET DIR("B")="YES"
+1 SET DIR("?",1)="Enter 'YES' if you want your worklist sorted by RESPONSIBLE TECHNICIAN, with"
+2 SET DIR("?",2)="page breaks between each TECH. If you enter 'NO' then equipment items will"
+3 SET DIR("?")="be 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
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 RESPONSIBLE 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 ;
LST0 if '$DATA(ENPM)
QUIT
KILL ENCRIT
READ !,"For what levels of CRITICALITY: ALL// ",X:DTIME
if X="^"
GOTO OUT
IF X=""!(X="ALL")
SET ENCRIT("ALL")=""
GOTO LST01
+1 IF $EXTRACT(X)="?"
DO LSTH0
GOTO LST0
+2 IF X'?1.2N1P.N!(X'["-")
WRITE "??",*7
DO LSTH0
GOTO LST0
+3 SET ENCRIT("FR")=$PIECE(X,"-",1)
SET ENCRIT("TO")=$PIECE(X,"-",2)
IF ENCRIT("FR")>ENCRIT("TO")
WRITE "??",*7
DO LSTH0
GOTO LST0
+4 SET DIR("A",1)="Should equipment for which no CRITICALITY has been recorded be included on"
+5 SET DIR("A")="this worklist"
SET DIR("B")="YES"
SET DIR(0)="Y"
+6 SET DIR("?")="If we don't know the CRITICALITY do you want to see the equipment?"
+7 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO OUT
+8 SET ENCRIT("NULL")=Y
+9 ;
LST01 WRITE !,"For all shops"
SET %=1
DO YN^DICN
if %<0
QUIT
if %=1
GOTO LST1
IF %=0
WRITE !,"You may generate worklists for ALL shops or for ONE PARTICULAR shop."
GOTO LST01
+1 DO SSHOP^ENWO
if ENSHKEY=-1
GOTO OUT
DO DEV^ENLIB
if POP
GOTO OUT
IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTIO=ION
SET ZTRTN="NTRY^ENEQPMS2"
SET ZTSAVE("EN*")=""
SET ZTDESC="Generate Engineering PMI List"
DO ^%ZTLOAD
KILL ZTSK
DO HOME^%ZIS
GOTO OUT
+2 ;One shop
DO NTRY^ENEQPMS2
+3 GOTO OUT
+4 ;
LST1 DO DEV^ENLIB
if POP
GOTO OUT
IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTIO=ION
SET ZTRTN="MNTRY^ENEQPMS2"
SET ZTSAVE("EN*")=""
SET ZTDESC="Generate Engineering PMI List"
DO ^%ZTLOAD
KILL ZTSK
DO HOME^%ZIS
GOTO OUT
+1 ;All shops
DO MNTRY^ENEQPMS2
+2 ;
OUT KILL K,S,%OPT,%O,ENDATE,ENPM,ENPMDT,ENA,ENHZS,ENPMWK,ENSHOP,ENSHKEY,ENPMMN,ENSTMN,ENSTYR,ENCRIT,ENDA,ENSRT,ENTECH,ENMNTH,%DT,DIC,DNX,ENERR,ENMN
+1 QUIT
+2 ;
MSG READ !,"Press <RETURN> to continue...",X:DTIME
QUIT
+1 ;
LSTH0 WRITE !,"This feature enables you to print a 'partial' PMI list, containing only those",!,"devices whose 'CRITICALITY' falls within a certain range."
+1 WRITE !!,"For example, if your site ranks devices from 1 to 10 (10 being most critical)",!,"and circumstances are such that you only have resources for a limited number"
+2 WRITE !,"of PMI's in a given month, you may wish to enter something like '6-10'. This",!,"will mean that PMI's which would normally be scheduled for devices in the"
+3 WRITE !,"criticality range 1-5 will be suppressed, as will entries with 'CRITICALITY'",!,"greater than 10, but since your site only uses 1 thru 10 there shouldn't be",!,"any."
+4 WRITE !!,"The system will not attempt to re-schedule these PMI's for the next month,"
+5 WRITE !,"because that would tend to defeat any efforts to balance the PM work load."
+6 WRITE !!,"In short, this feature is not intended for routine use but rather as a sys-",!,"tematic approach to dealing with an exceptional situation."
+7 WRITE !!,"Entries must be in the form 'M-N' where M and N are integers in the range of",!,"1 to 99 and M is less than or equal to N."
+8 QUIT
+9 ;ENEQPMS1