source: FOIAVistA/trunk/r/ENGINEERING-EN/ENEQNX1.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1ENEQNX1 ;(WASH ISC)/DH-Process Uploaded Equipment Inventory ;1/9/2001
2 ;;7.0;ENGINEERING;**10,21,45,68**;Aug 17, 1993
3RES ;Restart an aborted process
4 S X="",ENY=0 W !!,"Enter PROCESS ID: " R X:DTIME G:X="^"!(X="") EXIT^ENEQNX2 S ENCTID=$O(^PRCT(446.4,"C",X,"")) I ENCTID="" W !!,*7,"Wrong application. Aborting..." D HOLD G EXIT^ENEQNX2
5 S X="" W !!,"Enter TIME STAMP of process to be restarted: " R X:DTIME G:X="^"!(X="") EXIT^ENEQNX2 S ENCTTI=$O(^PRCT(446.4,ENCTID,2,"B",X,"")) I ENCTTI="" W !!,"NO DATA. Aborting..." D HOLD G EXIT^ENEQNX2
6EN ;Main entry point. Expects ENCTID and ENCTTI.
7 G:'$D(ENCTID) ERR^ENEQNX3
8 S ENSTA=$P($G(^DIC(6910,1,0)),U,2),ENSTAL=$L(ENSTA)
9 I ENSTA="" W !!,"Can't seem to find your STATION NUMBER. Please check File 6910.",!,"Your IRM staff may need to assist you.",*7 G ERR^ENEQNX3
10 F I=1,2,3,4,5,6,7,8 S ENSTA(I)="",ENSTAL(I)=0
11 I $G(^DIC(6910,1,3,0))]"" D
12 . S (I,ENX)=0 F S ENX=$O(^DIC(6910,1,3,ENX)) Q:'ENX!(I>8) D
13 .. S I=I+1,ENSTA(I)=$P(^DIC(6910,1,3,ENX,0),U)
14 .. S ENSTAL(I)=$L(ENSTA(I))
15 S X="T",U="^",%DT="" D ^%DT S DT=+Y X ^DD("DD") S ENDATE=Y I '$D(DTIME) S DTIME=600
16 D MSG^ENEQNX3
17 S %ZIS="Q",%ZIS("A")="Select Device for Exception Messages: " D ^%ZIS K %ZIS G:POP ERR^ENEQNX3
18 G:$D(IO("Q")) ZTSK
19CONT ;Physical processing of uploaded data
20 U IO S (ENY,ENPG)=0,ENX=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,0)) I ENX'>0 D HDR W *7,!!,"No data to process." D HOLD G EXIT^ENEQNX2
21 S ENX=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX)) ;ignore file ID
22NEWLOC ;Beginning of a specific location
23 S ENLBL=^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX,0),ENLOC=$E(ENLBL,3,50) I $E(ENLBL,1,2)'="SP" S ENMSG="LOCATION EXPECTED." D XCPTN S ENX=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX)) G:ENX'>0 EXIT^ENEQNX2 G NEWLOC
24 I ENLOC[" " S ENLOC=$P(ENLOC," ")
25 S X=$L(ENLOC) I $E(ENLOC,X)=" " S ENLOC=$E(ENLOC,1,(X-1))
26NEWNX ;Process a piece of equipment
27 S ENX=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX)) G:ENX'>0 DONE S (ENEQ,ENLBL)=^(ENX,0) G:$E(ENLBL)="*" NEWNX
28 I $E(ENEQ,1,2)="SP" K ENEQ G NEWLOC
29 S ^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX,0)="*"_ENEQ
30 I $E(ENEQ,1,4)="MOD:" D NOLBL^ENEQNX3 G NEWNX
31 I $E(ENEQ,1,4)="PM#:" D PMN^ENEQNX3 G NEWNX
32 I ENEQ[" EE",$P(ENEQ," ")'=ENSTA D I $D(ENMSG) D XCPTN G NEWNX
33 . K ENMSG S ENMSG="FOREIGN EQUIPMENT."
34 . F I=1:1:8 I ENSTAL(I),ENSTA(I)=$E(ENEQ,1,ENSTAL(I)) K ENMSG Q
35 . I $D(ENMSG) S ENMSG(0,1)="Cannot process a bar code label from another VAMC."
36 S ENEQ=$S($D(^ENG(6914,"OEE",ENLBL)):$O(^(ENLBL,0)),1:+$P(ENLBL,"EE",2))
37 I ENEQ>0 D UPDATE^ENEQNX2
38 G NEWNX
39 ;
40XCPTN ;Print Exception Messages
41 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
42 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
43 K ENMSG
44 Q
45 ;
46HDR ;New page for exception printing
47 I $E(IOST,1,2)="C-",ENY>0 D HOLD
48 I ENPG!($E(IOST,1,2)="C-") W @IOF
49 S ENPG=ENPG+1
50 W "NON-EXPENDABLE INVENTORY EXCEPTION MESSAGES",?(IOM-15),ENDATE
51 W !," Global Reference: ^PRCT(446.4,"_ENCTID_",2,"_ENCTTI_",1,",?(IOM-15),"Page ",ENPG
52 K % S $P(%,"-",(IOM-1))="-" W !,%
53 S ENY=4
54 Q
55ZTSK ;Queue processing for later time
56 K IO("Q") S ZTIO=ION,ZTRTN="CONT^ENEQNX1",ZTDESC="NX Inventory (Bar Code)"
57 F I="ENSTA","ENSTA(","ENSTAL","ENSTAL(","ENCTTI","ENCTID","DT","ENDATE" S ZTSAVE(I)=""
58 D ^%ZTLOAD K ZTSK D HOME^%ZIS
59 G EXIT^ENEQNX2
60HOLD I $E(IOST,1,2)="C-" W !,"Press <RETURN> to continue..." R X:DTIME
61 Q
62DONE ;Delete DATE/TIME OF DATA UPLOAD
63 K DA,DIK S DIK="^PRCT(446.4,"_ENCTID_",2,",DA(1)=ENCTID,DA=ENCTTI
64 D ^DIK
65 K DIK
66 G EXIT^ENEQNX2
67 ;ENEQNX1
Note: See TracBrowser for help on using the repository browser.