ENEQRP5 ;(WASH ISC)/DH-PM Workload Report ;4-27-95
;;7.0;ENGINEERING;**15,22**;Aug 17, 1993
EN S DIC="^DIC(6922,",DIC(0)="AEMQ" D ^DIC Q:Y'>0 S ENSHKEY=+Y,ENSHOP=$P(^DIC(6922,ENSHKEY,0),U,1)
S (ENTEC,ENTEC("ALL"))=0
S DIR(0)="Y",DIR("A")="Should results be broken out by TECHNICIAN"
S DIR("B")="NO"
S DIR("?",1)="If you say YES, counts and totals will be reported separately for"
S DIR("?",2)="different assigned technicians. You will be allowed to request this"
S DIR("?")="information for all technicians or for one particular technician."
D ^DIR K DIR G:$D(DIRUT) EXIT
I Y=1 D I $D(DIRUT)!('$D(ENTEC)) G EXIT
. S DIR(0)="Y",DIR("A")="Include ALL technicians",DIR("B")="YES"
. S DIR("?",1)="If you say NO, you will be asked to select a technician of interest"
. S DIR("?")="from the Eng Employee File."
. D ^DIR K DIR Q:$D(DIRUT) S:Y=1 ENTEC("ALL")=1
. I 'ENTEC("ALL") D
.. S DIR(0)="P^6929:AEMQ",DIR("A")="Select TECHNICIAN of interest"
.. K DIR("B") D ^DIR K DIR I Y>0 S ENTEC=+Y,ENEMP=$P($G(^ENG("EMP",+Y,0)),U)
.. I Y'>0 K ENTEC Q
.. I ENEMP']"" K ENTEC Q
DEV 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
EN1 S (ENC,ENT)=0 F I=1:1:12 S (ENC(I),ENT(I))=0
I '$D(ZTQUEUED) W !!," compiling data"
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) "."
I '$D(DT) S %DT="",X="T" D ^%DT S DT=Y
PR U IO W:$E(IOST,1,2)="C-" @IOF S ENDONE=0 I ENTEC("ALL") D G EXIT
. S ENEMP="A" F S ENEMP=$O(ENC(ENEMP)) Q:ENEMP']""!(ENDONE) D
.. F I=1:1:12 I '$D(ENC(ENEMP,I)) S ENC(ENEMP,I)=0
.. D PR1
PR1 W "PM Workload Analysis: ",ENSHOP," Shop" S Y=DT X ^DD("DD") W ?65,Y
I ENTEC!ENTEC("ALL") W !,"Responsible Technician: ",ENEMP
W !,?5,"Month",?20,"Item Count*",?35,"Standard Hours",! F I=1:1:79 W "-"
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)
I ENTEC("ALL") S ENT=0 F I=1:1:12 S ENT=ENT+ENT(ENEMP,I)
E F I=1:1:12 S ENT=ENT+ENT(I)
W !,?20,"----------",?35,"--------------",!,"COUNT**",?20,$J($S(ENTEC("ALL"):ENC(ENEMP),1:ENC),10),!,"TOTAL",?35,$J(ENT,14,1)
W !!,"* Count of items to be inspected in month indicated."
W !,"** Count of all items for which this ",$S(ENTEC:"technician",ENTEC("ALL"):"technician",1:"shop")," has PM responsibility."
I $E(IOST,1,2)="C-" D HOLD I ENDONE,ENTEC("ALL") Q
W @IOF I 'ENTEC("ALL") D EXIT
Q
;
NTRE I $D(^ENG(6914,ENDA,3)) S EN=^(3),ENA=$P(EN,U,1) I ENA>3,ENA<6 Q
Q:'$D(^ENG(6914,ENDA,4,ENM)) S ENTEC("CURRENT")=$P($G(^(ENM,0)),U,2) I ENTEC,ENTEC'=ENTEC("CURRENT") Q
K ENA S ENSTMN=$S($D(^ENG(6914,ENDA,4,ENM,1)):^(1),1:"") I ENSTMN="" S ENSTMN=1
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
I 'ENTEC("ALL") S ENC=ENC+1
F I=1:1:12 S $P(ENA,U,I)=""
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)
I $D(ENA("M")) F I=1:1:12 S $P(ENA,U,I)=ENA("M")
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")
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")
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")
I $D(ENA("A")) S $P(ENA,U,ENSTMN)=ENA("A")
S ENA("WT")="" I $D(ENA("W")) S ENA("WT")=ENA("W")*4
I $D(ENA("BW")) S ENA("WT")=ENA("WT")/2+(ENA("BW")*2)
F I=1:1:12 S ENT(I)=ENT(I)+$P(ENA,U,I)+ENA("WT")
I ENA("WT")]"" F I=1:1:12 S ENC(I)=ENC(I)+1
E F I=1:1:12 I $P(ENA,U,I)]"" S ENC(I)=ENC(I)+1
I ENTEC("ALL") D
. F I=1:1:12 S ENT(ENEMP,I)=$G(ENT(ENEMP,I))+$P(ENA,U,I)+ENA("WT")
. I ENA("WT")]"" F I=1:1:12 S ENC(ENEMP,I)=$G(ENC(ENEMP,I))+1
. E F I=1:1:12 I $P(ENA,U,I) S ENC(ENEMP,I)=$G(ENC(ENEMP,I))+1
Q
HOLD W ! S DIR(0)="E" D ^DIR K DIR S:'Y ENDONE=1
Q
;
EXIT K EN,ENC,ENT,ENA,ENSHKEY,ENSHOP,ENHZ,ENDA,ENSTMN,ENMNB,ENM,ENTEC,ENEMP
K ENDONE,ZTRTN,ZTSAVE,ZTDESC S:$D(ZTQUEUED) ZTREQ="@"
K DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT
I '$D(ZTQUEUED),$E(IOST,1,2)="P-" D ^%ZISC
Q
;ENEQRP5
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQRP5 4372 printed Dec 13, 2024@01:53:05 Page 2
ENEQRP5 ;(WASH ISC)/DH-PM Workload Report ;4-27-95
+1 ;;7.0;ENGINEERING;**15,22**;Aug 17, 1993
EN SET DIC="^DIC(6922,"
SET DIC(0)="AEMQ"
DO ^DIC
if Y'>0
QUIT
SET ENSHKEY=+Y
SET ENSHOP=$PIECE(^DIC(6922,ENSHKEY,0),U,1)
+1 SET (ENTEC,ENTEC("ALL"))=0
+2 SET DIR(0)="Y"
SET DIR("A")="Should results be broken out by TECHNICIAN"
+3 SET DIR("B")="NO"
+4 SET DIR("?",1)="If you say YES, counts and totals will be reported separately for"
+5 SET DIR("?",2)="different assigned technicians. You will be allowed to request this"
+6 SET DIR("?")="information for all technicians or for one particular technician."
+7 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO EXIT
+8 IF Y=1
Begin DoDot:1
+9 SET DIR(0)="Y"
SET DIR("A")="Include ALL technicians"
SET DIR("B")="YES"
+10 SET DIR("?",1)="If you say NO, you will be asked to select a technician of interest"
+11 SET DIR("?")="from the Eng Employee File."
+12 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
if Y=1
SET ENTEC("ALL")=1
+13 IF 'ENTEC("ALL")
Begin DoDot:2
+14 SET DIR(0)="P^6929:AEMQ"
SET DIR("A")="Select TECHNICIAN of interest"
+15 KILL DIR("B")
DO ^DIR
KILL DIR
IF Y>0
SET ENTEC=+Y
SET ENEMP=$PIECE($GET(^ENG("EMP",+Y,0)),U)
+16 IF Y'>0
KILL ENTEC
QUIT
+17 IF ENEMP']""
KILL ENTEC
QUIT
End DoDot:2
End DoDot:1
IF $DATA(DIRUT)!('$DATA(ENTEC))
GOTO EXIT
DEV DO DEV^ENLIB
if POP
GOTO EXIT
IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTRTN="EN1^ENEQRP5"
SET ZTSAVE("EN*")=""
SET ZTDESC="PM Workload Analysis"
DO ^%ZTLOAD
KILL ZTSK
DO HOME^%ZIS
GOTO EXIT
EN1 SET (ENC,ENT)=0
FOR I=1:1:12
SET (ENC(I),ENT(I))=0
+1 IF '$DATA(ZTQUEUED)
WRITE !!," compiling data"
+2 FOR ENDA=0:0
SET ENDA=$ORDER(^ENG(6914,"AB",ENSHKEY,ENDA))
if ENDA'>0
QUIT
SET ENM=$ORDER(^ENG(6914,"AB",ENSHKEY,ENDA,0))
DO NTRE
IF '$DATA(ZTQUEUED)
if '(ENDA#10)
WRITE "."
+3 IF '$DATA(DT)
SET %DT=""
SET X="T"
DO ^%DT
SET DT=Y
PR USE IO
if $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
SET ENDONE=0
IF ENTEC("ALL")
Begin DoDot:1
+1 SET ENEMP="A"
FOR
SET ENEMP=$ORDER(ENC(ENEMP))
if ENEMP']""!(ENDONE)
QUIT
Begin DoDot:2
+2 FOR I=1:1:12
IF '$DATA(ENC(ENEMP,I))
SET ENC(ENEMP,I)=0
+3 DO PR1
End DoDot:2
End DoDot:1
GOTO EXIT
PR1 WRITE "PM Workload Analysis: ",ENSHOP," Shop"
SET Y=DT
XECUTE ^DD("DD")
WRITE ?65,Y
+1 IF ENTEC!ENTEC("ALL")
WRITE !,"Responsible Technician: ",ENEMP
+2 WRITE !,?5,"Month",?20,"Item Count*",?35,"Standard Hours",!
FOR I=1:1:79
WRITE "-"
+3 FOR I=1:1:12
WRITE !,?7,$PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,I),?20,$JUSTIFY($SELECT(ENTEC("ALL"):ENC(ENEMP,I),1:ENC(I)),10),?35,$JUSTIFY($SELECT(ENTEC("ALL"):ENT(ENEMP,I),1:ENT(I)),14,1)
+4 IF ENTEC("ALL")
SET ENT=0
FOR I=1:1:12
SET ENT=ENT+ENT(ENEMP,I)
+5 IF '$TEST
FOR I=1:1:12
SET ENT=ENT+ENT(I)
+6 WRITE !,?20,"----------",?35,"--------------",!,"COUNT**",?20,$JUSTIFY($SELECT(ENTEC("ALL"):ENC(ENEMP),1:ENC),10),!,"TOTAL",?35,$JUSTIFY(ENT,14,1)
+7 WRITE !!,"* Count of items to be inspected in month indicated."
+8 WRITE !,"** Count of all items for which this ",$SELECT(ENTEC:"technician",ENTEC("ALL"):"technician",1:"shop")," has PM responsibility."
+9 IF $EXTRACT(IOST,1,2)="C-"
DO HOLD
IF ENDONE
IF ENTEC("ALL")
QUIT
+10 WRITE @IOF
IF 'ENTEC("ALL")
DO EXIT
+11 QUIT
+12 ;
NTRE IF $DATA(^ENG(6914,ENDA,3))
SET EN=^(3)
SET ENA=$PIECE(EN,U,1)
IF ENA>3
IF ENA<6
QUIT
+1 if '$DATA(^ENG(6914,ENDA,4,ENM))
QUIT
SET ENTEC("CURRENT")=$PIECE($GET(^(ENM,0)),U,2)
IF ENTEC
IF ENTEC'=ENTEC("CURRENT")
QUIT
+2 KILL ENA
SET ENSTMN=$SELECT($DATA(^ENG(6914,ENDA,4,ENM,1)):^(1),1:"")
IF ENSTMN=""
SET ENSTMN=1
+3 IF ENTEC("ALL")
SET ENEMP=$SELECT(ENTEC("CURRENT")>0:$PIECE($GET(^ENG("EMP",+ENTEC("CURRENT"),0)),U),1:"")
if ENEMP=""
SET ENEMP="UNASSIGNED"
SET ENC(ENEMP)=$GET(ENC(ENEMP))+1
+4 IF 'ENTEC("ALL")
SET ENC=ENC+1
+5 FOR I=1:1:12
SET $PIECE(ENA,U,I)=""
+6 FOR I=0:0
SET I=$ORDER(^ENG(6914,ENDA,4,ENM,2,I))
if I'>0
QUIT
SET ENHZ=$PIECE(^ENG(6914,ENDA,4,ENM,2,I,0),U,1)
SET ENA(ENHZ)=$SELECT($PIECE(^(0),U,2)]"":$PIECE(^(0),U,2),1:0)
+7 IF $DATA(ENA("M"))
FOR I=1:1:12
SET $PIECE(ENA,U,I)=ENA("M")
+8 IF $DATA(ENA("BM"))
FOR I=ENSTMN:2:(ENSTMN+10)
SET J=I
if J>12
SET J=J#12
SET $PIECE(ENA,U,J)=ENA("BM")
+9 IF $DATA(ENA("Q"))
FOR I=ENSTMN:3:(ENSTMN+9)
SET J=I
if J>12
SET J=J#12
SET $PIECE(ENA,U,J)=ENA("Q")
+10 IF $DATA(ENA("S"))
FOR I=ENSTMN,(ENSTMN+6)
SET J=I
if J>12
SET J=J#12
SET $PIECE(ENA,U,J)=ENA("S")
+11 IF $DATA(ENA("A"))
SET $PIECE(ENA,U,ENSTMN)=ENA("A")
+12 SET ENA("WT")=""
IF $DATA(ENA("W"))
SET ENA("WT")=ENA("W")*4
+13 IF $DATA(ENA("BW"))
SET ENA("WT")=ENA("WT")/2+(ENA("BW")*2)
+14 FOR I=1:1:12
SET ENT(I)=ENT(I)+$PIECE(ENA,U,I)+ENA("WT")
+15 IF ENA("WT")]""
FOR I=1:1:12
SET ENC(I)=ENC(I)+1
+16 IF '$TEST
FOR I=1:1:12
IF $PIECE(ENA,U,I)]""
SET ENC(I)=ENC(I)+1
+17 IF ENTEC("ALL")
Begin DoDot:1
+18 FOR I=1:1:12
SET ENT(ENEMP,I)=$GET(ENT(ENEMP,I))+$PIECE(ENA,U,I)+ENA("WT")
+19 IF ENA("WT")]""
FOR I=1:1:12
SET ENC(ENEMP,I)=$GET(ENC(ENEMP,I))+1
+20 IF '$TEST
FOR I=1:1:12
IF $PIECE(ENA,U,I)
SET ENC(ENEMP,I)=$GET(ENC(ENEMP,I))+1
End DoDot:1
+21 QUIT
HOLD WRITE !
SET DIR(0)="E"
DO ^DIR
KILL DIR
if 'Y
SET ENDONE=1
+1 QUIT
+2 ;
EXIT KILL EN,ENC,ENT,ENA,ENSHKEY,ENSHOP,ENHZ,ENDA,ENSTMN,ENMNB,ENM,ENTEC,ENEMP
+1 KILL ENDONE,ZTRTN,ZTSAVE,ZTDESC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 KILL DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT
+3 IF '$DATA(ZTQUEUED)
IF $EXTRACT(IOST,1,2)="P-"
DO ^%ZISC
+4 QUIT
+5 ;ENEQRP5