source: WorldVistAEHR/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LASET.m@ 1006

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1LASET ;SLC/RWF - AUTO INSTRUMENTS SETUP VAR FOR DATA COLECTION ;2/19/91 12:03
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;**27,42,46**;Sep 27, 1994
3 ;
4LA1 ;
5 S:$D(ZTQUEUED) ZTREQ="@" ;Clean up
6 I $G(TSK)<1 Q
7 L +^LA("LOCK"):99999
8 I $D(^LA("LOCK",TSK)) S TSK=0 L -^LA("LOCK") Q
9 S ^LA("LOCK",TSK)=$J
10 L -^LA("LOCK")
11 ;
12 K ^TMP($J),^TMP("LA",$J) S TRAY=1,CUP=1
13 S ECHOALL=0,X=^LAB(62.4,TSK,0),U="^",LWL=$P(X,U,4),WL=$P(X,U,11) I 'WL K ^LA("LOCK",TSK) S TSK=0 Q
14 S METH=$P(X,U,10),LROVER=+$P(X,U,12),LALCT=$P(X,U,5),LAZZ=$P(^LRO(68,WL,0),U,3),LADT=$S(LAZZ="D":DT,LAZZ="M":$E(DT,1,5)_"00",LAZZ="Y":$E(DT,1,3)_"0000")
15 S LAGEN="S "_$P(X,U,6)_"="_$P(X,U,7)_" D "_$P(X,U,6)_"^LAGEN"
16 S TP=0,NOW=$$NOW^XLFDT
17 ;TC(I,0)=TEST NUMBER, TC(I,1)= STORAGE LOCATION, TC(I,2)= 'S V=$E(Y(A),12,15)' PARM1, TC(I,3)= PARM2, TC(I,4)=PARM3 or ^TMP("LA",$J,I,1)=STORAGE
18 I "T"[LALCT F I=0:0 S I=$O(^LAB(62.4,TSK,3,I)) Q:I<1 S X=^(I,0),TC=I,TC(I,0)=+X,TC(I,1)=^(1),TC(I,2)=$P(X,U,2),TC(I,3)=$P(X,U,3),TC(I,4)=$P(X,U,4)
19 I LALCT="U" F I=0:0 S I=$O(^LAB(62.4,TSK,3,I)) Q:I<1 S X=^(I,0),Y=^(1),TC=I,^TMP("LA",$J,I,0)=+X,^(1)=Y,^(2)=$P(X,U,2),^(3)=$P(X,U,3),^(4)=$P(X,U,4)
20 S LRTST="" F I=0:0 S I=$O(TC(I)) Q:$L(LRTST)>245!(I="") S LRTST=LRTST_TC(I,0)_U
21 S LRUTLITY=1 D GET^LRNORMAL:$D(LRTOP)
22LA2 K LRUTLITY,LRTST,LRTOP,%DT Q
23TRAP S X="TRAP^"_LANM,@^%ZOSF("TRAP")
24 Q
25NEW D SET Q:ER S ZTRTN=U_$P(^LAB(62.4,T,0),U,3),ZTDTH=$H,ZTIO="",ZTDESC=" Starting Automated Routine "_ZTRTN D ^%ZTLOAD:$L(ZTRTN)
26 Q
27RESTART I $D(^LA(T,"I",0)) S ZTRTN=$P(^LAB(62.4,T,0),U,3),ZTDTH=$H,ZTIO="",ZTDESC="Restarting Automated Routine "_ZTRTN D ^%ZTLOAD:$L(ZTRTN)
28 Q
29SET S ER=$D(^LA(T,"I")) Q:ER S:'$D(^LA(T,"I"))#2 ^LA(T,"I")=0,^("I",0)=0 Q:$D(^LA(T,"ENV")) D GETENV^%ZOSV S ^LA(T,"ENV")=Y Q
30SETO S:'$D(^LA(T,"O"))#2 ^LA(T,"O")=0,^("O",0)=0 Q:$D(^LA(T,"ENV")) D GETENV^%ZOSV S ^LA(T,"ENV")=Y Q
31 ;^LA(T,"ENV")=UCI^VOLUME SET^VAX NODE
32ERROR S ^TMP($J,1)=LANM,^(2)=TSK D ^LABERR S LANM=^TMP($J,1),TSK=^(2),U="^"
33 Q
34 ;
35RMK ;Set up nodes for comments from the instrument
36 ; This entry point for LSI/direct connect interfaces which are coded to
37 ; pass multiple remarks delimited by ";".
38 N LACOM,LAII
39 F LAII=1:1 S LACOM=$P(RMK,";",LAII) Q:'$L(LACOM) D RMKSET(LWL,ISQN,LACOM,"")
40 Q
41 ;
42RMKSET(LAWL,LAISQN,LARMK,LARMKP) ; Set remark in LAH global
43 ; Call with LAWL = pointer to load/worklist (entry in LAH)
44 ; LAISQN = sequence number of entry in LAH
45 ; LARMK = remark(comment to store)
46 ; LARMKP = string to precede each remark, i.e. "For test..."
47 ; Used by above
48 ; Used by univeral interfaces (LA7*) to set remarks without using ";" as delimiter. Allows ";" in text of remark.
49 N DIWF,DIWL,DIWR,LAI,X,Y
50 I '$G(LAWL)!('$G(LAISQN)) Q
51 S LARMK=$G(LARMK),LARMKP=$G(LARMKP) ; Make sure variables defined
52 I ($L(LARMK)+$L(LARMKP))'>68 D Q ; Comment 68 characters or less
53 . S LAI=$O(^LAH(LAWL,1,LAISQN,1,""),-1)+1 ; Get next subscript to store comment.
54 . S ^LAH(LAWL,1,LAISQN,1,LAI)=LARMKP_LARMK ; Store comment
55 ; Comment greater than 68 characters, need to reformat.
56 K ^UTILITY($J,"W")
57 S X=LARMK,DIWL=1,DIWR=68-$L(LARMKP),DIWF="",LAX=0 D ^DIWP ; Call FileMan to reformat.
58 F S LAX=$O(^UTILITY($J,"W",DIWL,LAX)) Q:'LAX D
59 . S LAI=$O(^LAH(LAWL,1,LAISQN,1,""),-1)+1
60 . S ^LAH(LAWL,1,LAISQN,1,LAI)=LARMKP_$G(^UTILITY($J,"W",DIWL,LAX,0))
61 K ^UTILITY($J,"W")
62 Q
Note: See TracBrowser for help on using the repository browser.