source: FOIAVistA/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LASMACA.m@ 1389

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1LASMACA ;SLC/RWF - GETS DATA FROM SMAC ;8/16/90 11:03 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;CROSS LINK BY, ID =smac IDEE #(bar code), IDE =smac MED REC #, IDE2 =labnum
4LA1 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)),U="^",LRTEC="" Q:TSK<1
5 Q:'$D(^LA(TSK,"I",0))
6 S LRTOP=$P(^LAB(69.9,1,1),U,3) D ^LASET ;SET LRTOP
7 S TP=0,SS="CH",X="TRAP^"_LANM,@^%ZOSF("TRAP")
8 I TC(1,2)?.N1P.N F I=1:1:TC S Y=+TC(I,2),E=+$P(TC(I,2),",",2),TC(I,2)="S V=$E(Y("_Y_"),"_E_","_(E+3)_"),T=$E(Y("_Y_"),"_(E+4)_")"
9 S IDT=0
10LA2 G ENT
11D2S S RMK=$P(RMK," ",1)_" "_$P(RMK," ",2,99) G D2S:RMK[" " Q
12ENT K TV S END=0,BAD=0,IDE="",ID=""
13C1 S TOUT=0 D IN G LAST:TOUT,C1:$E(IN,13)'="/"
14 S I=1 D REC F I=2:1:4 D IN,REC:'TOUT
15 G ENT:TOUT!BAD D SAVE G ENT
16LAST K ^LA("LOCK",TSK),^LA("STOP",TSK) Q:$D(LRMODE) L ^LA(TSK) H 2 K ^LA(TSK)
17 Q
18REC ;
19 IF $E(IN,$P("13^36^7^5",U,I))'=$E("/// ",I) S BAD=1
20 Q:END!BAD S Y(I)=IN
21 Q
22SAVE S K=",",FG=0
23 S RMK=$E(Y(2),6,35),NSS=$E(RMK,1,5) D D2S S IDE=$E(Y(1),1,12),ID=$E(Y(3),1,6),IDE2=$E(Y(3),8,11)
24 S DILU=$S(NSS["SX":+$P(NSS,"SX",2),NSS["UX":+$P(NSS,"UX",2),1:0),SPEC=$S($E(NSS)="U":$P(^LAB(69.9,1,1),U,2),1:$P(^LAB(69.9,1,1),U,3))
25 F II=1:1:TC X TC(II,2) S:V=" "!(V="----") T="B" S:T'="B"&DILU V=V*DILU S:T'="B"&TC(II,3) V=V/TC(II,3) S @TC(II,1)=$S("/*="[T:+V,1:"")_$S("CGTLD*"[T:T,1:""),FG=("CGTLD*"[T)+FG
26 S TRAY=+$E(ID,1,3),CUP=+$E(ID,4,6)
27 Q:ID?.P
28LA3 X LAGEN ;D ^LACRIT:SPEC=$P(^LAB(69.9,1,1),U,3)
29 IF $D(^LRO(68.2,LWL,8,0)) S:FG ^LRO(68.2,LWL,8,ISQN)=FG
30 F I=0:0 S I=$O(TV(I)) Q:I<1 D LA4
31 I RMK'?." " S ^LAH(LWL,1,ISQN,1)=RMK
32 I DPF=62.3 D CONTROL^LAGEN
33 Q
34LA4 I $D(TV(I,1)),TV(I,1)]"" S ^LAH(LWL,1,ISQN,I)=TV(I,1)
35 Q
36 Q
37IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 S:$D(^LA("STOP",TSK)) TOUT=99 Q:TOUT>30 H 5 G IN
38 S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0
39 S:IN["~" CTRL=$P(IN,"~",2),IN=$P(IN,"~",1)
40 Q
41OUT S CNT=^LA(TSK,"O")+1,^("O")=CNT,^("O",CNT)=OUT
42 LOCK ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=TSK LOCK
43 Q
44TRAP D ^LABERR K OLD,^LA("LOCK",TSK) Q
45 ;Y(I),START $E, DIVIDE BY
46 ;IDE=MEDICAL REC. NUM, ID=IDEE
Note: See TracBrowser for help on using the repository browser.