Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LRLABELD

LRLABELD.m

Go to the documentation of this file.
  1. LRLABELD ;DALOI/JMC - ZEBRA STRIPE 1X2 label printer ; 6/4/98
  1. ;;5.2;LAB SERVICE;**218**;Sep 27, 1994
  1. ;
  1. EN ; Print 1x2 label formats
  1. ;
  1. N ETX,LRFONT,LRFMT,LRTXT,LRX,LRZ,STX
  1. ;
  1. S LRRB=$G(LRRB)
  1. ;
  1. ; Set specific symbology.
  1. S LRFMT=+$G(LRBAR(+$G(LRAA)))
  1. ;
  1. ; Set up list of tests
  1. S LRTXT=$$LRTXT^LRLABLD(.LRTS,30)
  1. ;
  1. D LH
  1. ;
  1. I 'LRFMT D NOBAR Q
  1. I LRFMT=1 D BAR1 Q
  1. I LRFMT>1 D BAR2
  1. Q
  1. ;
  1. NOBAR ; Print Lab 25mm X 50mm (1 X 2) labels.
  1. ; Plain label, no barcode identifier.
  1. ; Label length = 200 dots (8 dots/mm printhead).
  1. ;
  1. W STX
  1. S LRFONT="^ADN,36,10"
  1. ;
  1. ; Print accession.
  1. D PL(0,5,LRACC,LRFONT)
  1. D FONT
  1. ;
  1. ; Print accession date.
  1. D PL(0,40,LRDAT,LRFONT)
  1. ;
  1. ; Print collection sample.
  1. I LRXL,N-I<LRXL S LRZ=LRTOP
  1. E S LRZ=LRPREF_LRTOP
  1. D PL(0,60,$E(LRZ,1,17),LRFONT)
  1. ;
  1. ; Accession urgency
  1. I $P(LRURGA,"^",2) D
  1. . S LRFONT="^ADN,36,10"
  1. . I $P(LRURGA,"^",2)=2 D
  1. . . ; Set up graphic box.
  1. . . D GB(285,40,15+($L($P(LRURGA,"^"))*12)_",35,35")
  1. . . S LRFONT=LRFONT_"^FR" ; Field reverse.
  1. . D PL(295,45,$P(LRURGA,"^"),LRFONT)
  1. . D FONT
  1. ;
  1. ; Patient name
  1. S LRFONT="^ADN,36,10"
  1. D PL(40,80,$E(PNM,1,21),LRFONT),FONT
  1. ;
  1. ; Print patient identifier.
  1. D PL(40,115,SSN,LRFONT)
  1. ;
  1. ; Print order number.
  1. D PL(0,143,"Order #"_LRCE,LRFONT)
  1. ;
  1. ; Patient location/room-bed number
  1. D PL(200,143,"W:"_LRLLOC_$S($L(LRRB):" B:"_LRRB,1:""),LRFONT)
  1. ;
  1. ; Print test list
  1. S LRFONT="^ADN,36,10"
  1. D PL(0,161,LRTXT,LRFONT)
  1. D FONT
  1. ;
  1. W ETX
  1. Q
  1. ;
  1. BAR1 ; Print Lab 25mm X 50mm (1 X 2) labels.
  1. ; Barcode identifier - use Code 39 with check-digit.
  1. ; Label length = 200 dots (8 dots/mm printhead).
  1. ;
  1. W STX
  1. S LRFONT="^ADN,36,10"
  1. ;
  1. ; Patient name
  1. D PL(75,5,$E(PNM,1,18),LRFONT)
  1. D FONT
  1. ;
  1. ; Accession urgency
  1. I $P(LRURGA,"^",2) D
  1. . S LRFONT="^ADN,36,10"
  1. . ; Set up graphic box.
  1. . I $P(LRURGA,"^",2)=2 D
  1. . . D GB(295,0,15+($L($P(LRURGA,"^"))*12)_",35,35")
  1. . . S LRFONT=LRFONT_"^FR" ; Field reverse.
  1. . D PL(305,5,$P(LRURGA,"^"),LRFONT)
  1. . D FONT
  1. ;
  1. ; Print patient identifier.
  1. D PL(75,40,SSN,LRFONT)
  1. ;
  1. ; Patient location/room-bed number
  1. D PL(230,40,$S($L(LRRB):"B:"_LRRB,1:"W:"_LRLLOC),LRFONT)
  1. ;
  1. ; Print barcode.
  1. S LRX=$S($L(LRBARID)<7:75,$L(LRBARID)>10:80,1:85)
  1. S LRFONT="^BY2,"_$S($L(LRBARID)<7:3,1:2)_",60^"
  1. S LRFONT=LRFONT_"B3N,Y,,N,N"
  1. D PL(LRX,60,LRBARID,LRFONT)
  1. ;
  1. ; Print order number.
  1. D FONT
  1. D PL(75,125,"Order #"_LRCE,LRFONT)
  1. ;
  1. ; Print collection sample.
  1. I LRXL,N-I<LRXL S LRZ=LRTOP
  1. E S LRZ=LRPREF_LRTOP
  1. D PL(75,143,$E(LRZ,1,16),LRFONT)
  1. ;
  1. ; Print test list
  1. S LRFONT="^ADN,36,10"
  1. D PL(75,161,LRTXT,LRFONT)
  1. ;
  1. ; Print accession.
  1. D FONT S LRFONT="^ADN,36,10^FWB"
  1. D PL(0,0,$$CJ^XLFSTR(LRACC,16),LRFONT)
  1. ;
  1. ; Print accession date.
  1. D FONT S LRFONT=LRFONT_"^FWB"
  1. D PL(40,0,$$CJ^XLFSTR(LRDAT,16),LRFONT)
  1. ;
  1. W ETX
  1. Q
  1. ;
  1. BAR2 ; Print Lab 25mm X 50mm (1 X 2) labels.
  1. ; Barcode identifier using specified symbology for accession area.
  1. ; Label length = 200 dots (8 dots/mm printhead).
  1. ;
  1. W STX
  1. S LRFONT="^ADN,36,10"
  1. ;
  1. ; Patient name
  1. D PL(0,5,$E(PNM,1,22),LRFONT),FONT
  1. ;
  1. ; Accession urgency
  1. I $P(LRURGA,"^",2) D
  1. . S LRFONT="^ADN,36,10"
  1. . ; Set up graphic box.
  1. . I $P(LRURGA,"^",2)=2 D
  1. . . D GB(275,0,15+($L($P(LRURGA,"^"))*12)_",35,35")
  1. . . S LRFONT=LRFONT_"^FR" ; Field reverse.
  1. . D PL(285,5,$P(LRURGA,"^"),LRFONT),FONT
  1. ;
  1. ; Print patient identifier.
  1. D PL(0,40,SSN,LRFONT)
  1. ;
  1. ; Patient location/room-bed number
  1. D PL(150,40,"W:"_LRLLOC_$S($L(LRRB):"/"_LRRB,1:""),LRFONT)
  1. ;
  1. ; Print barcode.
  1. S LRX=$S($L(LRBARID)<7:75,LRFMT=4:35,1:20)
  1. S LRFONT="^BY"_$S($L(LRBARID)>10:1,1:2)_","_$S($L(LRBARID)<7:3,1:2)_",60^"
  1. S LRFONT=LRFONT_$S(LRFMT=2:"B3N,N,,N,N",LRFMT=3:"B3N,Y,,N,N",LRFMT=4:"BCN,,N,N",LRFMT=5:"B4N,,N,A",1:"BCN,,N,N")
  1. D PL(LRX,60,LRBARID,LRFONT),FONT
  1. ;
  1. ; Print human-readable ID.
  1. D PL(0,125,LRBARID,LRFONT)
  1. ;
  1. ; Print infection warning if present.
  1. I $L(LRINFW) D
  1. . D GB(135,123,10+($L(LRINFW)*12)_",16,16") ; make box
  1. . S LRFONT=LRFONT_"^FR"
  1. . D PL(140,124,LRINFW,LRFONT)
  1. ;
  1. ; Print accession date.
  1. D PL(0,143,$P(LRDAT," "),LRFONT)
  1. ;
  1. ; Print accession.
  1. D PL(120,143,LRACC,LRFONT)
  1. ;
  1. ; Print order number.
  1. D PL(0,161,"Order #"_LRCE,LRFONT)
  1. ;
  1. ; Print collection sample.
  1. I LRXL,N-I<LRXL S LRZ=LRTOP
  1. E S LRZ=LRPREF_LRTOP
  1. D PL(180,161,$E(LRZ,1,16),LRFONT)
  1. ;
  1. ; Print test list
  1. D PL(0,179,LRTXT,LRFONT)
  1. ;
  1. W ETX
  1. ;
  1. Q
  1. ;
  1. ;
  1. PL(LRX,LRY,LRZ,LRFONT) ; Send print command to printer.
  1. ; Call with LRX = column position (in dots).
  1. ; LRY = row position (in dots).
  1. ; LRZ = text to print.
  1. ; LRFONT = font to use.
  1. ;
  1. W "^FO",+$G(LRX),",",+$G(LRY),$G(LRFONT),"^FD",$G(LRZ),"^FS"
  1. Q
  1. ;
  1. ;
  1. GB(LRGBX,LRGBY,LRGBZ) ; Send print command to printer for graphic box.
  1. ; Call with LRGBX = column position (in dots).
  1. ; LRGBY = row position (in dots).
  1. ; LRGBZ = graphic box to print.
  1. ;
  1. W "^FO",+$G(LRGBX),",",+$G(LRGBY),"^GB",$G(LRGBZ),"^FS"
  1. Q
  1. ;
  1. ;
  1. LH ; Set Label Home ("LH") parameters.
  1. ;
  1. S STX=$C(2),ETX=$C(3)
  1. ;
  1. ; Set Print Orientation ("PO") to Inverted and Label Home ("LH") parameters.
  1. W STX,"^POI^LH450,0",ETX
  1. ;
  1. FONT ; Default font
  1. S LRFONT="^ADN"
  1. Q