source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQRP3.m@ 1361

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

initial load of WorldVistAEHR

File size: 2.6 KB
RevLine 
[613]1ENEQRP3 ;(WCIOFO)/DH-Report of High Failure Items ;10/21/1998
2 ;;7.0;ENGINEERING;**14,48,59**;Aug 17, 1993
3F1 ;Print list of items with high repair counts
4 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
5 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
6 S DIC="^ENG(6911,",DIC(0)="AEQM" D ^DIC G:Y<1 EXIT S ENDA=+Y,ENDVTYP=$P(^ENG(6911,ENDA,0),"^",1)
7F2 S DIR("A")="Starting date for this report",DIR(0)="D^:DT:AEP" D ^DIR G:Y'>0 EXIT S ENFR=Y
8 S DIR("A")="Ending date for this report",DIR(0)="D^"_ENFR_":DT:AEP" D ^DIR G:Y'>0 EXIT S ENTO=Y
9 K DIR
10 ;
11F3 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
12 G:R="^" EXIT I +R=R,R?1.2N,R>0 S ENN=R G F4
13 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
14F4 W !,"Include all vendor activity, (work actions beginning with a 'V')" S %=2 D YN^DICN G:%=-1 EXIT
15 I %=0 D G F4
16 . 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"
17 . W !,"identified as 'Vendor Service' items by answering [Y]es at this prompt."
18 S ENVEND=$S(%=1:1,1:0),ENR=0 D DEV^ENLIB G:POP EXIT
19 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
20F5 K ^TMP($J) W:'$D(ZTQUEUED) !!," compiling the data..." D @$S(ENDVTYP'=0:"ET",1:"ALL") G FAP^ENEQRP4
21ET S ENR=$O(^ENG(6914,"G",ENDA,ENR)),ENH=0,ENA=0,ENSTR(ENA)="" Q:ENR="" I '$D(ZTQUEUED),'(ENR#10) W "."
22 I $D(^ENG(6914,ENR,6)) S (K,K(ENA))=0 D SEARCH
23 G ET
24ALL S ENR=$O(^ENG(6914,ENR)) Q:ENR'>0 I '$D(ZTQUEUED),'(ENR#10) W "."
25 I $D(^ENG(6914,ENR,6)) S (ENA,ENH,K)=0,K(ENA)=0,ENSTR(ENA)="" D SEARCH
26 G ALL
27SEARCH S ENH=$O(^ENG(6914,ENR,6,ENH)) G:ENH SRCH1
28 I ENSTR(0)]"" F J=0:1 Q:'$D(K(J)) S K=K+K(J)
29 I K>(ENN-1) F J=0:1 Q:'$D(ENSTR(J)) S ^TMP($J,"ENEQFA",ENR,J)=ENSTR(J)
30 K A,B,C,ENH,ENSTR,K,ENA,J Q
31SRCH1 S A=^ENG(6914,ENR,6,ENH,0),B=$P(A,"^",1),C=$P(B,"-"),D=$P(B,"-",2)
32 I ENFR<C,ENTO>C D
33 . I D["G1"!(D["RP") D ADD Q
34 . I ENVEND,D["V" D ADD
35 G SEARCH
36 ;
37ADD S:$L(ENSTR(ENA))>200 ENA=ENA+1,ENSTR(ENA)="",K(ENA)=0
38 S K(ENA)=K(ENA)+1,$P(ENSTR(ENA),"^",K(ENA))=ENH
39 Q
40 ;
41EXIT S ENERR=0 K E,ENDA,ENDVTYP,ENFR,ENTO,ENH,ENFY,ENQT,ENR,ENSTR,ENVEND,ENA
42 S:$D(ZTQUEUED) ZTREQ="@"
43 Q
44 ;ENEQRP3
Note: See TracBrowser for help on using the repository browser.