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

LRLABLIO.m

Go to the documentation of this file.
  1. LRLABLIO ;DALOI/TGA/JMC - TESTS LABEL PRINTER ;JUL 06, 2010 3:14 PM
  1. ;;5.2;LAB SERVICE;**1018,1022,1027**;NOV 01, 1997
  1. ;;5.2;LAB SERVICE;**107,161,218**;Sep 27, 1994
  1. ;
  1. ; Reference to File #3.5 supported by DBIA #2469
  1. ;
  1. 1 ;
  1. S U="^" Q:$D(LRLABLIO)
  1. ;
  1. N %ZIS,DIR,DIRUT,DTOUT,DUOUT,IOP,LRLABEL,POP,X,Y
  1. ;
  1. ; Setup handle for user's "HOME" device.
  1. D OPEN^%ZISUTL("LRHOME","HOME")
  1. ;
  1. S %ZIS("B")="LABLABEL"
  1. ;
  1. ; Check if label device assigned to this user's HOME Device file entry.
  1. I $G(IOS) D
  1. . S X=$$GET1^DIQ(3.5,IOS_",",101,"E")
  1. . I $L(X) S %ZIS("B")=X
  1. ;
  1. I %ZIS("B")="LABLABEL",$D(^LAB(69.9,1,3.5,+$G(DUZ(2)),0)) D
  1. . ; Get this division's default printer
  1. . S %ZIS("B")=$P($G(^LAB(69.9,1,3.5,+DUZ(2),0)),U,3)
  1. I %ZIS("B")="" S %ZIS("B")="LABLABEL"
  1. S %ZIS("A")="Print labels on: ",%ZIS="NQ"
  1. ; Setup handle for user's LABEL device.
  1. 2 D OPEN^%ZISUTL("LRLABEL",,.%ZIS)
  1. ; I POP!(IO=IO(0)) D BD Q
  1. ;----- BEGIN IHS/OIT/MKK MOD LR*5.2*1022
  1. ; If OR half of the above IF statement, (IO=IO(0)), is left in,
  1. ; then it is impossible to test printer to the screen.
  1. I POP D BD Q
  1. ;----- END IHS/OIT/MKK MOD LR*5.2*1022
  1. S LRLABLIO=ION_";"_IOST_";"_IOM_";"_IOSL
  1. I $D(IO("Q")) S LRLABLIO("Q")=1
  1. I $E(IOST,1)'="P" D G:Y'=1 2
  1. . N DIR,DIRUT,DTOUT,DUOUT
  1. . D USE^%ZISUTL("LRHOME")
  1. . ;S DIR(0)="YAO",DIR("A",1)="NOT printing on a printer.",DIR("A")="Are you sure?"
  1. . ;----- BEGIN IHS/OIT/MKK MOD LR*5.2*1022
  1. . S DIR(0)="YAO"
  1. . S DIR("A",1)=" NOT printing on a printer."
  1. . S DIR("A",2)=" "
  1. . S DIR("A")=" Is this correct? "
  1. . S DIR("B")="YES"
  1. . ;----- END IHS/OIT/MKK MOD LR*5.2*1022
  1. . D ^DIR
  1. ; Device on another cpu, can't test.
  1. I $D(IOCPU) D Q
  1. . N MSG
  1. . S MSG="Device "_ION_" is on CPU '"_IOCPU_"' - Unable to test"
  1. . D USE^%ZISUTL("LRHOME")
  1. . D EN^DDIOL(MSG,"","!?5")
  1. . D K
  1. ;
  1. 3 I $D(LRLABLIO("Q")) D K Q
  1. D USE^%ZISUTL("LRHOME")
  1. W !
  1. K DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. S DIR(0)="YAO",DIR("A")="Do you wish to test the label printer: ",DIR("B")="NO"
  1. S DIR("?")="Enter 'YES' if you want to test the printer, 'NO' if you do not."
  1. D ^DIR
  1. I $D(DIRUT) D BD Q
  1. I Y<1 G K ; Don't want to test
  1. D OPEN^%ZISUTL("LRLABEL",LRLABLIO)
  1. I POP D G 1
  1. . D USE^%ZISUTL("LRHOME")
  1. . D EN^DDIOL("Device in use - try later","","!")
  1. . K LRLABLIO
  1. N LRAA
  1. S LRAA=0
  1. D LBLTYP^LRLABLD
  1. ;
  1. T ; Print test label
  1. D USE^%ZISUTL("LRHOME")
  1. K DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. W !!,"Using label routine: ",LRLABEL,!
  1. S DIR(0)="E"
  1. S DIR("A",1)="Load and position label stock as appropriate for this printer."
  1. S DIR("A")="Press return when ready"
  1. D ^DIR
  1. I Y'=1 D BD Q
  1. ;
  1. N I,N,PNM,SSN
  1. N LRACC,LRBAR,LRBARID,LRCE,LRDAT,LRINFW,LRLLOC,LRPREF,LRAN,LRRB,LRTOP,LRTS,LRUID,LRURG,LRURG0,LRURGA,LRXL
  1. NEW DOB,SEX ; IHS/OIT/MKK - LR*5.2*1027
  1. ;
  1. ; Set up variables for test label
  1. S PNM="TEST-LABEL-DO-NOT-USE",SSN="000-00-0000P",LRDAT="XX/XX/XX",LRLLOC="LAB",LRRB=1
  1. S LRACC="SITE-TEST-LABEL",LRCE="9999999",LRPREF="SMALL "
  1. S LRTOP="TEST-TUBE",LRTS(1)="Don't-use",LRTS(2)="this-label"
  1. S LRINFW="Patient-info-field",(LRBARID,LRUID)="0000000000",LRAN="000",I=1,N=1,LRXL=0
  1. S (LRURG,LRURG0)=1
  1. S LRURGA=$$URGA^LRLABLD(LRURG0)
  1. ; ----- BEGIN IHS/OIT/MKK MOD LR*5.2*1022
  1. S LRAA=0
  1. S LRAD=0
  1. S PROV="TEST,PROV"
  1. S DOB="XX/XX/XX"
  1. S SEX="X"
  1. ; ----- END IHS/OIT/MKK MOD LR*5.2*1022
  1. ;
  1. D LRBAR^LRLABLD
  1. D USE^%ZISUTL("LRLABEL"),@LRLABEL
  1. D USE^%ZISUTL("LRHOME")
  1. ;
  1. K DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="YAO",DIR("A")="Label OK: ",DIR("B")="YES"
  1. S DIR("?")="Enter 'YES' if label printed correctly, 'NO' if it did not."
  1. D ^DIR
  1. I $D(DIRUT) G BD
  1. I Y=1 G K
  1. ;
  1. K DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. W !
  1. S DIR(0)="YAO",DIR("A")="Test printer again: ",DIR("B")="YES"
  1. S DIR("?")="Enter 'YES' to test label printing, 'NO' to quit testing."
  1. D ^DIR
  1. I $D(DIRUT) G BD
  1. I Y=1 G T
  1. G K
  1. ;
  1. BD ; Bad device - abort, timeout, unsuccessful selection
  1. K LRLABLIO
  1. K ; Close devices
  1. D CLOSE^%ZISUTL("LRLABEL")
  1. D CLOSE^%ZISUTL("LRHOME")
  1. Q