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

LA7UIIN.m

Go to the documentation of this file.
  1. LA7UIIN ;DALISC/JRR - Process Incoming Univ Interface Messages ; 12/3/1997
  1. ;;5.2;LAB MESSAGING;**17,23,27**;Sep 27, 1994
  1. ;This routine processes all incoming messages for the
  1. ;Universal Interface configuration.
  1. QUIT
  1. ;
  1. EN L +^LAHM(62.48,"Z",LA76248):10 ;only one job should run at at time
  1. E QUIT
  1. ;
  1. LOOP F LA7LOOP=1:1:60 DO GETIN H 5 ;main loop, LA7LOOP reset in GETIN
  1. K LA7LOOP
  1. L -^LAHM(62.48,"Z",LA76248)
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. QUIT ;quit main routine
  1. ;
  1. GETIN ;Check the incoming queue for messages and then call LA7UIIN1 to
  1. ;process the message.
  1. Q:'$O(^LAHM(62.49,"Q",LA76248,"IQ",0)) ;check incoming queue
  1. S LA76249=0
  1. S LA7LOOP=1 ;reset timeout counter
  1. F S LA76249=$O(^LAHM(62.49,"Q",LA76248,"IQ",LA76249)) Q:'LA76249 D
  1. . K TRAY,CUP,LWL,WL,LROVER,METH,LOG,IDENT,LADT,LAGEN,ISQN,IDE
  1. . L +^LAHM(62.49,LA76249):1 Q:'$T ; Unable to get lock, messsage still building?.
  1. . D NXTMSG^LA7UIIN1
  1. . I $G(LA7INST)="" S LA7INST="UNKNOWN"
  1. . S DR="5////"_$P(LA7INST,"^")_"-I-"_$S($L(LA7UID):LA7UID,1:LA7AN) ; Set instrument name-message type-unique identifier or accession # as INSTRUMENT NAME.
  1. . I $P($G(^LAHM(62.49,LA76249,0)),"^",3)'="E" S DR=DR_";2////X" ;set status to purgeable
  1. . S DIE="^LAHM(62.49,",DA=LA76249
  1. . D ^DIE ;set status to purgeable
  1. . I $D(^LAHM(62.48,+$G(LA76248),20,"B",1)) D XQA^LA7UXQA(1,LA76248)
  1. . L -^LAHM(62.49,LA76249) ; Release lock.
  1. K ^TMP("LA7TREE",$J)
  1. QUIT ;quit GETIN subroutine
  1. ;
  1. QUE ;call here to queue this processing routine to run in the
  1. ;background. Required variables are:
  1. ;LA76248=pointer to configuration in 62.48
  1. L +^LAHM(62.48,"Z",LA76248):1 ;see if already running
  1. E L -^LAHM(62.48,"Z",LA76248) QUIT
  1. S ZTRTN="EN^LA7UIIN",ZTDTH=$H,ZTIO=""
  1. S ZTDESC="Processing Routine for "_$P(^LAHM(62.48,LA76248,0),"^")
  1. S ZTSAVE("LA76248")=LA76248
  1. D ^%ZTLOAD
  1. L -^LAHM(62.48,"Z",LA76248)
  1. K ZTDTH,ZTIO,ZTSAVE,ZTRTN,ZTSK
  1. QUIT ;quit QUE subroutine call