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

LRLABELA.m

Go to the documentation of this file.
  1. LRLABELA ;DALOI/JMC - INTERMEC 4100 1X2 LABEL PRINT BARCODE/PLAIN ;10/20/93 10:16
  1. ;;5.2;LAB SERVICE;**161,218**;Sep 27, 1994
  1. ;This routine is used in conjunction with the Intermec program routine
  1. ;LRBARA to print a two label accession label for accession areas which
  1. ;have their BAR CODE PRINT field set to YES
  1. ;
  1. EN ;
  1. N CR,ETX,J,LRFMT,LRTXT,STX,X
  1. S LRRB=$G(LRRB)
  1. ;
  1. ; Set specific symbology.
  1. S LRFMT=3+$G(LRBAR(+$G(LRAA)))
  1. ;
  1. S LRTXT=$$LRTXT^LRLABLD(.LRTS,$S(LRFMT=4:25,1:32))
  1. ;
  1. I LRFMT=3 D PRT
  1. I LRFMT=4 D BAR
  1. I LRFMT>4 D BAR1
  1. ;
  1. D TERM
  1. Q
  1. ;
  1. PRT ;plain label..no barcode
  1. ;
  1. D INIT(LRFMT)
  1. ;
  1. W STX,LRTXT,CR,ETX
  1. W STX,"Order #",LRCE,CR,"W:"_$E(LRLLOC,1,9)_" B:"_LRRB,CR,ETX
  1. W STX,SSN,CR,PNM,CR,LRTOP,CR,LRDAT,CR,LRACC,CR,ETX
  1. ;
  1. ; Determine if accession urgency printed normally or in reverse letters
  1. I $P(LRURGA,"^",2),$L($P(LRURGA,"^")) W STX,$P(LRURGA,"^"),CR,ETX
  1. E W STX,$C(10),CR,ETX
  1. ;
  1. Q
  1. ;
  1. BAR ;barcode label..accession number barcoded (old style)
  1. ;
  1. D INIT(LRFMT)
  1. ;
  1. W STX,LRTXT,CR,ETX
  1. W STX,LRTOP,CR,"Order #",LRCE,CR,LRACC,CR,LRDAT,CR,SSN,CR,ETX
  1. W STX,$S($L(LRRB):"B:"_LRRB,1:"W:"_$E(LRLLOC,1,9)),CR,ETX
  1. W STX,$E(PNM,1,27),CR,ETX
  1. ;
  1. ; Determine if accession urgency printed normally or in reverse letters
  1. I $G(LRURG0)=1 W STX,"STAT",CR,ETX
  1. E W STX,LF,CR,ETX
  1. ;
  1. W STX,LRBARID,CR,ETX
  1. ;
  1. Q
  1. ;
  1. ;
  1. BAR1 ; Barcode label (handles multiple barcode symbologies).
  1. ;
  1. D INIT(5)
  1. ;
  1. W STX,PNM,CR,SSN,CR,"W:"_LRLLOC,$S($L(LRRB):"/"_LRRB,1:""),CR,ETX
  1. ;
  1. ; Human-readable ID
  1. W STX,LRBARID,CR,ETX
  1. ;
  1. ; Patient info
  1. W STX,$S($G(LRINFW)="":LF,1:LRINFW),CR,ETX
  1. ;
  1. ; Order date/accession
  1. W STX,LRDAT,CR,LRACC,CR,ETX
  1. ;
  1. ; Order #/specimen top
  1. W STX,"Order #",LRCE,CR,LRTOP,CR,ETX
  1. ;
  1. ; Test list
  1. W STX,LRTXT,CR,ETX
  1. ;
  1. D URGENCY
  1. ;
  1. ; Bar code specimen identifier
  1. W STX
  1. F J=5:1:7 D
  1. . I J'=LRFMT W LF,CR Q ; Skip symbology.
  1. . W LRBARID,CR
  1. W ETX
  1. ;
  1. Q
  1. ;
  1. INIT(LRFMT) ; Initialize label
  1. ; Call with LRFMT = format to access on printer
  1. ; Called above, LRLABELB, LRLABELC, LRBLJLA1
  1. ;
  1. S STX=$C(2),ETX=$C(3),LF=$C(10),CR=$C(13)
  1. S X=0 X ^%ZOSF("RM")
  1. ;
  1. ; Put printer in advanced mode.
  1. W STX,$C(27),"C",ETX
  1. W STX,"R",ETX
  1. W STX,$C(27),"E",LRFMT,$C(24),ETX
  1. ;
  1. Q
  1. ;
  1. TERM ; Terminate and print label
  1. ; Called above, LRLABELB, LRLABELC, LRBLJLA1
  1. ;
  1. W STX,$C(23,15),"S30",$C(12),ETX
  1. ;
  1. Q
  1. ;
  1. URGENCY ; Print urgency based on settings.
  1. ; Called above, LRLABELB, LRLABELC
  1. ;
  1. I $P(LRURGA,"^",2),$L($P(LRURGA,"^")) D Q
  1. . ; Reverse field
  1. . I $P(LRURGA,"^",2)=2 W STX,LF,CR,$P(LRURGA,"^"),CR,ETX Q
  1. . ; Normal field
  1. . W STX,$P(LRURGA,"^"),CR,LF,CR,ETX
  1. ;
  1. ; No urgency
  1. W STX,LF,CR,LF,CR,ETX
  1. ;
  1. Q