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

LA7VCIN9.m

Go to the documentation of this file.
  1. LA7VCIN9 ;ihs/cmi/maw - Process Incoming UI Msgs, continued ; 22-Oct-2013 09:22 ; MAW
  1. ;;5.2;AUTOMATED LAB INSTRUMENTS;**1033**;NOV 01, 1997
  1. ; This routine is a continuation of LA7CVIN1 and is only called from there.
  1. ; It is called to process TQ1 and SPM segments for "CH" subscript tests.
  1. Q
  1. ;
  1. TQ1 ;-- process the TQ1 segment
  1. ; timing start time
  1. S LA7STT=$$HL7TFM^XLFDT($$P^LA7VHLU(.LA7SEG,8,LA7FS),"L")
  1. ; timing stop time
  1. S LA7STP=$$HL7TFM^XLFDT($$P^LA7VHLU(.LA7SEG,9,LA7FS),"L")
  1. S ^LAH(LA7LWL,1,LA7ISQN,"IHSTQ1")=LA7STT_U_LA7STP
  1. Q
  1. ;
  1. SPM ;-- process the SPM segment
  1. ; specimen type
  1. S LA7SPTYP=$$P^LA7VHLU(.LA7SEG,5,LA7FS) ;specimen type
  1. S LA7SPTSN=$P(LA7SPTYP,LA7CS) ;snomed code
  1. S LA7SPTHL=$P(LA7SPTYP,LA7CS,2)
  1. S LA7SPTYI=$O(^LAB(61,"C",LA7SPTSN,0)) ;get the ien of the topography field file
  1. I '$G(LA7SPTYI) S LA7SPTYI=$O(^LAB(61,"AHL7",LA7SPTHL,0)) ;get ien from HL7 code
  1. ; specimen collection date/time
  1. S LA7SPCDT=$$P^LA7VHLU(.LA7SEG,18,LA7FS)
  1. S LA7SPCST=$$HL7TFM^XLFDT($P(LA7SPCDT,LA7CS),"L")
  1. ; specimen reject reason
  1. S LA7SPRJR=$P($$P^LA7VHLU(.LA7SEG,22,LA7FS),LA7CS,2)
  1. S ^LAH(LA7LWL,1,LA7ISQN,"IHSSPM")=$G(LA7SPTYI)_U_LA7SPCST_U_LA7SPRJR
  1. I LA7RSTAT="X" D ;MU this is a cancelled test lets call auto cancellation
  1. . D NOTPERF^BLRRLTDR(LA7UID,LA7SPRJR)
  1. ; specimen condition
  1. S LA7SPCND=$$P^LA7VHLU(.LA7SEG,25,LA7FS) ;specimen condition
  1. Q:$G(LA7SPCND)=""
  1. S LA7SPCSN=$P(LA7SPCND,LA7CS) ;code
  1. S LA7SPCNI=$O(^LAHM(62.93,"ABB",LA7SPCSN,0)) ;get the ien based on code passed in
  1. S $P(^LAH(LA7LWL,1,LA7ISQN,"IHSSPM"),U,4)=LA7SPCNI
  1. Q