source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAMSA.m@ 1147

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1LAMSA ;SLC/DLG - MICROSCAN AND AUTOSCAN4 DATA ANALYZER ;8/16/90 13:35 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK BY ID OR IDE
4LA1 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:TSK<1
5 Q:'$D(^LA(TSK,"I",0))
6 K LATOP D ^LASET Q:'TSK S LROVER=1,X="TRAP^"_LANM,@^%ZOSF("TRAP"),FD="|"
7LA2 S TOUT=0,A=1 D IN G QUIT:TOUT,LA2:$E(IN)'="P" D QC
8 K ORG,COMM,COMMO,LADGT,LABLI,LASPEC S (COMM,COMMO,LADRUG,LAISO,LAORG,LADNA,LAMIC,LMDR)=0,LRM=1
9 S TOUT=0,BAD=0 F A=2:1 D IN,QC G LA3:TYPE="L",QUIT:TOUT
10 Q
11LA3 G LA2:'$D(ORG) X LAGEN G LA2:'ISQN ;Can be changed by the cross-link code
12 S LRA=$P(^LAH(LWL,1,ISQN,0),U,3,5),LRAA=+LRA,LRAD=$P(LRA,U,2)
13 F I=0:0 S I=$O(ORG(I)) Q:I'>0 S I1=I,X=ORG(I) S ^LAH(LWL,1,ISQN,3,I1,0)=ORG(I) D LA4 I COMMO F J=1:1:COMMO S:$D(COMM(I1,1,J))#2 ^LAH(LWL,1,ISQN,3,I1,1,J,0)=COMM(I1,1,J)
14 I COMM F I=1:1:COMM S ^LAH(LWL,1,ISQN,4,I,0)=COMM("C",I)
15 G LA2
16LA4 F J=0:0 S J=$O(ORG(I,J)) Q:J'>0 S ^LAH(LWL,1,ISQN,3,I1,J)=ORG(I,J)
17 Q
18QC ;QC and data record processing here
19 S TYPE=" " Q:"BC"[CTRL S TYPE=$E(IN) Q:TYPE']"" I "PBRMLFC"'[TYPE Q ;These are the record types we handle
20 D @TYPE Q
21P S V=$P(IN,FD,3) D NUM S LAPID=V Q
22B S V=$P(IN,FD,3) D NUM S (CUP,IDE)=V,LRSP=$S($P(IN,FD,7):$P(IN,FD,7),1:"ANY"),LASPEC=$P(IN,FD,9) Q ;Could change LRAA here
23R S LAISO=+$P(IN,FD,3),LATPN=+$P(IN,FD,5),LANOS=$P(IN,FD,9),LAORG=$P(IN,FD,12),LANORG=$P(IN,FD,13),LANYD=$P(IN,FD,23)
24 S X=$O(^LAB(62.4,TSK,7,LRM,1,"C",LAORG,0)),LAORG=0 Q:X'>0 S LAORG=+^LAB(62.4,TSK,7,LRM,1,X,0),ORG(LAISO)=LAORG
25 Q
26M Q:$D(ORG(LAISO))'>0 S LADNA=$P(IN,FD,3),LAMIC=$P(IN,FD,5),LANCCLS=$P(IN,FD,8)
27 F I=1:1:25 S Y(I)=$P(IN,FD,I)
28 D M^LAMSA1 Q
29F S X=$P(IN,FD,4) I X]"" S:"PB"[$P(IN,FD,3) COMM=COMM+1,COMM("C",COMM)=X S:$P(IN,FD,3)="R" COMMO=COMMO+1,COMM(LAISO,1,COMMO)=X,X=""
30 Q
31C S COMM=COMM+1,COMM("C",COMM)=$P(IN,FD,5) Q
32 Q
33L S END=$P(IN,FD,3) Q
34NUM S X="" F JJ=1:1:$L(V) S:$A(V,JJ)>32 X=X_$E(V,JJ)
35 S V=X Q
36IN S CNT=^LA(TSK,"I",0)+1,CTRL="<" IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 5 G IN
37 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
38 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
39 Q
40OUT S CNT=^LA(TSK,"O")+1,^("O")=CNT,^("O",CNT)=OUT
41 LOCK ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=TSK LOCK
42 Q
43QUIT G LA2:^LA(TSK,"I")>^("I",0) LOCK ^LA(TSK) H 1 K ^LA(TSK,"I"),^LA("LOCK",TSK)
44 I $D(^LA(TSK,"O")),^("O")=^("O",0) K ^LA(TSK,"O")
45 LOCK K ^TMP($J),^TMP("LA",$J)
46 Q
47TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM)
Note: See TracBrowser for help on using the repository browser.