source: FOIAVistA/tag/r/ENGINEERING-EN/ENWOP2.m@ 1778

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1ENWOP2 ;(WASH ISC)/DH-Count Incomplete Work Orders ;5/8/1998
2 ;;7.0;ENGINEERING;**6,35,53**;Aug 17, 1993
3 N DATE S %DT="X",X="N" D ^%DT S ENTOD=Y D DD^%DT S DATE=Y,(ENPG,ENQUIT)=0
4 I '$D(ENSHKEY("ALL")) W:$E(IOST,1,2)="C-" @IOF D COUNT,HDR W !!,$P(^DIC(6922,ENSHKEY,0),U),": ",ENCOUNT D:$E(IOST,1,2)="C-" HOLD G EXIT
5 N ENSHKEY W:$E(IOST,1,2)="C-" @IOF
6 D HDR
7 F ENSHKEY=0:0 S ENSHKEY=$O(^DIC(6922,ENSHKEY)) Q:ENQUIT!(ENSHKEY'>0) D
8 . I IO'=IO(0) U IO(0) W "." U IO
9 . D COUNT I ENBY'="SHOP",ENCOUNT=0 Q
10 . S ENY=ENY+2
11 . W !!,$P(^DIC(6922,ENSHKEY,0),U),": ",ENCOUNT
12 . I (IOSL-ENY)'>4 D HDR Q:ENQUIT
13 I 'ENQUIT,$E(IOST,1,2)="C-" D HOLD
14 G EXIT
15 ;
16HDR I ENPG D:$E(IOST,1,2)="C-" HOLD Q:ENQUIT W @IOF
17 S ENPG=ENPG+1,ENY=4
18 W "COUNT OF INCOMPLETE ENGINEERING WORK ORDERS ",?50,DATE,?65,"Page ",ENPG
19 I ENBY'="SHOP" S ENY=ENY+1 D
20 . I ENBY="EMP" W !,"Employee: ",$S(ENEMP="":"NONE",1:$P(^ENG("EMP",ENEMP,0),U))
21 . I ENBY="ROOM" W !,"For a Specific Room: "_$P(^ENG("SP",ENROOM,0),U)
22 . I ENBY="LOC" W !,"By Location Search:"
23 . I ENBY="ONR" W !,"Owner/Department: ",$P(^DIC(49,ENONR,0),U)
24 W !,$S(ENPMINC:"(Includes ",1:"(Does not include "),"PM Work Orders)"
25 K X S $P(X,"-",78)="-" W !,X
26 Q
27COUNT ;Get count for shop ENSHKEY
28 S ENCOUNT=0,ENDNX=""
29FDAT S ENDNX=$O(^ENG(6920,"AINC",ENSHKEY,ENDNX)) Q:ENDNX="" S DA=9999999999-ENDNX G:'$D(^ENG(6920,DA,0)) FDAT I 'ENPMINC,$E(^(0),1,3)="PM-" G FDAT
30 Q:ENDNX=""
31 I $D(^ENG(6920,DA,5)),$P(^(5),U,2)]"" K ^ENG(6920,"AINC",ENSHKEY,ENDNX) G FDAT
32 I ENBY="EMP",ENEMP'=$P($G(^ENG(6920,DA,2)),U,2) G FDAT
33 I ENBY="ROOM",ENROOM'=$P(^ENG(6920,DA,0),U,4) G FDAT
34 I ENBY="LOC" S SPC=$P(^ENG(6920,DA,0),U,4) G:SPC="" FDAT S X=$$SPACE^ENEQPMS8(SPC) G:X=-1 FDAT
35 I ENBY="ONR" G:'$D(^ENG(6920,DA,3)) FDAT I $P(^(3),U,4)'=ENONR G FDAT
36 S ENRDA=$P(^ENG(6920,DA,0),U,2)
37 S X1=ENTOD,X2=ENRDA D ^%DTC G:X<ENDLQ FDAT
38 S ENCOUNT=ENCOUNT+1
39 G FDAT
40 ;
41HOLD W !!,"Press <RETURN> to continue, '^' to exit..." R X:DTIME
42 I $E(X)="^" S ENQUIT=1
43 Q
44 ;
45EXIT K DA,ENDNX,ENPG,ENY,ENCOUNT,ENQUIT,ENTOD,ENRDA
46 W @IOF
47 Q
48 ;ENWOP2
Note: See TracBrowser for help on using the repository browser.