source: FOIAVistA/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LA7UIIN.m@ 1806

Last change on this file since 1806 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1LA7UIIN ;DALISC/JRR - Process Incoming Univ Interface Messages ; 12/3/1997
2 ;;5.2;LAB MESSAGING;**17,23,27**;Sep 27, 1994
3 ;This routine processes all incoming messages for the
4 ;Universal Interface configuration.
5 QUIT
6 ;
7EN L +^LAHM(62.48,"Z",LA76248):10 ;only one job should run at at time
8 E QUIT
9 ;
10LOOP F LA7LOOP=1:1:60 DO GETIN H 5 ;main loop, LA7LOOP reset in GETIN
11 K LA7LOOP
12 L -^LAHM(62.48,"Z",LA76248)
13 I $D(ZTQUEUED) S ZTREQ="@"
14 QUIT ;quit main routine
15 ;
16GETIN ;Check the incoming queue for messages and then call LA7UIIN1 to
17 ;process the message.
18 Q:'$O(^LAHM(62.49,"Q",LA76248,"IQ",0)) ;check incoming queue
19 S LA76249=0
20 S LA7LOOP=1 ;reset timeout counter
21 F S LA76249=$O(^LAHM(62.49,"Q",LA76248,"IQ",LA76249)) Q:'LA76249 D
22 . K TRAY,CUP,LWL,WL,LROVER,METH,LOG,IDENT,LADT,LAGEN,ISQN,IDE
23 . L +^LAHM(62.49,LA76249):1 Q:'$T ; Unable to get lock, messsage still building?.
24 . D NXTMSG^LA7UIIN1
25 . I $G(LA7INST)="" S LA7INST="UNKNOWN"
26 . S DR="5////"_$P(LA7INST,"^")_"-I-"_$S($L(LA7UID):LA7UID,1:LA7AN) ; Set instrument name-message type-unique identifier or accession # as INSTRUMENT NAME.
27 . I $P($G(^LAHM(62.49,LA76249,0)),"^",3)'="E" S DR=DR_";2////X" ;set status to purgeable
28 . S DIE="^LAHM(62.49,",DA=LA76249
29 . D ^DIE ;set status to purgeable
30 . I $D(^LAHM(62.48,+$G(LA76248),20,"B",1)) D XQA^LA7UXQA(1,LA76248)
31 . L -^LAHM(62.49,LA76249) ; Release lock.
32 K ^TMP("LA7TREE",$J)
33 QUIT ;quit GETIN subroutine
34 ;
35QUE ;call here to queue this processing routine to run in the
36 ;background. Required variables are:
37 ;LA76248=pointer to configuration in 62.48
38 L +^LAHM(62.48,"Z",LA76248):1 ;see if already running
39 E L -^LAHM(62.48,"Z",LA76248) QUIT
40 S ZTRTN="EN^LA7UIIN",ZTDTH=$H,ZTIO=""
41 S ZTDESC="Processing Routine for "_$P(^LAHM(62.48,LA76248,0),"^")
42 S ZTSAVE("LA76248")=LA76248
43 D ^%ZTLOAD
44 L -^LAHM(62.48,"Z",LA76248)
45 K ZTDTH,ZTIO,ZTSAVE,ZTRTN,ZTSK
46 QUIT ;quit QUE subroutine call
Note: See TracBrowser for help on using the repository browser.