source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LALBG3.m@ 767

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

initial load of WorldVistAEHR

File size: 1.3 KB
Line 
1LALBG3 ;SLC/RAF - IL BG3 Blood Gas Analyzer interface ;9/2/94 14:33 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3LA1 S:$D(ZTQUEUED) ZTREQ="@"
4 S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)),U="^" Q:TSK<1
5 Q:'$D(^LA(TSK,"I",0)) D ^LASET Q:'TSK S X="TRAP^"_LANM,@^%ZOSF("TRAP")
6 S I=0 F S I=$O(TC(I)) Q:'I S TEST(TC(I,4))=TC(I,1),FIX(TC(I,4))=TC(I,2)
7LA2 K TV,ID,IDE,TRAY,CUP S TOUT=0 D IN G QUIT:TOUT,LA2:IN'["BG3"
8 D IN,IN S V=$G(IN) D NUM S (ID,IDE,CUP)=+V,TRAY=1 D
9 .F I=0:0 D IN Q:IN["COMMENT" D:IN["TEMP" TEMP S V=$E(IN,1,6) D NUM S TEST=V,V=$E(IN,7,14) D NUM,FIX I $D(TEST(TEST)) S @TEST(TEST)=+V
10LA3 .X LAGEN G LA2:ISQN<1
11 .F I=0:0 S I=$O(TV(I)) Q:I<1 I $D(TV(I,1)),TV(I,1)]"" S ^LAH(LWL,1,ISQN,I)=TV(I,1)
12 G LA2
13IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 9 G IN
14 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
15 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
16 Q
17NUM S X="" F I=1:1:$L(V) S:$A(V,I)-32 X=X_$E(V,I)
18 S V=X Q
19QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK) D
20 .K CNT,CTRL,CUP,FIX,I,ID,IDE,IN,ISQN,LAGEN,LANM,LWL,T,TC,TEST
21 .K TOUT,TRAY,TSK,TV,U,V,X
22 Q
23TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
24 Q
25TEMP ;extracts the FIO2 test value from the temp line
26 S IN=$E($P(IN,"xF",2),1,15)
27 Q
28FIX ;allows site to utilize param 1 for result manipulation
29 I $L($G(FIX(TEST))) X FIX(TEST)
30 Q
Note: See TracBrowser for help on using the repository browser.