source: FOIAVistA/trunk/r/ENGINEERING-EN/ENCTBAR.m@ 1328

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1ENCTBAR ;(WASH ISC)/RGY,DH-Send IRL Code to Bar Code Reader ;2.25.97
2 ;;7.0;ENGINEERING;**9,32,35**;Aug 17, 1993
3 S:'$D(ENCTID) ENCTID="" S:ENCTID]"" ENCTID=$O(^PRCT(446.4,"C",ENCTID,"")) I ENCTID="" S DIC="^PRCT(446.4,",DIC(0)="QEAM" D ^DIC G:Y<0 Q S ENCTID=+Y
4DEV ;
5 N TIME
6 W:'$D(IOP) !!,"OK, enter the device to which the bar code reader is connected.",!
7 D ^%ZIS G:POP Q
8 S ENCTEON=^%ZOSF("EON"),ENCTEOFF=^%ZOSF("EOFF"),ENCTTYPE=^%ZOSF("TYPE-AHEAD"),ENCTOPEN=$G(^%ZIS(2,IOST(0),10)),ENCTCLOS=$G(^%ZIS(2,IOST(0),11))
9 U IO D OFF D WARN^ENCTMES1 R X:DTIME G:X="^" Q
10 D ON S ENCT=+$P(^PRCT(446.4,ENCTID,0),"^",9)_"^2" D SPC^ENCTLAB H 3
11 S TIME=$P($H,",",2)
12 ; for janus readers
13 N ENCTJNUS
14 I $TR($P($G(^PRCT(446.6,+$P($G(^PRCT(446.4,ENCTID,0)),"^",9),0)),"^"),"janus","JANUS")["JANUS" S ENCTJNUS=1
15 F LN=0:0 S LN=$O(^PRCT(446.4,ENCTID,1,LN)) Q:'LN I $D(^(LN,0)) S X=^(0) D LN I X]"" W:$G(ENCTJNUS) $C(15) W X W:$G(ENCTJNUS) $C(22) W ! D:$G(ENCTJNUS)
16 . D OFF W *0
17 . D ON
18 S ENCT=+$P(^PRCT(446.4,ENCTID,0),"^",9)_"^3" D SPC^ENCTLAB
19 F I=1:1:5 R ENX(I):5 Q:'$T
20 D OFF,^%ZISC
21 W !!,"Download time: "_($P($H,",",2)-TIME)_" sec."
22 I $G(ENX(1))=$C(30) W !,"DOWNLOAD SUCCESSFUL, you may now disconnect the bar code reader.",!!
23Q D HOME^%ZIS K LN,POP,ENCTID,ENSTA,DIC,I,J,K,IOP
24 Q
25 ;
26LN ;
27 S X=$P(X,"::") F Y=$L(X):-1:0 Q:$E(X,Y)'=" " S X=$E(X,1,Y-1)
28 I '$D(COL1) S:X["|" X=$P(X,"|")_@$P(X,"|",2)_$P(X,"|",3)
29 Q
30 ;
31ON X ENCTOPEN U IO X ENCTEOFF,ENCTTYPE
32 Q
33 ;
34OFF X ENCTCLOS,ENCTEON U IO(0)
35 Q
36 ;
37COM ;Entry point to allow the alignment of IRL comments in Barcode Program file
38 S DIC="^PRCT(446.4,",DIC(0)="QEAM" D ^DIC G:Y<0 Q2 S ENCTID=+Y
39 S X="At what character do you want comments to begin?^35^^30,35,40,45,50^COM^ENCTMES1" D ^ENCTQUES G:X="^" Q2 S COL1=X
40 F LN=0:0 S LN=$O(^PRCT(446.4,ENCTID,1,LN)) Q:'LN I $D(^(LN,0)) S X=^(0),Y=COL1 D CON S ^PRCT(446.4,ENCTID,1,LN,0)=Y W "."
41 W "... Done"
42Q2 K COL1,LN,ENCTID Q
43CON ;X=IRL TEXT,Y=COLUMN TO START COMMENTS, Can be called from Fileman
44 S COL=Y,(LN1,Y)=X G:X'["::" Q3 D LN F Y=0:0 Q:COL-3<$L(X) S X=X_" "
45 S:$A($E(X,$L(X)))>32 X=X_" " S Y=X_"::"_$P(LN1,"::",2)
46Q3 K LN1,COL Q
47IDENT ; Called by input transform for IDENTIFIER (446.4,.02)
48 I $D(^PRCT(446.4,"C",X)),$O(^(X,""))'=DA S X=$O(^("")) W !,"This IDENTIFIER already exists for ",$S($D(^PRCT(446.4,+X,0)):$P(^(0),"^"),1:X)," !" K X Q
49 I '$D(^DIC(9.4,"C",$E(X,1,$L(X)-2))) W !,"The PACKAGE NAME SPACE '",$E(X,1,$L(X)-2),"' does not exist !" K X
50 Q
51 ;ENCTBAR
Note: See TracBrowser for help on using the repository browser.