source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENWONEW2.m@ 1593

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1ENWONEW2 ;(WASH ISC)/DH-Work Order Entry ;5.29.97
2 ;;7.0;ENGINEERING;**1,25,35,42**;Aug 17, 1993
3 ;
4TRNIN ; Entry point to get work order for de-installation of equipment
5 ; Expects DUZ
6 ; Expects EQUIPMENT ID in piece 1 of WODATA, LOCATION in piece 2
7 ; Expects that SERVICE POINTER may be in local variable PRCNSRV
8 ; Returns work order number as ENWO and internal entry number as ENDA
9 I $G(DUZ),+$G(WODATA)
10 E Q ;Insufficient information to proceed
11 N SHOPKEY,NUMBER,NAME,PHONE,ITEM,LOC,SERVICE,WARD
12 N DIC,DIE,DIQ,DA,DR
13 S SHOPKEY=$P($G(^DIC(6910,1,20)),U) D:'SHOPKEY Q:'SHOPKEY
14 . S SHOPKEY=$P($G(^DIC(6910,1,0)),U,6) D:'SHOPKEY
15 .. S DIC="^DIC(6922,",DIC(0)="AEQM",DIC("S")="I Y#100>89" D ^DIC K DIC("S") S:Y>0 SHOPKEY=+Y
16 Q:'$D(^DIC(6922,SHOPKEY,0))
17 D WONUM^ENWONEW ;create work order
18 I NUMBER="" W !!,"Can't seem to add a new work order at this time. Suggest that you",!,"contact IRM.",*7 Q
19 W !,"Work Order #: ",NUMBER S ENDA=DA,ENWO=NUMBER
20 L +^ENG(6920,ENDA):0 I '$T W !!,"Bad news. Another user is already editing the work order that you just",!,"created. Please make a note of the work order number and advise Engineering",!,"Service of the problem."
21FILL ;Fill in the work order
22 S DIC="^VA(200,",DR=".01;.131;.132;.133;.134;.135",DIQ="TMP",DIQ(0)="E",DA=DUZ
23 D EN^DIQ1
24 S NAME=$E(TMP(200,DA,.01,"E"),1,15)
25 F X=".131",".132",".133",".134",".135" S PHONE=TMP(200,DA,X,"E") Q:PHONE]""
26 K TMP
27LOAD S DIE="^ENG(6920,",DA=ENDA,DR="1///N;.05///^S X=NUMBER;7.5////"_DUZ_";9///"_SHOPKEY_";2///C"
28 S DR=DR_";7///"_NAME_";17///A" S:PHONE]"" DR=DR_";8///^S X=PHONE"
29 S ITEM=$P(WODATA,U),LOC=$P(WODATA,U,2)
30 I LOC=+LOC S LOC=$P($G(^ENG("SP",LOC,0)),U)
31 I LOC']"" S LOC=$P($G(^ENG(6914,ITEM,3)),U,5) S:LOC=+LOC LOC=$P(^ENG("SP",LOC,0),U)
32 S DR=DR_";18///^S X=ITEM" I LOC]"" S DR=DR_";3///^S X=LOC"
33 I $G(PRCNSRV) S SERVICE=$P($G(^DIC(49,+PRCNSRV,0)),U),DR=DR_";23///^S X=SERVICE"
34 S DR=DR_";6///Prepare equipment for turn-in.;32///^S X=2;35///R2"
35 D ^DIE
36 S DR=$S($D(^DIE("B","ENZTIWO")):"[ENZTIWO]",$D(^DIE("B","ENTIWO")):"[ENTIWO]",1:"")
37 D:DR]"" ^DIE
38 L -^ENG(6920,ENDA)
39 S WARD=1 D WOPRNT^ENWONEW
40 Q
41 ;
42AUTODEV ;Get device from ENG SECTION (null if unsuccessful)
43 S DEVICE="",X=$P(^DIC(6922,SHOPKEY,0),U,3)
44 I X]"",$D(^%ZIS(1,X,0)) S DEVICE=$P(^(0),U) S IOP=DEVICE,%ZIS="NQ" D ^%ZIS K IOP
45 I WARD,DEVICE="" Q
46 I DEVICE="" S %ZIS="NQ" D ^%ZIS S DEVICE=$S(POP:"",IO(0)=IO:"HOME",1:ION)
47 I ION="NULL" D HOME^%ZIS S DEVICE=""
48 Q
49 ;
50 ;ENWONEW2
Note: See TracBrowser for help on using the repository browser.