source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQNX3.m@ 1361

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

initial load of WorldVistAEHR

File size: 3.1 KB
RevLine 
[613]1ENEQNX3 ;(WIRMFO)/DH-Process Uploaded Equipment Inventory ;3.4.97
2 ;;7.0;ENGINEERING;**21,35**;Aug 17, 1993
3NOLBL ;No bar code label scanned
4 N EN,ENSN,ENMOD
5 F I=0,1,2 S EN(I)=""
6 S ENLBL="NO LABEL",EN(0)=$E(ENEQ,5,40),ENX1=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX)) I ENX1]"" S EN(1)=$S($E(^(ENX1,0))="*":"",1:^(0)) S:$E(EN(1),1,4)="S/N:" ^(0)="*"_EN(1),ENX=ENX1,EN(1)=$E(EN(1),5,40)
7 S EN(2)="NO DESCRIPTION.",ENX1=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX)) S ENLKAHD=$S(ENX1]"":^(ENX1,0),1:"")
8 I ENLKAHD]"",$E(ENLKAHD)'="*",$E(ENLKAHD,1,2)'="SP",$E(ENLKAHD,1,4)'="MOD:",$E(ENLKAHD,1,4)'="PM#:",ENLKAHD'[" EE" S EN(2)=ENLKAHD,ENX=ENX1,^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX,0)="*"_ENLKAHD
9 I EN(0)[" " D
10 . F Q:$E(EN(0))'=" " S EN(0)=$E(EN(0),2,99)
11 . I $E(EN(0),$L(EN(0)))=" " F Q:$E(EN(0),$L(EN(0)))'=" " S EN(0)=$E(EN(0),1,($L(EN(0))-1))
12 I EN(1)[" " D
13 . F Q:$E(EN(1))'=" " S EN(1)=$E(EN(1),2,99)
14 . F Q:$E(EN(1),$L(EN(1)))'=" " S EN(1)=$E(EN(1),1,($L(EN(1))-1))
15 I EN(1)]"" D
16 . S ENDA=$O(^ENG(6914,"F",EN(1),0)) I ENDA>0 S ENSN=EN(1) Q
17 . S EN(1,0)=$TR(EN(1)," ~!@#$%^&*()_+|`-=\[]{};':"",./<>?",""),EN(1,0)=$$UP^XLFSTR(EN(1,0)) S ENDA=$O(^ENG(6914,"FC",(EN(1,0)_" "),0)) I ENDA>0 S ENSN=$P($G(^ENG(6914,ENDA,1)),U,3)
18 I $G(ENSN)]"" D Q
19 . I EN(0)'=$P($G(^ENG(6914,ENDA,1)),U,2) S ENMSG(0,2)="NOTE: Entered MODEL does not match stored value."
20 . D MATCH
21 ;If match found EN will be killed
22 I $D(EN) S ENMSG="ITEM NOT IN DATABASE.",ENMSG(0,1)="Model: "_EN(0),ENMSG(0,2)="Serial number: "_EN(1),ENMSG(0,3)="Description: "_EN(2) D XCPTN^ENEQNX1
23 Q
24PMN ;Process PM #
25 S ENLBL="NO LABEL",^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX,0)="*"_ENEQ,ENEQ=$E(ENEQ,5,40) S:ENEQ[" " ENEQ=$TR(ENEQ," ") S ENDA=$O(^ENG(6914,"C",ENEQ,0)) I ENDA>0 D MATCH Q
26 S ENMSG="ITEM NOT IN DATABASE.",ENMSG(0,1)="PM #: "_ENEQ D XCPTN^ENEQNX1
27 Q
28MATCH ;Equipment unlabelled but present in 6914
29 S ENMSG="BAR CODE LABEL MISSING. Equipment ID#: "_ENDA,ENMSG(0,1)="Record will be updated, but bar code label should be printed and applied."
30 D XCPTN^ENEQNX1
31 S ENEQ=ENDA D UPDATE^ENEQNX2
32 K EN Q
33 ;
34MSG ;Opening message to user
35 W !!,"The system is now ready to update the EQUIPMENT INV. file on the basis of",!,"data acquired from the portable bar code reader."
36 W !!,"If the system encounters data that cannot be processed in the normal fashion",!,"it will give you written notice in the form of an Exception Message. These"
37 W !,"messages will provide notification of such things as missing bar code",!,"labels and database inconsistencies."
38 W !!,"You must now select a hard copy device (printer) to receive Exception",!,"Messages."
39 W !!,"You may enter the letter 'Q' and then select a device if you wish to",!,"schedule this data processing task for some later time.",!
40 Q
41HOLD W !,"Press <RETURN> to continue..." R X:DTIME
42 Q
43ERR ;Error message (Forced exit)
44 W !!,*7,"FATAL ERROR OR USER ABORT.",*7
45 W !,"Process ID is: ENNX Time stamp is: ",$S($D(ENCTTI):$P(^PRCT(446.4,ENCTID,2,ENCTTI,0),U,1),1:"UNDEFINED.")
46 W !,"Please make a note of this information, as you will need it to RESTART",!,"processing of the data on file."
47 S ENY=0 D HOLD
48 G EXIT^ENEQNX2
49 ;ENEQNX3
Note: See TracBrowser for help on using the repository browser.