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

LA7SBCR3.m

Go to the documentation of this file.
  1. LA7SBCR3 ;DALISC/JMC - Shipping Barcode Reader Utility ; 7 Feb 1997
  1. ;;5.2;LAB MESSAGING;**27**;Sep 27, 1994
  1. Q
  1. ;
  1. TEST(LA7,LA7PROM,LA7BAR) ; Setup test/specimen info.
  1. ; Input:
  1. ; LA7=array to return values
  1. ; LA7PROM=prompt to display to user
  1. ; LA7BAR=0/1 using barcode reader
  1. ;
  1. ; Returns array LA7()
  1. ;
  1. ; If successful ERROR=0
  1. ; NLT=National Laboratory Test code
  1. ; SPECIMEN=HL7 specimen code
  1. ; UID=Sender's Unique Identifier
  1. ;
  1. ; unsuccessful ERROR=>0
  1. ;
  1. N LA7X,X,Y
  1. ; Initialize array.
  1. F Y="ERROR","NLT","SPECIMEN","UID" S LA7(Y)=""
  1. S LA7PROM=$G(LA7PROM,"Test")
  1. I LA7BAR D
  1. . S Y=$$RD^LA7SBCR(LA7PROM)
  1. . I Y<1 S LA7("ERROR")="1^User timeout/abort" Q
  1. . S Y=$$UPCASE^LRAFUNC(Y)
  1. . S LA7=$P(Y,"STX^",2),LA7=$P(LA7,"^ETX",1)
  1. . I LA7="" S LA7("ERROR")="2^Incorrect barcode format" Q
  1. . S $P(LA7("UID"),"^",3)=$P(LA7,"^",1)
  1. . S $P(LA7("NLT"),"^",3)=$P(LA7,"^",2)
  1. . S $P(LA7("SPECIMEN"),"^",3)=$P(LA7,"^",3)
  1. . S LA7("ERROR")=0
  1. Q