ENEQRP3 ;(WCIOFO)/DH-Report of High Failure Items ;10/21/1998
;;7.0;ENGINEERING;**14,48,59**;Aug 17, 1993
F1 ;Print list of items with high repair counts
W @IOF,!!,"Do you wish to analyze all equipment in the inventory" S %=2 D YN^DICN Q:%=-1 I %=1 S ENDVTYP=0 G F2
I %=0 W !!,"Alternately, you may elect to have a specific EQUIPMENT CATEGORY analyzed." R !!," Press <RETURN> to continue...",R:DTIME K R G F1
S DIC="^ENG(6911,",DIC(0)="AEQM" D ^DIC G:Y<1 EXIT S ENDA=+Y,ENDVTYP=$P(^ENG(6911,ENDA,0),"^",1)
F2 S DIR("A")="Starting date for this report",DIR(0)="D^:DT:AEP" D ^DIR G:Y'>0 EXIT S ENFR=Y
S DIR("A")="Ending date for this report",DIR(0)="D^"_ENFR_":DT:AEP" D ^DIR G:Y'>0 EXIT S ENTO=Y
K DIR
;
F3 W !,"Please enter the minimum number of repair episodes necessary",!,"for inclusion in this report. (1-99 per item) " R R:DTIME E S R="^" W *7
G:R="^" EXIT I +R=R,R?1.2N,R>0 S ENN=R G F4
W !!,"Enter the number of repair episodes per item necessary before that item is to",!,"be identified as meeting the failure rate criteria (whole number only).",!,*7 G F3
F4 W !,"Include all vendor activity, (work actions beginning with a 'V')" S %=2 D YN^DICN G:%=-1 EXIT
I %=0 D G F4
. W !,"This report will consider all entries in the Equipment Histories that are",!,"identified as 'General Repair' items. You may also include entries that are"
. W !,"identified as 'Vendor Service' items by answering [Y]es at this prompt."
S ENVEND=$S(%=1:1,1:0),ENR=0 D DEV^ENLIB G:POP EXIT
I $D(IO("Q")) K IO("Q") S ZTIO=ION,ZTRTN="F5^ENEQRP3",ZTSAVE("EN*")="",ZTDESC="Equipment Failure Report" D ^%ZTLOAD K ZTSK D ^%ZISC G EXIT
F5 K ^TMP($J) W:'$D(ZTQUEUED) !!," compiling the data..." D @$S(ENDVTYP'=0:"ET",1:"ALL") G FAP^ENEQRP4
ET S ENR=$O(^ENG(6914,"G",ENDA,ENR)),ENH=0,ENA=0,ENSTR(ENA)="" Q:ENR="" I '$D(ZTQUEUED),'(ENR#10) W "."
I $D(^ENG(6914,ENR,6)) S (K,K(ENA))=0 D SEARCH
G ET
ALL S ENR=$O(^ENG(6914,ENR)) Q:ENR'>0 I '$D(ZTQUEUED),'(ENR#10) W "."
I $D(^ENG(6914,ENR,6)) S (ENA,ENH,K)=0,K(ENA)=0,ENSTR(ENA)="" D SEARCH
G ALL
SEARCH S ENH=$O(^ENG(6914,ENR,6,ENH)) G:ENH SRCH1
I ENSTR(0)]"" F J=0:1 Q:'$D(K(J)) S K=K+K(J)
I K>(ENN-1) F J=0:1 Q:'$D(ENSTR(J)) S ^TMP($J,"ENEQFA",ENR,J)=ENSTR(J)
K A,B,C,ENH,ENSTR,K,ENA,J Q
SRCH1 S A=^ENG(6914,ENR,6,ENH,0),B=$P(A,"^",1),C=$P(B,"-"),D=$P(B,"-",2)
I ENFR<C,ENTO>C D
. I D["G1"!(D["RP") D ADD Q
. I ENVEND,D["V" D ADD
G SEARCH
;
ADD S:$L(ENSTR(ENA))>200 ENA=ENA+1,ENSTR(ENA)="",K(ENA)=0
S K(ENA)=K(ENA)+1,$P(ENSTR(ENA),"^",K(ENA))=ENH
Q
;
EXIT S ENERR=0 K E,ENDA,ENDVTYP,ENFR,ENTO,ENH,ENFY,ENQT,ENR,ENSTR,ENVEND,ENA
S:$D(ZTQUEUED) ZTREQ="@"
Q
;ENEQRP3
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQRP3 2679 printed Dec 13, 2024@01:53:03 Page 2
ENEQRP3 ;(WCIOFO)/DH-Report of High Failure Items ;10/21/1998
+1 ;;7.0;ENGINEERING;**14,48,59**;Aug 17, 1993
F1 ;Print list of items with high repair counts
+1 WRITE @IOF,!!,"Do you wish to analyze all equipment in the inventory"
SET %=2
DO YN^DICN
if %=-1
QUIT
IF %=1
SET ENDVTYP=0
GOTO F2
+2 IF %=0
WRITE !!,"Alternately, you may elect to have a specific EQUIPMENT CATEGORY analyzed."
READ !!," Press <RETURN> to continue...",R:DTIME
KILL R
GOTO F1
+3 SET DIC="^ENG(6911,"
SET DIC(0)="AEQM"
DO ^DIC
if Y<1
GOTO EXIT
SET ENDA=+Y
SET ENDVTYP=$PIECE(^ENG(6911,ENDA,0),"^",1)
F2 SET DIR("A")="Starting date for this report"
SET DIR(0)="D^:DT:AEP"
DO ^DIR
if Y'>0
GOTO EXIT
SET ENFR=Y
+1 SET DIR("A")="Ending date for this report"
SET DIR(0)="D^"_ENFR_":DT:AEP"
DO ^DIR
if Y'>0
GOTO EXIT
SET ENTO=Y
+2 KILL DIR
+3 ;
F3 WRITE !,"Please enter the minimum number of repair episodes necessary",!,"for inclusion in this report. (1-99 per item) "
READ R:DTIME
IF '$TEST
SET R="^"
WRITE *7
+1 if R="^"
GOTO EXIT
IF +R=R
IF R?1.2N
IF R>0
SET ENN=R
GOTO F4
+2 WRITE !!,"Enter the number of repair episodes per item necessary before that item is to",!,"be identified as meeting the failure rate criteria (whole number only).",!,*7
GOTO F3
F4 WRITE !,"Include all vendor activity, (work actions beginning with a 'V')"
SET %=2
DO YN^DICN
if %=-1
GOTO EXIT
+1 IF %=0
Begin DoDot:1
+2 WRITE !,"This report will consider all entries in the Equipment Histories that are",!,"identified as 'General Repair' items. You may also include entries that are"
+3 WRITE !,"identified as 'Vendor Service' items by answering [Y]es at this prompt."
End DoDot:1
GOTO F4
+4 SET ENVEND=$SELECT(%=1:1,1:0)
SET ENR=0
DO DEV^ENLIB
if POP
GOTO EXIT
+5 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTIO=ION
SET ZTRTN="F5^ENEQRP3"
SET ZTSAVE("EN*")=""
SET ZTDESC="Equipment Failure Report"
DO ^%ZTLOAD
KILL ZTSK
DO ^%ZISC
GOTO EXIT
F5 KILL ^TMP($JOB)
if '$DATA(ZTQUEUED)
WRITE !!," compiling the data..."
DO @$SELECT(ENDVTYP'=0:"ET",1:"ALL")
GOTO FAP^ENEQRP4
ET SET ENR=$ORDER(^ENG(6914,"G",ENDA,ENR))
SET ENH=0
SET ENA=0
SET ENSTR(ENA)=""
if ENR=""
QUIT
IF '$DATA(ZTQUEUED)
IF '(ENR#10)
WRITE "."
+1 IF $DATA(^ENG(6914,ENR,6))
SET (K,K(ENA))=0
DO SEARCH
+2 GOTO ET
ALL SET ENR=$ORDER(^ENG(6914,ENR))
if ENR'>0
QUIT
IF '$DATA(ZTQUEUED)
IF '(ENR#10)
WRITE "."
+1 IF $DATA(^ENG(6914,ENR,6))
SET (ENA,ENH,K)=0
SET K(ENA)=0
SET ENSTR(ENA)=""
DO SEARCH
+2 GOTO ALL
SEARCH SET ENH=$ORDER(^ENG(6914,ENR,6,ENH))
if ENH
GOTO SRCH1
+1 IF ENSTR(0)]""
FOR J=0:1
if '$DATA(K(J))
QUIT
SET K=K+K(J)
+2 IF K>(ENN-1)
FOR J=0:1
if '$DATA(ENSTR(J))
QUIT
SET ^TMP($JOB,"ENEQFA",ENR,J)=ENSTR(J)
+3 KILL A,B,C,ENH,ENSTR,K,ENA,J
QUIT
SRCH1 SET A=^ENG(6914,ENR,6,ENH,0)
SET B=$PIECE(A,"^",1)
SET C=$PIECE(B,"-")
SET D=$PIECE(B,"-",2)
+1 IF ENFR<C
IF ENTO>C
Begin DoDot:1
+2 IF D["G1"!(D["RP")
DO ADD
QUIT
+3 IF ENVEND
IF D["V"
DO ADD
End DoDot:1
+4 GOTO SEARCH
+5 ;
ADD if $LENGTH(ENSTR(ENA))>200
SET ENA=ENA+1
SET ENSTR(ENA)=""
SET K(ENA)=0
+1 SET K(ENA)=K(ENA)+1
SET $PIECE(ENSTR(ENA),"^",K(ENA))=ENH
+2 QUIT
+3 ;
EXIT SET ENERR=0
KILL E,ENDA,ENDVTYP,ENFR,ENTO,ENH,ENFY,ENQT,ENR,ENSTR,ENVEND,ENA
+1 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 QUIT
+3 ;ENEQRP3