LA7SBCR ;DALOI/JMC - Shipping Barcode Reader Utility ; 7 Feb 1997
;;5.2;AUTOMATED LAB INSTRUMENTS;**27,46**;Sep 27, 1994
Q
;
BAR(Y) ; Ask user if utilizing a barcode reader
; Returns -1 = user aborted
; 0 = No
; 1 = Yes
;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
S DIR(0)="Y0",DIR("A")="Are you using a barcode reader",DIR("B")="YES"
D ^DIR
I $G(DIRUT) Q -1
Q Y
;
RD(LA7SDP,LA7CASE) ; Read input from barcode reader.
; Input
; LA7SDP=array containing default prompt to display
; LA7CASE=0 return scanned text as barcoded
; =1 return scanned text in upper case.
; =2 return scanned text in lower case.
;
; Returns
; Y=1^barcode value.
; =0 if user quits/timeouts
; =-1 if invalid read
;
N DIR,DIRUT,DTOUT,DUOUT,I,LA7Y,X,Y
I $G(LA7SDP)="" S LA7SDP="Scan barcode"
S LA7CASE=+$G(LA7CASE)
S I=0
F S I=$O(LA7SDP(I)) Q:'I S DIR("A",I)=LA7SDP(I)
S DIR("A")=LA7SDP
S DIR(0)="FUO^3:245"
D ^DIR
I $D(DIRUT) Q 0 ; User quit
I Y="" Q -1 ; Invalid read
S LA7Y=Y
I LA7CASE=1 S LA7Y=$$UP^XLFSTR(LA7Y)
I LA7CASE=2 S LA7Y=$$LOW^XLFSTR(LA7Y)
Q "1^"_LA7Y
;
DT(X) ; Validate date/time
N %DT,Y
S %DT="ST" D ^%DT
I Y<1 S Y=""
Q Y
LA7SBCR ;DALOI/JMC - Shipping Barcode Reader Utility ; 7 Feb 1997
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;**27,46**;Sep 27, 1994
+2 QUIT
+3 ;
BAR(Y) ; Ask user if utilizing a barcode reader
+1 ; Returns -1 = user aborted
+2 ; 0 = No
+3 ; 1 = Yes
+4 ;
+5 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+6 SET DIR(0)="Y0"
SET DIR("A")="Are you using a barcode reader"
SET DIR("B")="YES"
+7 DO ^DIR
+8 IF $GET(DIRUT)
QUIT -1
+9 QUIT Y
+10 ;
RD(LA7SDP,LA7CASE) ; Read input from barcode reader.
+1 ; Input
+2 ; LA7SDP=array containing default prompt to display
+3 ; LA7CASE=0 return scanned text as barcoded
+4 ; =1 return scanned text in upper case.
+5 ; =2 return scanned text in lower case.
+6 ;
+7 ; Returns
+8 ; Y=1^barcode value.
+9 ; =0 if user quits/timeouts
+10 ; =-1 if invalid read
+11 ;
+12 NEW DIR,DIRUT,DTOUT,DUOUT,I,LA7Y,X,Y
+13 IF $GET(LA7SDP)=""
SET LA7SDP="Scan barcode"
+14 SET LA7CASE=+$GET(LA7CASE)
+15 SET I=0
+16 FOR
SET I=$ORDER(LA7SDP(I))
IF 'I
QUIT
SET DIR("A",I)=LA7SDP(I)
+17 SET DIR("A")=LA7SDP
+18 SET DIR(0)="FUO^3:245"
+19 DO ^DIR
+20 ; User quit
IF $DATA(DIRUT)
QUIT 0
+21 ; Invalid read
IF Y=""
QUIT -1
+22 SET LA7Y=Y
+23 IF LA7CASE=1
SET LA7Y=$$UP^XLFSTR(LA7Y)
+24 IF LA7CASE=2
SET LA7Y=$$LOW^XLFSTR(LA7Y)
+25 QUIT "1^"_LA7Y
+26 ;
DT(X) ; Validate date/time
+1 NEW %DT,Y
+2 SET %DT="ST"
DO ^%DT
+3 IF Y<1
SET Y=""
+4 QUIT Y