source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQRP5.m@ 1800

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1ENEQRP5 ;(WASH ISC)/DH-PM Workload Report ;4-27-95
2 ;;7.0;ENGINEERING;**15,22**;Aug 17, 1993
3EN S DIC="^DIC(6922,",DIC(0)="AEMQ" D ^DIC Q:Y'>0 S ENSHKEY=+Y,ENSHOP=$P(^DIC(6922,ENSHKEY,0),U,1)
4 S (ENTEC,ENTEC("ALL"))=0
5 S DIR(0)="Y",DIR("A")="Should results be broken out by TECHNICIAN"
6 S DIR("B")="NO"
7 S DIR("?",1)="If you say YES, counts and totals will be reported separately for"
8 S DIR("?",2)="different assigned technicians. You will be allowed to request this"
9 S DIR("?")="information for all technicians or for one particular technician."
10 D ^DIR K DIR G:$D(DIRUT) EXIT
11 I Y=1 D I $D(DIRUT)!('$D(ENTEC)) G EXIT
12 . S DIR(0)="Y",DIR("A")="Include ALL technicians",DIR("B")="YES"
13 . S DIR("?",1)="If you say NO, you will be asked to select a technician of interest"
14 . S DIR("?")="from the Eng Employee File."
15 . D ^DIR K DIR Q:$D(DIRUT) S:Y=1 ENTEC("ALL")=1
16 . I 'ENTEC("ALL") D
17 .. S DIR(0)="P^6929:AEMQ",DIR("A")="Select TECHNICIAN of interest"
18 .. K DIR("B") D ^DIR K DIR I Y>0 S ENTEC=+Y,ENEMP=$P($G(^ENG("EMP",+Y,0)),U)
19 .. I Y'>0 K ENTEC Q
20 .. I ENEMP']"" K ENTEC Q
21DEV D DEV^ENLIB G:POP EXIT I $D(IO("Q")) K IO("Q") S ZTRTN="EN1^ENEQRP5",ZTSAVE("EN*")="",ZTDESC="PM Workload Analysis" D ^%ZTLOAD K ZTSK D HOME^%ZIS G EXIT
22EN1 S (ENC,ENT)=0 F I=1:1:12 S (ENC(I),ENT(I))=0
23 I '$D(ZTQUEUED) W !!," compiling data"
24 F ENDA=0:0 S ENDA=$O(^ENG(6914,"AB",ENSHKEY,ENDA)) Q:ENDA'>0 S ENM=$O(^ENG(6914,"AB",ENSHKEY,ENDA,0)) D NTRE I '$D(ZTQUEUED) W:'(ENDA#10) "."
25 I '$D(DT) S %DT="",X="T" D ^%DT S DT=Y
26PR U IO W:$E(IOST,1,2)="C-" @IOF S ENDONE=0 I ENTEC("ALL") D G EXIT
27 . S ENEMP="A" F S ENEMP=$O(ENC(ENEMP)) Q:ENEMP']""!(ENDONE) D
28 .. F I=1:1:12 I '$D(ENC(ENEMP,I)) S ENC(ENEMP,I)=0
29 .. D PR1
30PR1 W "PM Workload Analysis: ",ENSHOP," Shop" S Y=DT X ^DD("DD") W ?65,Y
31 I ENTEC!ENTEC("ALL") W !,"Responsible Technician: ",ENEMP
32 W !,?5,"Month",?20,"Item Count*",?35,"Standard Hours",! F I=1:1:79 W "-"
33 F I=1:1:12 W !,?7,$P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,I),?20,$J($S(ENTEC("ALL"):ENC(ENEMP,I),1:ENC(I)),10),?35,$J($S(ENTEC("ALL"):ENT(ENEMP,I),1:ENT(I)),14,1)
34 I ENTEC("ALL") S ENT=0 F I=1:1:12 S ENT=ENT+ENT(ENEMP,I)
35 E F I=1:1:12 S ENT=ENT+ENT(I)
36 W !,?20,"----------",?35,"--------------",!,"COUNT**",?20,$J($S(ENTEC("ALL"):ENC(ENEMP),1:ENC),10),!,"TOTAL",?35,$J(ENT,14,1)
37 W !!,"* Count of items to be inspected in month indicated."
38 W !,"** Count of all items for which this ",$S(ENTEC:"technician",ENTEC("ALL"):"technician",1:"shop")," has PM responsibility."
39 I $E(IOST,1,2)="C-" D HOLD I ENDONE,ENTEC("ALL") Q
40 W @IOF I 'ENTEC("ALL") D EXIT
41 Q
42 ;
43NTRE I $D(^ENG(6914,ENDA,3)) S EN=^(3),ENA=$P(EN,U,1) I ENA>3,ENA<6 Q
44 Q:'$D(^ENG(6914,ENDA,4,ENM)) S ENTEC("CURRENT")=$P($G(^(ENM,0)),U,2) I ENTEC,ENTEC'=ENTEC("CURRENT") Q
45 K ENA S ENSTMN=$S($D(^ENG(6914,ENDA,4,ENM,1)):^(1),1:"") I ENSTMN="" S ENSTMN=1
46 I ENTEC("ALL") S ENEMP=$S(ENTEC("CURRENT")>0:$P($G(^ENG("EMP",+ENTEC("CURRENT"),0)),U),1:"") S:ENEMP="" ENEMP="UNASSIGNED" S ENC(ENEMP)=$G(ENC(ENEMP))+1
47 I 'ENTEC("ALL") S ENC=ENC+1
48 F I=1:1:12 S $P(ENA,U,I)=""
49 F I=0:0 S I=$O(^ENG(6914,ENDA,4,ENM,2,I)) Q:I'>0 S ENHZ=$P(^ENG(6914,ENDA,4,ENM,2,I,0),U,1),ENA(ENHZ)=$S($P(^(0),U,2)]"":$P(^(0),U,2),1:0)
50 I $D(ENA("M")) F I=1:1:12 S $P(ENA,U,I)=ENA("M")
51 I $D(ENA("BM")) F I=ENSTMN:2:(ENSTMN+10) S J=I S:J>12 J=J#12 S $P(ENA,U,J)=ENA("BM")
52 I $D(ENA("Q")) F I=ENSTMN:3:(ENSTMN+9) S J=I S:J>12 J=J#12 S $P(ENA,U,J)=ENA("Q")
53 I $D(ENA("S")) F I=ENSTMN,(ENSTMN+6) S J=I S:J>12 J=J#12 S $P(ENA,U,J)=ENA("S")
54 I $D(ENA("A")) S $P(ENA,U,ENSTMN)=ENA("A")
55 S ENA("WT")="" I $D(ENA("W")) S ENA("WT")=ENA("W")*4
56 I $D(ENA("BW")) S ENA("WT")=ENA("WT")/2+(ENA("BW")*2)
57 F I=1:1:12 S ENT(I)=ENT(I)+$P(ENA,U,I)+ENA("WT")
58 I ENA("WT")]"" F I=1:1:12 S ENC(I)=ENC(I)+1
59 E F I=1:1:12 I $P(ENA,U,I)]"" S ENC(I)=ENC(I)+1
60 I ENTEC("ALL") D
61 . F I=1:1:12 S ENT(ENEMP,I)=$G(ENT(ENEMP,I))+$P(ENA,U,I)+ENA("WT")
62 . I ENA("WT")]"" F I=1:1:12 S ENC(ENEMP,I)=$G(ENC(ENEMP,I))+1
63 . E F I=1:1:12 I $P(ENA,U,I) S ENC(ENEMP,I)=$G(ENC(ENEMP,I))+1
64 Q
65HOLD W ! S DIR(0)="E" D ^DIR K DIR S:'Y ENDONE=1
66 Q
67 ;
68EXIT K EN,ENC,ENT,ENA,ENSHKEY,ENSHOP,ENHZ,ENDA,ENSTMN,ENMNB,ENM,ENTEC,ENEMP
69 K ENDONE,ZTRTN,ZTSAVE,ZTDESC S:$D(ZTQUEUED) ZTREQ="@"
70 K DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT
71 I '$D(ZTQUEUED),$E(IOST,1,2)="P-" D ^%ZISC
72 Q
73 ;ENEQRP5
Note: See TracBrowser for help on using the repository browser.