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

LA7VQIN.m

Go to the documentation of this file.
  1. LA7VQIN ;VHA/DALOI/JMC - Process Incoming Lab HL7 Messages ;JUL 06, 2010 3:14 PM
  1. ;;5.2;AUTOMATED LAB INSTRUMENTS;**46,1027**;NOV 01, 1997;Build 9
  1. ; This routine processes incoming messages for various Lab HL7 configurations.
  1. Q
  1. ;
  1. EN ; Only one process should run at a time
  1. N LA76249,LA7I,LA7INTYP,LA7LOOP
  1. ;
  1. L +^LAHM(62.48,"Z",LA76248):10
  1. E Q
  1. ;
  1. ; Determine interface type
  1. S LA7INTYP=+$P(^LAHM(62.48,LA76248,0),"^",9)
  1. ;
  1. ; main loop, LA7LOOP reset in GETIN, if no messages for 5 minutes (60x5) then quit
  1. F LA7LOOP=1:1:60 D GETIN H 5
  1. ;
  1. ; If point of care interface then task job(s) to process results in LAH.
  1. I LA7INTYP=20,$D(LA7INTYP("LWL")) D
  1. . S LA7I=0
  1. . F S LA7I=$O(LA7INTYP("LWL",LA7I)) Q:'LA7I D QLAH(LA7I)
  1. ;
  1. ; Release lock
  1. L -^LAHM(62.48,"Z",LA76248)
  1. ; Clean up taskman
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. K LA76248
  1. K CENUM,DPF,ECHOALL,ER,IDE,IDT,LALCT,LANM,LAZZ,LINK,LRTEC,NOW,RMK,T,TC,TP,TSK,WDT
  1. Q
  1. ;
  1. ;
  1. GETIN ; Check the incoming queue for messages and then call LA7VIN1 to
  1. ; process the message.
  1. ;
  1. ; Check incoming queue
  1. Q:'$O(^LAHM(62.49,"Q",LA76248,"IQ",0))
  1. ;
  1. ; Reset timeout counter
  1. S LA7LOOP=1
  1. ;
  1. ; Get lock on message, quit if still building, process message then release lock.
  1. F S LA76249=$O(^LAHM(62.49,"Q",LA76248,"IQ",0)) Q:'LA76249 D
  1. . L +^LAHM(62.49,LA76249):1
  1. . I '$T H 5 Q
  1. . D NXTMSG^LA7VQIN1
  1. . L -^LAHM(62.49,LA76249)
  1. K ^TMP("LA7TREE",$J)
  1. Q
  1. ;
  1. ;
  1. QUE ; Call here to queue this processing routine to run in the background.
  1. ; Required variables are: LA76248 = pointer to configuration in 62.48
  1. ;
  1. N ZTDESC,ZTDTH,ZTIO,ZTSAVE,ZTRTN,ZTSK
  1. ;
  1. ; See if already running
  1. L +^LAHM(62.48,"Z",LA76248):1
  1. E Q
  1. ;
  1. S ZTRTN="EN^LA7VQIN",ZTDTH=$H,ZTIO=""
  1. S ZTDESC="Processing Routine for "_$P(^LAHM(62.48,LA76248,0),"^")
  1. S ZTSAVE("LA76248")=LA76248
  1. D ^%ZTLOAD
  1. ;
  1. L -^LAHM(62.48,"Z",LA76248)
  1. ;
  1. Q
  1. ;
  1. ;
  1. QLAH(LWL) ; Call here to queue result processing routine to run in the background.
  1. ; Call with LWL = pointer to loadlist in file #68.2
  1. ;
  1. N ZTDESC,ZTDTH,ZTIO,ZTSAVE,ZTRTN,ZTSK
  1. ;
  1. ; See if already running
  1. L +^LAH("Z",LWL):1
  1. E Q
  1. ;
  1. S ZTRTN="EN^LA7VIN",ZTDTH=$H,ZTIO=""
  1. S ZTDESC="Result Processing for "_$P(^LRO(68.2,LWL,0),"^")
  1. S ZTSAVE("LWL")=LWL
  1. ;D ^%ZTLOAD
  1. ;
  1. L -^LAH("Z",LWL)
  1. ;
  1. Q