source: FOIAVistA/trunk/r/BAR_CODE_MED_ADMIN-ALPB-PSB/PSBOBLU.m@ 1801

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

initial load of FOIAVistA 6/30/08 version

File size: 5.1 KB
Line 
1PSBOBLU ;BIRMINGHAM/TTH-BUILD CONTROL CODES ;Mar 2004
2 ;;3.0;BAR CODE MED ADMIN;**2**;Mar 2004;Build 22
3 ;;Per VHA Directive 2004-038 (or future revisions regarding same), this routine should not be modified.
4 ;
5 ; Reference/IA
6 ; ^%ZIS(2/3435
7 ; ^%ZIS(2/3884
8 ;
9 N AB,ANS,CODE,NAME,PSBCHO,PSBCODE,PSBTYPE,X,Y
10 ;
11 W !," ***Important Note***"
12 W !,"Before you execute the automatic control code update function, create a ",!,"new terminal type entry in your TERMINAL TYPE file (#3.2) to store the "
13 W !,"new barcode printer control codes. The new terminal type entry needs to ",!,"be connected to the barcode printer device by inserting the new terminal "
14 W !,"type entry name into the SUBTYPE field (#3) for the barcode printer entry ",!,"in your DEVICE file (#3.5). ",!
15 W !,"This option will allow you to automatically copy the BCMA pre-formatted",!,"control codes for the Zebra barcode printer or Intermec barcode printer"
16 W !,"to a device. Please select the appropriate BCMA pre-formatted control",!,"codes and then select the appropriate device.",!
17 ;
18 K DIR,DA,PSBCHO
19 S DIR(0)="SX^1:Zebra Control Codes;2:Intermec Control Codes"
20 S DIR("A")="Select 1 or 2"
21 D ^DIR S PSBCHO=Y
22 I $G(DIRUT) D END Q
23 I PSBCHO["^" D END Q
24 ;
25 D IO
26 ;
27END ;Clean Up Routine Variables
28 K %ZIS,DA,DIC,DIE,DIR,DIROUT,DIRUT,DR,DTOUT,DUOUT,POP,X,Y
29 Q
30 ;
31 ;Select Device ;
32IO S %ZIS("B")="" D ^%ZIS Q:POP
33 Q:$G(DIRUT)
34 ;
35 ;Check system
36 W !!,"Checking system status....",!
37 I '$G(IOST(0)) W "No Terminal Type available." Q
38 I '$D(DUZ(0)) W "No DUZ defined." Q
39 I DUZ(0)'="@" W "FileMan access must be @." Q
40 ;
41 ;Check for existing control entry in Terminal Type file.
42 I $D(^%ZIS(2,IOST(0),55,"B","SB")) W !!,"***Warning*** BCMA CONTROL CODES already defined for this device.",!
43 W !,"Are you sure that you want to copy the ",!,"BCMA CONTROL CODES to device: ",ION,!
44 ;
45WHAT ; Yes to continue No to Quit
46 K DIR,ANS
47 S DIR(0)="Y^O",DIR("B")="NO",DIR("T")=20
48 D ^DIR S ANS=Y
49 Q:ANS["^"
50 Q:ANS'=1
51 W " Copying Control Codes...",!
52 ;
53 I PSBCHO=1 D ZEBCC
54 I PSBCHO=2 D INTMECC
55 W !,"Done..."
56 Q
57 ;
58ZEBCC ;Zebral Barcode Printer Character Control Code auto install
59 ; Use $SELECT function to set proper barcode printer control code variable "CODE"
60 ;
61 I '$D(^%ZIS(2,IOST(0),55,"B","SL")) S AB="SL",NAME="Start Label",CODE="W !,""^XA"",!,""^LH0,0^FS""" D FILE
62 I '$D(^%ZIS(2,IOST(0),55,"B","EL")) S AB="EL",NAME="End Label",CODE="W !,""^XZ""" D FILE
63 I '$D(^%ZIS(2,IOST(0),55,"B","ST")) S AB="ST",NAME="Start Text",CODE="W !,""^FO""_PSBTYPE_""^A0N,30,20^CI13^FR^FD""_TEXT_""^FS""" D FILE
64 I '$D(^%ZIS(2,IOST(0),55,"B","SB")) S AB="SB",NAME="Start Barcode" D D FILE
65 .S CODE="S PSBTYPE=$S(PSBSYM=""I25"":""B2N"",PSBSYM=""128"":""BCN"",1:""B3N"")"
66 .S CODE=CODE_" S:PSBSYM="""" PSBBAR=""NO-CODE"" W !,""^BY2,3.0,80^FO20,100^""_PSBTYPE_"",N,80,Y,N^FR^FD""_PSBBAR_""^FS"""
67 I '$D(^%ZIS(2,IOST(0),55,"B","STF")) S AB="STF",NAME="Start Text Field" D D FILE
68 .S CODE="S PSBTYPE=$S(PSBTLE=""PSBDRUG"":""20,25"",PSBTLE=""PSBDOSE"":""20,60"",PSBTLE=""PSBNAME"":""350,60"",PSBTLE=""PSBWARD"":""350,90"",PSBTLE=""PSBLOT"":""350,120"","
69 .S CODE=CODE_"PSBTLE=""PSBEXP"":""350,150"",PSBTLE=""PSBMFG"":""500,150"",PSBTLE=""PSBFCB"":""350,180"",1:""0,0"")"
70 Q
71 ;
72INTMECC ;Intermec Barcode Printer Character Control Code auto install
73 I '$D(^%ZIS(2,IOST(0),55,"B","SL")) S AB="SL",NAME="Start Label",CODE="W ""<STX>R;<EXT>"",!,""<STX><ESC>E2<EXT>"",!" D FILE
74 I '$D(^%ZIS(2,IOST(0),55,"B","EL")) S AB="EL",NAME="End Label",CODE="W ""<STX><ETB><ETX>"",!" D FILE
75 I '$D(^%ZIS(2,IOST(0),55,"B","SB")) S AB="SB",NAME="Start Barcode",CODE="W ""<STX>""_TEXT_""<ETX>"",!" D FILE
76 I '$D(^%ZIS(2,IOST(0),55,"B","ST")) S AB="ST",NAME="Start Text",CODE="W ""<STX>""_TEXT_""<CR><ETX>"",!" D FILE
77 I '$D(^%ZIS(2,IOST(0),55,"B","EBF")) S AB="EBF",NAME="End Barcode",CODE="W ""<STX>H8;o50,40;f3;c0;h1;w1;d0,80;<ETX>"",!" D FILE
78 I '$D(^%ZIS(2,IOST(0),55,"B","FI")) S AB="FI",NAME="Format Initialization",CODE="W ""<STX><ESC>C<ETX>"",!,""<STX><ESC>P<ETX>"",!,""<STX>E2;F2<ESC><ETX>"",!" D FILE
79 ;
80 I '$D(^%ZIS(2,IOST(0),55,"B","SBF")) S AB="SBF",NAME="Start Barcode Field" D D FILE
81 .S CODE="S PSBTYPE=$S(PSBSYM=""I25"":""c2,0"",PSBSYM=""128"":""c6,0"",1:""c0,0"")"
82 .S CODE=CODE_" W ""<STX>B8;o85,40;f3;""_PSBTYPE_"";h50;w1;i1;do,25;p@;<ETX>"",!,""<STX>I8;h1;w1;<ETX>"",!"
83 ;
84 I '$D(^%ZIS(2,IOST(0),55,"B","FI1")) S AB="FI1",NAME="Format Initialization 1" D D FILE
85 .S CODE="W ""<STX>H7;o30,260;f3;c0;h1;w1;d0,80;<ETX>"",!,""<STX>H6;o50,440;f3;c0;h1;w1;d0,20;<ETX>"",!,"
86 .S CODE=CODE_"""<STX>H5;o50,260;f3;c0;h1;w1;d0,20;<ETX>"",!,""<STX>H4;o70,260;f3;c0;h1;w1;d0,35;<ETX>"",!"
87 ;
88 I '$D(^%ZIS(2,IOST(0),55,"B","FI2")) S AB="FI2",NAME="Format Initialization 2" D D FILE
89 .S CODE="W ""<STX>H3;o90,260;f3;c0;h1;w1;d0,35;<ETX>"",!,""<STX>H2;o110,260;f3;c0;h1;w1;d0,35;<ETX>"",!,"
90 .S CODE=CODE_"""<STX>H1;o110,40;f3;c0;h1;w1;d0,27;<ETX>"",!,""<STX>H0;o130,40;f3;c0;h1;w1;d0,60;<ETX>"",!"
91 Q
92 ;
93FILE ;Set local array for Intermec Barcode Printer Default Settings
94 ;
95 K DD,DIC,DIE,DO
96 S DIC(0)="L",DA(1)=IOST(0),X=AB,DIC="^%ZIS(2,"_DA(1)_",55," D FILE^DICN K DD,DO
97 S DIE=DIC,DA=+Y,DA(1)=IOST(0)
98 S DR=".01////"_AB_";1////"_NAME_";2////^S X=CODE" D ^DIE
99 Q
Note: See TracBrowser for help on using the repository browser.