source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQPMS1.m@ 1150

Last change on this file since 1150 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 6.0 KB
RevLine 
[613]1ENEQPMS1 ;(WASH ISC)/DH-Generate PMI Worklists ;1/24/2001
2 ;;7.0;ENGINEERING;**35,42,68**;Aug 17, 1993
3WK ;Produce weekly PM worklist
4 W @IOF,?25,"GENERATE WEEKLY PM LIST(S)",!,?31,"VERSION ",^ENG("VERSION"),!!
5 S ENDATE=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3),Y=$E(DT,1,5)_"00" X ^DD("DD")
6 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)
7WK1 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
8 W "??",*7 G WK1
9 ;
10MNTH ;Produce monthly PM worklist
11 S ENPM="M" W @IOF,?25,"GENERATE MONTHLY PM LIST(S)",!,?31,"VERSION ",^ENG("VERSION"),!!
12 S ENDATE=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3),Y=$E(DT,1,5)_"00" X ^DD("DD")
13 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)
14 ;
15LSTSRT 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
16 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
17 S ENSRT=X,ENSRT("ALL")=1 S:X="L" ENSRT("LOC")=1
18LSTSRT1 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:"")
19 G:ENSRT("A")="" OUT
20 I ENSRT'="P" S ENSRT("ALL")=0 D SPL0^ENEQPMS3 G:X=U OUT
21 I "EP"[ENSRT S ENSRT("LOC")=0
22 I "EPL"'[ENSRT D G:$D(DIRUT) OUT
23 . W !!,"Within "_ENSRT("A")_", shall worklist be sorted by LOCATION?"
24 . S DIR(0)="Y",DIR("B")="YES"
25 . S DIR("?",1)="If you want this list to be ordered by LOCATION within "_ENSRT("A")_","
26 . S DIR("?",2)="please enter 'YES', otherwise enter 'NO' and items will be ordered by"
27 . S DIR("?")="EQUIPMENT ENTRY NUMBER."
28 . D ^DIR K DIR Q:$D(DIRUT)
29 . S ENSRT("LOC")=$S(Y:1,1:0)
30 . I ENSRT("LOC") D
31 .. S DIR(0)="Y",DIR("A")="Shall all LOCATIONS be included",DIR("B")="YES"
32 .. S DIR("?",1)="Enter 'NO' if you want to screen your worklist by DIVISION, BUILDING, WING,"
33 .. S DIR("?",2)="and/or ROOM. If you enter 'YES' then all LOCATIONS will be included. The"
34 .. S DIR("?")="sort order will be DIVISION, BUILDING, WING, and finally ROOM."
35 .. D ^DIR K DIR Q:$D(DIRUT)
36 .. S ENSRT("LOC","ALL")=$S(Y:1,1:0) S:Y ENSRT("BY")="DBWR"
37 .. D:'ENSRT("LOC","ALL") GEN^ENSPSRT
38 ;
39LSTTEK S DIR(0)="Y",DIR("A")="Shall worklist be sorted by RESPONSIBLE TECHNICIAN",DIR("B")="YES"
40 S DIR("?",1)="Enter 'YES' if you want your worklist sorted by RESPONSIBLE TECHNICIAN, with"
41 S DIR("?",2)="page breaks between each TECH. If you enter 'NO' then equipment items will"
42 S DIR("?")="be selected without regard to RESPONSIBLE TECH."
43 D ^DIR K DIR G:$D(DIRUT) OUT
44 I 'Y S ENTECH=0,ENTECH("ALL")=1 G LSTOOS
45LSTTEK1 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
46 I %=1 S ENTECH="ALL",ENTECH("ALL")=1 G LSTOOS
47 S DIC="^ENG(""EMP"",",DIC(0)="AEMQ" D ^DIC G:Y<0 OUT S ENTECH=+Y,ENTECH("ALL")=0
48 ;
49LSTOOS S DIR("A")="Shall 'OUT OF SERVICE' equipment be included in worklist"
50 S DIR(0)="Y",DIR("B")="YES"
51 S DIR("?",1)="Enter 'YES' if you want equipment entries with a USE STATUS of 'OUT OF"
52 S DIR("?")="SERVICE' to appear on this PM worklist. Otherwise enter 'NO'."
53 D ^DIR K DIR G:$D(DIRUT) OUT
54 S ENSRT("OOS")=Y
55 ;
56LST0 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
57 I $E(X)="?" D LSTH0 G LST0
58 I X'?1.2N1P.N!(X'["-") W "??",*7 D LSTH0 G LST0
59 S ENCRIT("FR")=$P(X,"-",1),ENCRIT("TO")=$P(X,"-",2) I ENCRIT("FR")>ENCRIT("TO") W "??",*7 D LSTH0 G LST0
60 S DIR("A",1)="Should equipment for which no CRITICALITY has been recorded be included on"
61 S DIR("A")="this worklist",DIR("B")="YES",DIR(0)="Y"
62 S DIR("?")="If we don't know the CRITICALITY do you want to see the equipment?"
63 D ^DIR K DIR G:$D(DIRUT) OUT
64 S ENCRIT("NULL")=Y
65 ;
66LST01 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
67 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
68 D NTRY^ENEQPMS2 ;One shop
69 G OUT
70 ;
71LST1 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
72 D MNTRY^ENEQPMS2 ;All shops
73 ;
74OUT 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
75 Q
76 ;
77MSG R !,"Press <RETURN> to continue...",X:DTIME Q
78 ;
79LSTH0 W !,"This feature enables you to print a 'partial' PMI list, containing only those",!,"devices whose 'CRITICALITY' falls within a certain range."
80 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"
81 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"
82 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."
83 W !!,"The system will not attempt to re-schedule these PMI's for the next month,"
84 W !,"because that would tend to defeat any efforts to balance the PM work load."
85 W !!,"In short, this feature is not intended for routine use but rather as a sys-",!,"tematic approach to dealing with an exceptional situation."
86 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."
87 Q
88 ;ENEQPMS1
Note: See TracBrowser for help on using the repository browser.