ENEQRP4 ;(WASH ISC)/DH-Report of High Failure Items ;1.14.98
;;7.0;ENGINEERING;**48**;Aug 17, 1993
Q
FAP ;REPORT PRINT SECTION
I $D(^TMP($J,"ENEQFA")) G FAPC
W !!,"There is no equipment" W:ENDVTYP'=0 " of type ",ENDVTYP W " with ",ENN," or more failures",!,"from ",$E(ENFR,4,5),"-",$E(ENFR,6,7),"-",$E(ENFR,2,3)," to ",$E(ENTO,4,5),"-",$E(ENTO,6,7),"-",$E(ENTO,2,3),".",!!
G DONE
;
FAPC W:IO'=IO(0) !,"beginning report..." U IO S ENPG=0 D T F I=1:1:9 S ENT(I)=0
W:$E(IOST,1,2)="C-" @IOF
D FAP1 S DA="" D FAP2,FAP3 G DONE
;
FAP1 W:ENPG @IOF S ENPG=ENPG+1 W "EQUIPMENT REPAIRS (",$S(ENDVTYP=0:"ALL EQUIPMENT",1:ENDVTYP),")",?45,ENDATE,?70,"Page ",ENPG
W !,?10,"From: ",$E(ENFR,4,5),"-",$E(ENFR,6,7),"-",$E(ENFR,2,3)," To: ",$E(ENTO,4,5),"-",$E(ENTO,6,7),"-",$E(ENTO,2,3)
W !,"Reference",?12,"Entry #",?29,"Hrs",?35,"Labor$",?43,"Mat'l$",?52,"Vndr$",?62,"Total$",?70,"Worker",! F K=1:1:79 W "-"
S ENY=5
Q
FAP2 S DA=$O(^TMP($J,"ENEQFA",DA)),I=1,ENA=0 Q:DA="" ;S ENPMN="" I $D(^ENG(6914,DA,3)) S ENPMN=$P(^(3),U,6)
;S:ENPMN="" ENPMN="None"
FAP21 S ENR=$P(^TMP($J,"ENEQFA",DA,ENA),"^",I) I ENR="" S ENA=$O(^TMP($J,"ENEQFA",DA,ENA)) G:ENA'>0 FAP2 S I=1 G FAP21
S ENHS=^ENG(6914,DA,6,ENR,0) S I=I+1 F J=1:1:8 S E(J)=$P(ENHS,U,J)
S:E(1)]"" E(1)=$E(E(1),2,30)
S E(9)=E(5)+E(6)+E(7),ENT(9)=ENT(9)+E(9) F J=4:1:7 S ENT(J)=ENT(J)+E(J)
W !,E(1),?12,DA,?27,$J(E(4),5,1),?33,$J(E(5),8,2),?41,$J(E(6),8,2),?50,$J(E(7),8,2),?60,$J(E(9),8,2),?70,$E(E(8),1,9) S ENY=ENY+1
G:ENY'>(IOSL-4) FAP21 D FAP4 I $D(R),$E(R)="^" K R Q
G FAP21
FAP3 I $D(R),$E(R)="^" Q
W ! F I=1:1:79 W "_"
W !,"TOTAL",?27,$J(ENT(4),5,1),?35,$J(ENT(5),6,2),?43,$J(ENT(6),6,2),?52,$J(ENT(7),6,2),?62,$J(ENT(9),6,2)
Q
FAP4 D:$E(IOST,1,2)="C-" HOLD I $D(R),$E(R)="^" G DONE
D FAP1 Q
;
T S %DT="T",X="N" D ^%DT S ENNDATE=Y X ^DD("DD") S ENDATE=Y K X,Y Q
HOLD W !!,"Press <RETURN> to continue or ""^"" to escape " R R:DTIME S:'$T R="^"
Q
DONE D:$E(IOST,1,2)="C-" HOLD W @IOF
I '$D(ZTQUEUED),$E(IOST,1,2)="P-" D ^%ZISC
K E,ENDA,ENDVTYP,ENFR,ENTO,ENH,ENFY,ENQT,ENHS,ENN,ENNDATE,ENPMN,ENR,ENSTR,ENT,ENVEND,ENY,ENDATE,ENA,R,ENERR,ENPG
S:$D(ZTQUEUED) ZTREQ="@"
Q
;ENEQRP4
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQRP4 2190 printed Oct 16, 2024@17:53:53 Page 2
ENEQRP4 ;(WASH ISC)/DH-Report of High Failure Items ;1.14.98
+1 ;;7.0;ENGINEERING;**48**;Aug 17, 1993
+2 QUIT
FAP ;REPORT PRINT SECTION
+1 IF $DATA(^TMP($JOB,"ENEQFA"))
GOTO FAPC
+2 WRITE !!,"There is no equipment"
if ENDVTYP'=0
WRITE " of type ",ENDVTYP
WRITE " with ",ENN," or more failures",!,"from ",$EXTRACT(ENFR,4,5),"-",$EXTRACT(ENFR,6,7),"-",$EXTRACT(ENFR,2,3)," to ",$EXTRACT(ENTO,4,5),"-",$EXTRACT(ENTO,6,7),"-",$EXTRACT(ENTO,2,3),".",!!
+3 GOTO DONE
+4 ;
FAPC if IO'=IO(0)
WRITE !,"beginning report..."
USE IO
SET ENPG=0
DO T
FOR I=1:1:9
SET ENT(I)=0
+1 if $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+2 DO FAP1
SET DA=""
DO FAP2
DO FAP3
GOTO DONE
+3 ;
FAP1 if ENPG
WRITE @IOF
SET ENPG=ENPG+1
WRITE "EQUIPMENT REPAIRS (",$SELECT(ENDVTYP=0:"ALL EQUIPMENT",1:ENDVTYP),")",?45,ENDATE,?70,"Page ",ENPG
+1 WRITE !,?10,"From: ",$EXTRACT(ENFR,4,5),"-",$EXTRACT(ENFR,6,7),"-",$EXTRACT(ENFR,2,3)," To: ",$EXTRACT(ENTO,4,5),"-",$EXTRACT(ENTO,6,7),"-",$EXTRACT(ENTO,2,3)
+2 WRITE !,"Reference",?12,"Entry #",?29,"Hrs",?35,"Labor$",?43,"Mat'l$",?52,"Vndr$",?62,"Total$",?70,"Worker",!
FOR K=1:1:79
WRITE "-"
+3 SET ENY=5
+4 QUIT
FAP2 ;S ENPMN="" I $D(^ENG(6914,DA,3)) S ENPMN=$P(^(3),U,6)
SET DA=$ORDER(^TMP($JOB,"ENEQFA",DA))
SET I=1
SET ENA=0
if DA=""
QUIT
+1 ;S:ENPMN="" ENPMN="None"
FAP21 SET ENR=$PIECE(^TMP($JOB,"ENEQFA",DA,ENA),"^",I)
IF ENR=""
SET ENA=$ORDER(^TMP($JOB,"ENEQFA",DA,ENA))
if ENA'>0
GOTO FAP2
SET I=1
GOTO FAP21
+1 SET ENHS=^ENG(6914,DA,6,ENR,0)
SET I=I+1
FOR J=1:1:8
SET E(J)=$PIECE(ENHS,U,J)
+2 if E(1)]""
SET E(1)=$EXTRACT(E(1),2,30)
+3 SET E(9)=E(5)+E(6)+E(7)
SET ENT(9)=ENT(9)+E(9)
FOR J=4:1:7
SET ENT(J)=ENT(J)+E(J)
+4 WRITE !,E(1),?12,DA,?27,$JUSTIFY(E(4),5,1),?33,$JUSTIFY(E(5),8,2),?41,$JUSTIFY(E(6),8,2),?50,$JUSTIFY(E(7),8,2),?60,$JUSTIFY(E(9),8,2),?70,$EXTRACT(E(8),1,9)
SET ENY=ENY+1
+5 if ENY'>(IOSL-4)
GOTO FAP21
DO FAP4
IF $DATA(R)
IF $EXTRACT(R)="^"
KILL R
QUIT
+6 GOTO FAP21
FAP3 IF $DATA(R)
IF $EXTRACT(R)="^"
QUIT
+1 WRITE !
FOR I=1:1:79
WRITE "_"
+2 WRITE !,"TOTAL",?27,$JUSTIFY(ENT(4),5,1),?35,$JUSTIFY(ENT(5),6,2),?43,$JUSTIFY(ENT(6),6,2),?52,$JUSTIFY(ENT(7),6,2),?62,$JUSTIFY(ENT(9),6,2)
+3 QUIT
FAP4 if $EXTRACT(IOST,1,2)="C-"
DO HOLD
IF $DATA(R)
IF $EXTRACT(R)="^"
GOTO DONE
+1 DO FAP1
QUIT
+2 ;
T SET %DT="T"
SET X="N"
DO ^%DT
SET ENNDATE=Y
XECUTE ^DD("DD")
SET ENDATE=Y
KILL X,Y
QUIT
HOLD WRITE !!,"Press <RETURN> to continue or ""^"" to escape "
READ R:DTIME
if '$TEST
SET R="^"
+1 QUIT
DONE if $EXTRACT(IOST,1,2)="C-"
DO HOLD
WRITE @IOF
+1 IF '$DATA(ZTQUEUED)
IF $EXTRACT(IOST,1,2)="P-"
DO ^%ZISC
+2 KILL E,ENDA,ENDVTYP,ENFR,ENTO,ENH,ENFY,ENQT,ENHS,ENN,ENNDATE,ENPMN,ENR,ENSTR,ENT,ENVEND,ENY,ENDATE,ENA,R,ENERR,ENPG
+3 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+4 QUIT
+5 ;ENEQRP4