source: FOIAVistA/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRPI11.m@ 1389

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

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1RMPRPI11 ;HIN/ODJ-PRINT BAR CODE LABELS ;10/8/02 13:11
2 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
3 ;
4 Q
5 ;
6 ;***** SELP - Prompt for Bar Code printer
7SELP(RMPRBCP,RMPREXC,RMPRQ,RMPRIOP) ;
8 N POP
9START S %ZIS("A")="Select Bar Code Printer: "
10 S %ZIS("B")=""
11 S %ZIS="QN" K IOP
12 D ^%ZIS
13 S RMPRQ=0
14 S RMPREXC=""
15 I POP S RMPREXC="P" G SELPX
16 I '$D(IO("Q")) D G SELPX
17 . S RMPRBCP=$G(IOST)
18 . S:RMPRBCP="" RMPREXC="^"
19 . S RMPRIOP=$G(ION)
20 . Q
21 ;I '$D(IO("Q")) U IO D TEST G SELPX
22 ;K IO("Q") S ZTDESC="SLAVE PRINT TEST"
23 ;S ZTRTN="TEST^RMPRPI11",ZTIO=ION
24 ;D ^%ZTLOAD W:$D(ZTSK) !,"REQUEST QUEUED!",! H 1 G SELPX
25SELPX Q
26TEST S IOP=ION,%ZIS="" D ^%ZIS
27 W !!,"TESTING SLAVE DEVICE",!!
28 W @IOF
29 D ^%ZISC
30 Q
31 ;
32 ; Print bar code for printer using ZPLII command set (ZEBRAS)
33 ; applies to Z4000 and all Zebra printers.
34ZPLII(RMPRBARC,RMPRITXT,RMPRNCOP) ;
35 N RMPRUNIT,RMPRLTYP,RMPRLWID,RMPRLHGT,RMPRMMIN
36 N RMPRXDIM,RMPRQUIZ,RMPRHCPC,RMPRBLEN,RMPRDT,RMPRBHGT,RMPRCRLF
37 N RMPRLEFT,RMPRDOWN,RMPRLCNT
38 S RMPRUNIT="MM" ; use mm units
39 S RMPRLTYP="" ; <not used yet>
40 S RMPRLWID=75 ; Lable width 75mm
41 S RMPRLHGT=25 ; Label height 25mm
42 ;if printer resolution not defined in terminal type file,
43 ;default to 8 dpm
44 I '$G(RMPRLRES) S RMPRLRES=8 ; 8 for 203dpi & 12 for 300dpi
45 S RMPRMMIN=25.333 ; mm to the inch conversion factor
46 I '+$G(RMPRNCOP) S RMPRNCOP=1
47 ;
48 ; Set the X dimension in dots (width of narrow bar)
49 ; minimum recommended X dimension is .25mm (7.5/1000th inch)
50 I RMPRUNIT="MM" D
51 . S RMPRXDIM=RMPRLRES*.25
52 . Q
53 I RMPRUNIT="IN" D
54 . S RMPRXDIM=RMPRLRES*.0075
55 . Q
56 S:RMPRXDIM'=(RMPRXDIM\1) RMPRXDIM=.5+(RMPRXDIM\1)
57 ;
58 ; Calculate the quiet zone in dots
59 ; this should be greater of 10 X dimensions or 2.5333 mm (.1 inch)
60 I RMPRUNIT="MM" D
61 . S RMPRQUIZ=((2.5333*RMPRLRES)\1)+1
62 . S:RMPRQUIZ<(10*RMPRXDIM) RMPRQUIZ=10*RMPRXDIM
63 . Q
64 I RMPRUNIT="IN" D
65 . S RMPRQUIZ=((.1*RMPRLRES)\1)+1
66 . S:RMPRQUIZ<(10*RMPRXDIM) RMPRQUIZ=10*RMPRXDIM
67 . Q
68 ;
69 ; Calculate length (in dots) of symbol to be printed
70 ; Symbol is [HCPCS code][-][Date and Time]
71 ; [HCPCS code] and [-] will be alphanumeric
72 ; [Date and Time] will be numeric using code C
73 S RMPRHCPC=$P(RMPRBARC,"-",1)
74 S RMPRBLEN=((11*($L(RMPRHCPC)+5))+35)*RMPRXDIM
75 S RMPRDT=$P(RMPRBARC,"-",2)
76 S RMPRBLEN=RMPRBLEN+(((5.5*($L(RMPRDT)))+35)*RMPRXDIM)
77 ;
78 ; Calculate bar height in dots
79 ; this should be .15 times symbol length or .25 inches
80 I RMPRUNIT="MM" D
81 . S RMPRBHGT=((6.33325*RMPRLRES)\1)+2
82 . S:RMPRBHGT<(((.15*RMPRBLEN)\1)+1) RMPRBHGT=2+((.15*RMPRBLEN)\1)
83 . Q
84 I RMPRUNIT="IN" D
85 . S RMPRBHGT=((.25*RMPRLRES)\1)+2
86 . S:RMPRBHGT<(((.15*RMPRBLEN)\1)+1) RMPRBHGT=2+((.15*RMPRBLEN)\1)
87 . Q
88 ;
89 ; *** Print the symbol ***
90 S RMPRCRLF=$C(13)_$C(10)
91 S RMPRLCNT=0
92 I '$D(RMPR("NAME")),$D(RMPRITXT("NAME")) S RMPR("NAME")=RMPRITXT("NAME")
93 I '$D(RMPR("NAME")),$D(RMPRSTN("SITE NAME")) S RMPR("NAME")=RMPRSTN("SITE NAME")
94 I '$D(RMPR("NAME")) S RMPR("NAME")=""
95ZPLIIP W "^XA",RMPRCRLF
96 W "^LH"_RMPRQUIZ_","_RMPRQUIZ,RMPRCRLF
97 W "^BY"_RMPRXDIM_",3.0,"_RMPRBHGT,RMPRCRLF
98 S RMPRLEFT=RMPRQUIZ+5
99 S RMPRDOWN=(RMPRQUIZ\2)-10
100 ;
101 ; the BAR CODE
102 W "^FO"_RMPRLEFT_","_RMPRDOWN_","_"^BCN,"_RMPRBHGT_",Y,N,N,A^FD"_RMPRBARC_"^FS",RMPRCRLF
103 S RMPRDOWN=RMPRDOWN+((1.33*RMPRBHGT)\1)
104 ;
105 ; Description fields
106 S RMPRIND=RMPRLEFT+20
107 S RMPRITXT("DT")=$E(RMPRITXT("DATE"),1,6)_$E(RMPRITXT("DATE"),9,10)
108 W "^FO"_RMPRLEFT_","_RMPRDOWN,RMPRCRLF
109 W:RMPRLRES=12 "^AE,^FD"_$E(RMPRITXT("ITEM")_$J("",12),1,12)_$E("$ "_$J(RMPRITXT("UNIT PRICE"),0,2)_$J("",10),1,10)_" "_RMPRITXT("DT")_"^FS",RMPRCRLF
110 W:RMPRLRES=8 "^AF,^FD"_$E(RMPRITXT("ITEM")_$J("",12),1,12)_$E("$ "_$J(RMPRITXT("UNIT PRICE"),0,2)_$J("",10),1,10)_" "_RMPRITXT("DT")_"^FS",RMPRCRLF
111 S RMPRDOWN=RMPRDOWN+14+(RMPRQUIZ\1.5)
112 W "^FO"_RMPRLEFT_","_RMPRDOWN,RMPRCRLF
113 W:RMPRLRES=12 "^AF^FD"_RMPRITXT("ITEM DESC")_"^FS",RMPRCRLF
114 W:RMPRLRES=8 "^AD^FD"_RMPRITXT("ITEM DESC")_"^FS",RMPRCRLF
115 S RMPRDOWN=RMPRDOWN+10+(RMPRQUIZ\1.5)
116 W "^FO"_RMPRLEFT_","_RMPRDOWN,RMPRCRLF
117 W "^AF^FD"_RMPRITXT("MASTER DESC")_"^FS",RMPRCRLF
118 S RMPRDOWN=RMPRDOWN+8+(RMPRQUIZ\1.5)
119 W "^FO"_RMPRLEFT_","_RMPRDOWN,RMPRCRLF
120 W:RMPRLRES=12 "^AF^FD"_$E(RMPRITXT("VENDOR"),1,18)_" # "_$E(RMPRITXT("LOCATION"),1,18)_" # "_$E(RMPR("NAME"),1,15)_"^FS",RMPRCRLF
121 W:RMPRLRES=8 "^AD^FD"_$E(RMPRITXT("VENDOR"),1,18)_" # "_$E(RMPRITXT("LOCATION"),1,18)_" # "_$E(RMPR("NAME"),1,15)_"^FS",RMPRCRLF
122 ;W:RMPRLRES=8 "^AD^FD"_RMPRITXT("VENDOR")_"^FS",RMPRCRLF
123 ;
124 ; finish
125 W "^XZ",RMPRCRLF
126 S RMPRLCNT=1+RMPRLCNT
127 I RMPRLCNT<RMPRNCOP G ZPLIIP
128ZPLIIX Q
Note: See TracBrowser for help on using the repository browser.