source: FOIAVistA/trunk/r/ENGINEERING-EN/ENBCPM2.m@ 996

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1ENBCPM2 ;(WASH ISC)/DH-Bar Coded PMI ;4.9.97
2 ;;7.0;ENGINEERING;**1,35**;Aug 17, 1993
3UPDATE ; Update File 6914
4 N DIE,DA,DR,TAG
5 I '$D(^ENG(6914,ENEQ,0)) S ENMSG="ITEM NOT IN DATABASE.",ENMSG(0,1)="Label was scanned incorrectly or Equipment File is corrupted." D XCPTN Q
6 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 data manually." D XCPTN Q
7 S TAG="XCPTN^ENBCPM2" D FLAG^ENEQNX2
8 S ENOLDLOC=""
9 I $P($G(^ENG(6914,ENEQ,2)),U,13)=DT D I ENOLDLOC=ENLOC L -^ENG(6914,ENEQ) Q ;Record already updated
10 . 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)
11 . Q:ENLOC=ENOLDLOC
12 . I ENLOC["E" S ENOLDLOC=$TR(ENOLDLOC,"e","E")
13 S ENLOC(0)=ENLOC
14 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
15 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 Q
16 S DIE="^ENG(6914,",DA=ENEQ,DR="24///^S X=ENLOC(0);23///^S X=DT"
17 D ^DIE L -^ENG(6914,ENEQ)
18 Q
19 ;
20XCPTN ; Print Exception Messages
21 U IO
22 D:ENY=0!(ENY>(IOSL-5)) HDR W !!,ENMSG,! W:$D(ENLBL) " Label scanned as: ",ENLBL W:$D(ENLOC) " Location: ",ENLOC S ENY=ENY+3
23 I $D(ENMSG(0)) F I=0:0 S I=$O(ENMSG(0,I)) Q:I'=+I W !,ENMSG(0,I) S ENY=ENY+1
24 K ENMSG
25 Q
26 ;
27HDR ; New page for exception printing
28 U IO
29 I IO=IO(0),$E(IOST,1,2)="C-",ENY>0 D HOLD
30 I ENPG!($E(IOST,1,2)="C-") W @IOF
31 S ENPG=ENPG+1
32 W "BAR CODED PMI EXCEPTION MESSAGES (Time stamp: "_ENCTTI(0)_")",?(IOM-8),ENDATE
33 W !," Global Reference: ^PRCT(446.4,"_ENCTID_",2,"_ENCTTI_",1,",?(IOM-10),"Page ",ENPG
34 K X S $P(X,"-",(IOM-1))="-" W !,X
35 S ENY=4
36 Q
37HOLD I $E(IOST,1,2)="C-" W !,"Press RETURN to continue..." R X:DTIME
38 Q
39ZTSK ;Schedule processing for later time (from ENBCPM1)
40 K IO("Q") S ZTIO=IO,ZTRTN="NEWLOC^ENBCPM1",ZTDESC="Record PMI (Bar code)",ZTSAVE("EN*")="",ZTSAVE("DT")=""
41 D ^%ZTLOAD K ZTSK
42 G EXIT^ENBCPM5
43 ;ENBCPM2
Note: See TracBrowser for help on using the repository browser.