source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQNX2.m@ 724

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

initial load of WorldVistAEHR

File size: 2.2 KB
RevLine 
[613]1ENEQNX2 ;(WASH ISC)/DH-Update Equipment Record ;2.24.97
2 ;;7.0;ENGINEERING;**1,35**;Aug 17, 1993
3 ;
4UPDATE ; Update File 6914
5 N DIE,DA,DR,TAG
6 I '$D(DT) S U="^",%DT="",X="T" D ^%DT S DT=+Y
7 I '$D(^ENG(6914,ENEQ,0)) S ENMSG="ITEM NOT IN DATABASE.",ENMSG(0,1)="Label was scanned incorrectly or File 6914 is corrupted." D XCPTN^ENEQNX1 Q
8 L +^ENG(6914,ENEQ):5 I '$T S ENMSG="RECORD LOCKED. Equipment ID#: "_ENEQ,ENMSG(0,1)="This record is being edited by another user at this time.",ENMSG(0,2)="Please update the inventory record manually." D XCPTN^ENEQNX1 Q
9 S TAG="XCPTN^ENEQNX1" D FLAG
10 S ENOLDLOC=""
11 I $P($G(^ENG(6914,ENEQ,2)),U,13)=DT D I ENLOC=ENOLDLOC L -^ENG(6914,ENEQ) Q ;Record already updated
12 . S X=$P($G(^ENG(6914,ENEQ,3)),U,5) I X]"",X'["E",X=+X S ENOLDLOC=$P($G(^ENG("SP",X,0)),U)
13 . Q:ENLOC=ENOLDLOC
14 . I ENOLDLOC["e" S ENOLDLOC=$TR(ENOLDLOC,"e","E")
15 S ENLOC(0)=ENLOC
16 I ENLOC]"",'$D(^ENG("SP","B",ENLOC)),ENLOC["E" F S ENLOC(0)=$P(ENLOC(0),"E")_"e"_$P(ENLOC(0),"E",2,99) I $D(^ENG("SP","B",ENLOC(0)))!(ENLOC(0)'["E") Q
17 I '$D(^ENG("SP","B",ENLOC(0))) L -^ENG(6914,ENEQ) S ENMSG="BAD LOCATION",ENMSG(0,1)="Location not in Space File. Can't update the Equipment Record." D XCPTN^ENEQNX1 Q
18 S DIE="^ENG(6914,",DA=ENEQ,DR="24///^S X=ENLOC(0);23///^S X=DT"
19 D ^DIE L -^ENG(6914,ENEQ)
20 Q
21 ;
22FLAG ; Something special about this equipment
23 N ENMSG,ENWO,I,J,X
24 S X=$$GET1^DIQ(6914,ENEQ,20) I X]"","TURNED IN^LOST OR STOLEN"[X S ENMSG(0,1)="Use Status indicates that this equipment is "_X_"."
25 S ENWO=0 F S ENWO=$O(^ENG(6920,"G",ENEQ,ENWO)) Q:'ENWO D
26 . Q:$P($G(^ENG(6920,ENWO,5)),U,2)]""
27 . S J=0 F S J=$O(^ENG(6920,ENWO,8,J)) Q:'J I $P($G(^ENG(6920,ENWO,8,J,0)),U)=8 D
28 .. S (J,ENWO)=9999999999,I=$S($D(ENMSG(0,1)):2,1:1)
29 .. S ENMSG(0,I)="There is an open HAZARD ALERT on this piece of equipment."
30 I $D(ENMSG(0,1)) S ENMSG="EQUIPMENT FLAG" D @TAG
31 Q
32 ;
33HOLD I $E(IOST,1,2)="C-" W !,"Press <RETURN> to continue..." R X:DTIME
34 Q
35 ;
36EXIT I $E(IOST,1,2)="C-",$D(ENY),ENY>0 D HOLD
37 K EN,ENA,ENB,ENEQ,ENLBL,ENSTA,ENSTAL,ENMSG,ENCTID,ENCTTI,ENX,ENX1,ENY,ENCTID
38 K ENLOC,ENOLDLOC,ENLKAHD,ENPG,ENDATE,ENDA,I,J,K,DIC,DIC,DA,DR,%DT,%,X
39 W @IOF
40 I $E(IOST,1,2)="P-",'$D(ZTQUEUED) D ^%ZISC
41 S:$D(ZTQUEUED) ZTREQ="@"
42 Q
43 ;ENEQNX2
Note: See TracBrowser for help on using the repository browser.