source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENWARD2.m@ 1437

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1ENWARD2 ;(WASH ISC)/DH-Incomplete Work Orders for End Users ;2.18.97
2 ;;7.0;ENGINEERING;**35**;Aug 17, 1993
3EN N TAG,SPC,IOINLOW,IOINHI D ZIS^ENUTL S ENLP=1,ENPG=0
4 S %DT="X",X="T" D ^%DT X ^DD("DD") S ENTOD=Y
5 K ^TMP("ENEQ",$J) S ENCNT=0
6 I ENBY="R" D G EXIT
7 . S DA=0 F S DA=$O(^ENG(6920,"C",ENROOM,DA)) Q:DA'>0 D
8 .. I $D(^ENG(6920,DA,0)),$P($G(^(5)),U,2)="",$E($P(^(0),U),1,3)'="PM-" S ^TMP("ENEQ",$J,DA)="",ENCNT=ENCNT+1
9 .. I $E(IOST,1,2)="C-" W "."
10 . D PRNTWO
11 F ENSHKEY=0:0 S ENSHKEY=$O(^ENG(6920,"AINC",ENSHKEY)) Q:ENSHKEY="" D FINDWO
12 I $E(IOST,1,2)="C-" W !
13 D PRNTWO
14 G EXIT
15FINDWO F DNX=0:0 S DNX=$O(^ENG(6920,"AINC",ENSHKEY,DNX)) Q:DNX="" D
16 . S DA=9999999999-DNX
17 . I $E(IOST,1,2)="C-",'(DA#20) W "."
18 . I $D(^ENG(6920,DA,0)),$E(^(0),1,3)'="PM-" D CHECK
19 Q
20CHECK I ENBY="E",$D(^ENG(6920,DA,1)),$P(^(1),U,1)=ENEB S ^TMP("ENEQ",$J,DA)="",ENCNT=ENCNT+1 Q
21 I ENBY="L" S SPC=$P($G(^ENG(6920,DA,0)),U,4) Q:SPC="" S X=$$SPACE^ENEQPMS8(SPC) Q:X=-1 S ^TMP("ENEQ",$J,DA)="",ENCNT=ENCNT+1 Q
22 I ENBY="S",$D(^ENG(6920,DA,3)),$P(^(3),U,4)=ENSRVC S ^TMP("ENEQ",$J,DA)="",ENCNT=ENCNT+1 Q
23 Q
24PRNTWO ;Print from TMP global
25 U IO S DA=0 I $O(^TMP("ENEQ",$J,DA))="" S ENWONX=0 G WAIT
26TOP I $D(DA),DA]"",$O(^TMP("ENEQ",$J,DA))="" G WAIT
27 I $E(IOST,1,2)="C-"!(ENPG) W @IOF
28 S ENPG=ENPG+1,ENY=5
29 W "Incmplt Work Orders (",$S(ENBY="E":"Entered by => "_$E($P(^VA(200,ENEB,0),U),1,25),ENBY="S":"Service/Section => "_$E($P(^DIC(49,ENSRVC,0),U),1,25),ENBY="R":"Room => "_$P(^ENG("SP",ENROOM,0),U),1:"") W:ENBY'="L" ")"
30 I ENBY="L" W "By Locations)"
31 W ?60,ENTOD_" Pg: "_ENPG
32 W !,"ORIG WO # CURRENT WO # REQ DATE STATUS",?66,"PRIORITY"
33 W !,?1,"LOCATION",?19,"EQUIP ID#",?31,"TASK DESCRIPTION",?66,"Count: ",ENCNT
34 K X S $P(X,"-",78)="-" W !,X
35 K X S ENWONX=0,ENOWONX=DA
36FDAT S DA=$O(^TMP("ENEQ",$J,DA)) G:DA="" WAIT
37 I IO'=IO(0),'(DA#5) U IO(0) W "." U IO
38 I $D(^ENG(6920,DA,4)),$P(^(4),U,3)=5 G FDAT
39 S ENLP=0,EN(0)=^ENG(6920,DA,0),EN(1)=$S($D(^(1)):^(1),1:""),EN(2)=$S($D(^(2)):^(2),1:""),EN(3)=$S($D(^(3)):^(3),1:""),EN(4)=$S($D(^(4)):^(4),1:"")
40FDAT4 ;
41 S (ENORIG,ENWOR,ENRDA,ENLOC,ENSTAT,ENPRI,ENDESC,ENEQ)=""
42 S ENORIG=$P(EN(0),U,6),ENWOR=$P(EN(0),U),ENRDA=$P(EN(0),U,2),ENLOC=$P(EN(0),U,4),ENSTAT=$P(EN(4),U,3),ENPRI=$P(EN(2),U,3),ENDESC=$P(EN(1),U,2),ENEQ=$P(EN(3),U,8)
43 I $D(ENDLQ),ENDLQ>0 S X1=ENTOD,X2=ENRDA D ^%DTC G:X<ENDLQ FDAT
44 I ENLOC=+ENLOC,$D(^ENG("SP",ENLOC,0)) S ENLOC=$P(^(0),U)
45 S ENWONX=ENWONX+1,ENWONX(ENWONX)=DA
46 I $E(IOST,1,2)="C-" W:ENPRI="E"!(ENPRI="H") IOINHI
47 I ENPRI]"" S ENPRI=$E($$EXTERNAL^DILFD(6920,17,"",ENPRI),1,4)
48FDAT7 K X
49 I ENRDA]"" S %DT="X",X=$P(ENRDA,".",1) D ^%DT X ^DD("DD") S ENRDA=Y
50 I ENSTAT]"" S ENSTAT=$$EXTERNAL^DILFD(6920,32,"",ENSTAT)
51WDAT W !,ENORIG,?18,ENWOR,?35,ENRDA,?49,ENSTAT,?68,ENPRI
52 W !,?1,ENLOC,?19,ENEQ,?31,$E(ENDESC,1,48)
53 S ENY=ENY+2
54NEXT I $E(IOST,1,2)="C-" W IOINLOW
55 D CLEAN I $E(IOST,1,2)'="C-",(IOSL-ENY>3) W ! G FDAT
56 I $E(IOST,1,2)'="C-" G TOP
57 I IOSL-ENY>3 G FDAT
58 W !,"PRESS '^' TO EXIT; OR PRESS 1 TO ",ENWONX," FOR EXPANDED DISPLAY: /MORE//=> " R A:DTIME
59 I A?1.2N,$D(ENWONX(A)) S DA=ENWONX(A) I $D(^ENG(6920,DA,0))>0 D EXPAND G TOP
60 I A="^" G EXIT
61 K ENWONX G TOP
62WAIT G:'$D(ENWONX) EXIT
63 I ENWONX=0,ENLP D I $E(IOST,1,2)="C-" D HOLD G EXIT
64 . W !!,"No incomplete work orders found for ",$S(ENBY="E":$P(^VA(200,ENEB,0),U),ENBY="L":"specified locations",ENBY="R":$P(^ENG("SP",ENROOM,0),U),ENBY="S":$P(^DIC(49,ENSRVC,0),U),1:"??"),"."
65 I $E(IOST,1,2)'="C-" W ! G EXIT
66 W !,"PRESS RETURN FOR MENU; OR PRESS 1 TO ",ENWONX," FOR EXPANDED DISPLAY: /EXIT//=> " R A:DTIME
67 I A?1.2N,$D(ENWONX(A)) S DA=ENWONX(A) I $D(^ENG(6920,DA,0))>0 D EXPAND G:ENOWONX=9999999999 EXIT G TOP
68 G EXIT
69EXPAND ;Screen display work order
70 D D^ENEWOD F D READ^ENEWOD Q:ENX="" S TAG=ENX_"^ENEWOD" D @TAG
71 S DA=ENOWONX,ENPG=ENPG-1
72 Q
73 ;
74HOLD W !!,"Press <RETURN> to continue..." R A:DTIME
75 Q
76 ;
77EXIT K DNX,ENWO,ENOWONX,ENWONX,ENLP,ENTOD,ENST,ENBY,ENEB,ENSRVC,ENPG,ENDESC,EN,DA,ENSHKEY,ENDSTAT,ENTOD,ENCNT,ENX,ENY,ENA,ENB,ENNX,ENSRT
78 W @IOF
79 I $E(IOST,1,2)="P-",'$D(ZTQUEUED) D ^%ZISC
80 K ^TMP("ENEQ",$J)
81 S:$D(ZTQUEUED) ZTREQ="@"
82CLEAN K ENWOR,ENRDA,ENLOC,ENPRI,ENORIG,ENSTAT,ENEQ
83 K ENAC,Y,Y1,A
84 Q
85 ;ENWARD2
Note: See TracBrowser for help on using the repository browser.