source: FOIAVistA/tag/r/ENGINEERING-EN/ENLBL3.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1ENLBL3 ;(WASH ISC)/DH-Print Bar Coded Equipment Labels ;10.10.97
2 ;;7.0;ENGINEERING;**12,35,45**;Aug 17, 1993
3 ;
4SD ;Single device
5 S ENERR=0 D STA G:ENEQSTA="^" QUIT
6 N DIC,DIE,DR,DA,FR,TO,X,X1,X2,I,J,K,I1
7 N TAG D EN1^ENLBL9 I '$D(ENEQIO),%<0 G EXIT1^ENLBL8
8SD1 D GETEQ^ENUTL
9 I Y'>0 S TAG=$S('$D(ENEQIO):"EXIT1",$D(IO(1,ENEQIO)):"EXIT",1:"EXIT1")_"^ENLBL8" G @TAG
10 S DA=+Y
11 S %ZIS("A")="Select BAR CODE PRINTER: ",%ZIS("B")=$S($D(ENBCIO):ENBCION,1:""),%ZIS="Q" I $D(ENEQIO),ENEQIO=IO S %ZIS=""
12 K IO("Q") D ^%ZIS K %ZIS I POP S TAG=$S('$D(ENEQIO):"EXIT1",$D(IO(1,ENEQIO)):"EXIT",1:"EXIT1")_"^ENLBL8" G @TAG
13 I $D(ENBCIO),ENBCIO'=IO D
14 . N IO,IOSL,IOF,ION,IOST S IO=ENBCIO D ^%ZISC Q
15 S ENBCIO=IO,ENBCIOSL=IOSL,ENBCIOF=IOF,ENBCION=ION,ENBCIOST=IOST,ENBCIOST(0)=IOST(0),ENBCIOS=IOS S:$D(IO("S")) ENBCIO("S")=IO("S")
16 I $D(IO("Q")) D G SD1
17 . S:$D(ENEQIO) ENEQY(0)=ENEQY,ENEQPG(0)=ENEQPG,(ENEQY,ENEQPG)=0
18 . S ZTIO=ION,ZTRTN="SD2^ENLBL3",ZTSAVE("DA")="",ZTSAVE("EN*")="",ZTDESC="Single Equipment Bar Code Label" D ^%ZTLOAD K ZTSK,IO("Q") D ^%ZISC
19 . S:$D(ENEQIO) ENEQY=ENEQY(0),ENEQPG=ENEQPG(0)
20SD2 S ENEQBY="Single Label(s)" I $D(ENEQIO) D OPEN^ENLBL9 I POP G:$D(ZTQUEUED) REQ^ENLBL8 W !,*7,"Companion Printer UNAVAILABLE." D HOLD G EXIT1^ENLBL8
21 U ENBCIO D FORMAT^ENLBL7
22 D NXPRT^ENLBL7,BCDT^ENLBL7 D:$D(ENEQIO) CPRNT^ENLBL9
23 G:$D(ZTQUEUED) EXIT^ENLBL8
24 D HOME^%ZIS U IO G SD1
25 ;
26CAT ;Complete Equip Category
27 S ENERR=0 D STA G:ENEQSTA="^" QUIT
28 N DIC,DIE,DA,DR,FR,TO,X,X1,X2,I,J,K,I1
29 D EN^ENLBL9 G:$D(DIRUT) EXIT1^ENLBL8
30 I '$D(ENEQIO),%<0 G EXIT1^ENLBL8
31 K ENEQDA
32CAT1 S DIC="^ENG(6911,",DIC(0)="AEMQ" D ^DIC
33 I Y'>0 G EXIT1^ENLBL8
34 S ENEQDA=+Y
35 S ENLOCSRT=1
36CAT11 W !,"Sort labels by LOCATION" S %=1 D YN^DICN G:%<0 EXIT1^ENLBL8 I %=0 W !,"Say YES to sort labels by BUILDING, then by ROOM within BUILDING.",!,"If you say NO, labels will be sorted by EQUIPMENT ID#." G CAT11
37 S:%=2 ENLOCSRT=0
38 S %ZIS("A")="Select BARCODE PRINTER: ",%ZIS("B")="",%ZIS="Q" I $D(ENEQIO),ENEQIO=IO S %ZIS=""
39 K IO("Q") D ^%ZIS K %ZIS G:POP EXIT1^ENLBL8
40 S ENBCIO=IO,ENBCIOSL=IOSL,ENBCIOF=IOF,ENBCION=ION,ENBCIOST=IOST,ENBCIOST(0)=IOST(0),ENBCIOS=IOS S:$D(IO("S")) ENBCIO("S")=IO("S")
41 I $D(IO("Q")) S ZTIO=ION,ZTRTN="CAT2^ENLBL3",ZTSAVE("EN*")="",ZTDESC="Barcode Labels by CATEGORY" D ^%ZTLOAD K ZTSK,IO("Q") G EXIT1^ENLBL8
42CAT2 G:'$D(^ENG(6911,ENEQDA,0)) EXIT1^ENLBL8 S ENEQBY="Equip Cat: "_$P(^ENG(6911,ENEQDA,0),U,1)
43 I $D(ENEQIO) D OPEN^ENLBL9 I POP G:$D(ZTQUEUED) REQ^ENLBL8 W !,*7,"Companion Printer UNAVAILABLE." D HOLD G EXIT1^ENLBL8
44 K ^TMP($J) S I1=0 F J1=0:0 S I1=$O(^ENG(6914,"G",ENEQDA,I1)) Q:I1'>0 S DA=I1 D STATCK I DA]"" D SORT D:'(DA#10) DOTS
45 I $D(^TMP($J)) U ENBCIO D FORMAT^ENLBL7 S I1="" F J1=0:0 S I1=$O(^TMP($J,I1)) Q:I1="" F DA=0:0 S DA=$O(^TMP($J,I1,DA)) Q:DA'>0 U ENBCIO D NXPRT^ENLBL7 D:$D(ENEQIO) CPRNT^ENLBL9 D:'(DA#10) DOTS D BCDT^ENLBL7
46 G EXIT^ENLBL8
47 ;
48SORT I 'ENLOCSRT S ^TMP($J,DA,DA)="" Q
49 S X=$S($D(^ENG(6914,DA,3)):$P(^(3),U,5),1:0) S:X="" X=0
50 G:X=0 SORT1
51 I X=+X,$D(^ENG("SP",X,0)) D G SORT1
52 . I $D(^ENG("SP",X,9)) S X(0)=$P(^(9),U) I X(0)]"" S X=X(0) Q
53 . S X=$P(^ENG("SP",X,0),U) F I=1,2,3 S X(I)=$P(X,"-",I)
54 . S X=X(3)_":"_X(2)_":"_X(1)
55 F I=1,2,3 S X(I)=$P(X,"-",I)
56 S X=X(3)_":"_X(2)_":"_X(1)
57SORT1 S ^TMP($J,X,DA)=""
58 Q
59 ;
60STATCK S:'$D(^ENG(6914,DA,0)) DA="" I DA]"" S ENA=$G(^(3)) D:ENA]"" Q
61 . I $P(ENA,U)>3,$P(ENA,U)<6 S DA="" Q
62 . I $G(ENEQREP),$P(ENA,U,10)]"" S DA=""
63 ;
64STA I $D(^DIC(6910,1,0)),$P(^(0),U,2)]"" S ENEQSTA=$P(^(0),U,2)
65 E S ENEQSTA="^"
66 I ENEQSTA'="^" S ENEQSTAN="DVAMC "_$P(^DIC(6910,1,0),U),ENEQLM=(135+(4*$L(ENEQSTAN)))
67 Q
68 ;
69DOTS ;Act indic
70 Q:$D(ZTQUEUED)
71 I '$D(ENEQIO) U IO(0) W "." Q
72 I ENEQIO'=IO(0) U IO(0) W "."
73 Q
74 ;
75HOLD W !,"Press <RETURN> to continue..." R X:DTIME
76 Q
77 ;
78QUIT I $D(ENEQSTA),ENEQSTA="^" W !!,"Can't seem to find your Station Number. Please check File 6910 (ENG INIT",!,"PARAMETERS).",*7
79 G EXIT1^ENLBL8
80 ;ENLBL3
Note: See TracBrowser for help on using the repository browser.