source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAABL500.m@ 1704

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

initial load of WorldVistAEHR

File size: 1.6 KB
RevLine 
[613]1LAABL500 ;SLC/RAF - RADIOMETER ABL500,505,520 ;5/27/93 07:00;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK BY ID = ACCESSION #,IDE=INTERNAL SEQUENCE #
4LA1 S:$D(ZTQUEUED) ZTREQ="@" 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<1 D
7 .S TEST(TC(I,4))=TC(I,1),FIX(TC(I,4))=TC(I,2)
8LA2 K Y,TV,ID,IDE S (A,TOUT)=0 D IN G QUIT:TOUT,ID:$E(IN)="P",LA2
9ID ;sets ID from the accession # in the 4th piece of the "P" string ("|")
10 S V=$P(IN,"|",4) D NUM S ID=+V D IN G QUIT:TOUT
11IDE ;sets IDE from the 2nd piece of the "O" string ("^")
12 I $P(IN,"|")="O" S V=$P(IN,"^",2) D NUM S IDE=+V
13RES ;sets TEST and values from the "R" string
14 S TOUT=0 D IN G QUIT:TOUT,LA3:$E(IN)="L"
15 S V=$P($P(IN,"^",4),"|") D NUM S TEST=V G RES:TEST=""!('$D(TEST(TEST)))
16 S V=$P(IN,"|",4) D NUM,FIX S:V="....." V="" S @TEST(TEST)=V G RES
17 Q
18LA3 ;moving data to LAH global
19 X LAGEN G LA2:ISQN<1
20 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)
21 G LA2
22 Q
23IN S CNT=^LA(TSK,"I",0)+1 I '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 9 G IN
24 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
25 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
26 Q
27NUM S X="" F I=1:1:$L(V) S:$A(V,I)-32 X=X_$E(V,I)
28 S V=X Q
29QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK) D
30 .K X,A,ID,IDE,BAD,CNT,I,JJ,LAGEN,IN,ISQN,LANM,LWL,T,TEST,TC,TV,TOUT,TSK,V,CTRL,FIX
31 .S:$D(ZTQUEUED) ZTREQ="@"
32 Q
33TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
34FIX ;allows site to utilize param 1 for result manipulation
35 I $D(FIX(TEST)) X FIX(TEST)
36 Q
Note: See TracBrowser for help on using the repository browser.