source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCTBAR.m@ 619

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1PRCTBAR ;WISC@ALTOONA/RGY-SEND A IRL PROGRAM TO BAR CODE READER ;3.13.98
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 S:'$D(PRCTID) PRCTID="" S:PRCTID]"" PRCTID=$O(^PRCT(446.4,"C",PRCTID,"")) I PRCTID="" S DIC="^PRCT(446.4,",DIC(0)="QEAM",DIC("S")="I $P(^(0),U,12)" D ^DIC K DIC("S") G:Y<0 Q S PRCTID=+Y
5DEV ;
6 N TIME,PRX
7 W:'$D(IOP) !!,"OK, please enter the device to which the bar code reader is connected.",!
8 D ^%ZIS G:POP Q
9 S PRCTEON=^%ZOSF("EON"),PRCTEOFF=^%ZOSF("EOFF"),PRCTTYPE=^%ZOSF("TYPE-AHEAD"),PRCTOPEN=$G(^%ZIS(2,IOST(0),10)),PRCTCLOS=$G(^%ZIS(2,IOST(0),11))
10 U IO D OFF D WARN^PRCTMES1 R X:DTIME G:X="^" Q
11 D ON S PRCT=+$P(^PRCT(446.4,PRCTID,0),"^",9)_"^2" D SPC^PRCTLAB H 3
12 S TIME=$P($H,",",2)
13 ; for janus readers
14 N PRCTJNUS
15 I $TR($P($G(^PRCT(446.6,+$P($G(^PRCT(446.4,PRCTID,0)),"^",9),0)),"^"),"janus","JANUS")["JANUS" S PRCTJNUS=1
16 F LN=0:0 S LN=$O(^PRCT(446.4,PRCTID,1,LN)) Q:'LN I $D(^(LN,0)) S X=^(0) D LN I X]"" W:$G(PRCTJNUS) $C(15) W X W:$G(PRCTJNUS) $C(22) W ! D:$G(PRCTJNUS)
17 . D OFF W *0
18 . D ON
19 S PRCT=+$P(^PRCT(446.4,PRCTID,0),"^",9)_"^3" D SPC^PRCTLAB
20 F I=1:1:5 R PRX(I):5 Q:'$T
21 D OFF,^%ZISC
22 W !!,"Download time: "_($P($H,",",2)-TIME)_" sec."
23 I $G(PRX(1))=$C(30) W !,"DOWNLOAD SUCCESSFUL, you may now disconnect the bar code reader.",!!
24Q ;
25 D HOME^%ZIS K I,LN,%DT,POP,PRCTID,DIC,IOP Q
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 PRCTOPEN U IO X PRCTEOFF,PRCTTYPE
32 Q
33 ;
34OFF X PRCTCLOS,PRCTEON 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 PRCTID=+Y
39 S X="At what character do you want comments to begin at ?^35^^^COM^PRCTMES1^1" D ^PRCTQUES G:X="^" Q2 S COL1=X
40 S X="From line no. ?^1^^^COM1^PRCTMES1^1" D ^PRCTQUES G:X="^" Q2 S LN1=X
41 S X="To line no. ?^"_$S($D(^PRCT(446.4,PRCTID,1,0)):$P(^(0),"^",4),1:"")_"^^^COM2^PRCTMES1^1" D ^PRCTQUES G:X="^" Q2 S LN2=X
42 F LN=LN1-1:0 S LN=$O(^PRCT(446.4,PRCTID,1,LN)) Q:'LN!(LN>LN2) I $D(^(LN,0)) S X=^(0),Y=COL1 D CON S ^PRCT(446.4,PRCTID,1,LN,0)=Y W "."
43 W "... Done"
44Q2 K COL1,LN,PRCTID,TLN,LN1,LN2,LN3 Q
45CON ;X=IRL TEXT,Y=COLUMN TO START COMMENTS, Can be called from Fileman
46 S COL=Y,(LN1,Y)=X G:X'["::" Q3 D LN F Y=0:0 Q:COL-3<$L(X) S X=X_" "
47 S:$A($E(X,$L(X)))>32 X=X_" " S Y=X_"::"_$P(LN1,"::",2)
48Q3 K LN1,COL Q
49IDENT ; Called by input transform for IDENTIFIER (446.4,.02)
50 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
51 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
52 Q
Note: See TracBrowser for help on using the repository browser.