- LA7SBCR3 ;DALISC/JMC - Shipping Barcode Reader Utility ; 7 Feb 1997
- ;;5.2;LAB MESSAGING;**27**;Sep 27, 1994
- Q
- ;
- TEST(LA7,LA7PROM,LA7BAR) ; Setup test/specimen info.
- ; Input:
- ; LA7=array to return values
- ; LA7PROM=prompt to display to user
- ; LA7BAR=0/1 using barcode reader
- ;
- ; Returns array LA7()
- ;
- ; If successful ERROR=0
- ; NLT=National Laboratory Test code
- ; SPECIMEN=HL7 specimen code
- ; UID=Sender's Unique Identifier
- ;
- ; unsuccessful ERROR=>0
- ;
- N LA7X,X,Y
- ; Initialize array.
- F Y="ERROR","NLT","SPECIMEN","UID" S LA7(Y)=""
- S LA7PROM=$G(LA7PROM,"Test")
- I LA7BAR D
- . S Y=$$RD^LA7SBCR(LA7PROM)
- . I Y<1 S LA7("ERROR")="1^User timeout/abort" Q
- . S Y=$$UPCASE^LRAFUNC(Y)
- . S LA7=$P(Y,"STX^",2),LA7=$P(LA7,"^ETX",1)
- . I LA7="" S LA7("ERROR")="2^Incorrect barcode format" Q
- . S $P(LA7("UID"),"^",3)=$P(LA7,"^",1)
- . S $P(LA7("NLT"),"^",3)=$P(LA7,"^",2)
- . S $P(LA7("SPECIMEN"),"^",3)=$P(LA7,"^",3)
- . S LA7("ERROR")=0
- Q
- LA7SBCR3 ;DALISC/JMC - Shipping Barcode Reader Utility ; 7 Feb 1997
- +1 ;;5.2;LAB MESSAGING;**27**;Sep 27, 1994
- +2 QUIT
- +3 ;
- TEST(LA7,LA7PROM,LA7BAR) ; Setup test/specimen info.
- +1 ; Input:
- +2 ; LA7=array to return values
- +3 ; LA7PROM=prompt to display to user
- +4 ; LA7BAR=0/1 using barcode reader
- +5 ;
- +6 ; Returns array LA7()
- +7 ;
- +8 ; If successful ERROR=0
- +9 ; NLT=National Laboratory Test code
- +10 ; SPECIMEN=HL7 specimen code
- +11 ; UID=Sender's Unique Identifier
- +12 ;
- +13 ; unsuccessful ERROR=>0
- +14 ;
- +15 NEW LA7X,X,Y
- +16 ; Initialize array.
- +17 FOR Y="ERROR","NLT","SPECIMEN","UID"
- SET LA7(Y)=""
- +18 SET LA7PROM=$GET(LA7PROM,"Test")
- +19 IF LA7BAR
- Begin DoDot:1
- +20 SET Y=$$RD^LA7SBCR(LA7PROM)
- +21 IF Y<1
- SET LA7("ERROR")="1^User timeout/abort"
- QUIT
- +22 SET Y=$$UPCASE^LRAFUNC(Y)
- +23 SET LA7=$PIECE(Y,"STX^",2)
- SET LA7=$PIECE(LA7,"^ETX",1)
- +24 IF LA7=""
- SET LA7("ERROR")="2^Incorrect barcode format"
- QUIT
- +25 SET $PIECE(LA7("UID"),"^",3)=$PIECE(LA7,"^",1)
- +26 SET $PIECE(LA7("NLT"),"^",3)=$PIECE(LA7,"^",2)
- +27 SET $PIECE(LA7("SPECIMEN"),"^",3)=$PIECE(LA7,"^",3)
- +28 SET LA7("ERROR")=0
- End DoDot:1
- +29 QUIT