LACD3500 ;SLC/DLG/FHS/PAC- CELL-DYN 1500,1600,2000 AUTOMATED DATA ; 6/2/89 8:57 AM ;
;;5.2;AUTOMATED LAB INSTRUMENTS;**8,15**;Sep 27, 1994;
;CROSS LINK BY ID OR IDE
LA1 S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:TSK<1
Q:'$D(^LA(TSK,"I",0)) S LAC=","
K LATOP D ^LASET Q:'TSK S X="TRAP^"_LANM,@^%ZOSF("TRAP")
LA2 K TV,Y S TOUT=0 D IN G QUIT:TOUT,LA2:CTRL'="B"
D IN G QUIT:TOUT,LA2:$P(IN,LAC)'=""" """ S TOUT=0,A=1 S Y(A)=IN
LAC I CTRL'="C" D IN G QUIT:TOUT S TOUT=0,A=A+1,Y(A)=IN G LAC
;S V=$P(Y(1),",",2) D NUM S IDE=+V,V=$E($P(Y(1),",",5),2,8) D NUM S (ID,CUP)=+V,TRAY=1,V=$P(Y(1),",",4) D NUM S TYPE=+V ;MODIFIED FOR CD3000 1/10/92 GLD. ;<543/EPH> Changed 4 to 5 & 3 to 4.
S IDE=+$$NUM($P(Y(1),LAC,2)),(ID,CUP)=+$$NUM($E($P(Y(1),LAC,5),2,8))
S TRAY=1,TYPE=+$$NUM($P(Y(1),LAC,4))
F I=0:0 S I=$O(TC(I)) Q:I<1 X TC(I,2) S @TC(I,1)=V ;V COULD BE MODIFIED ON THIS LINE
LA3 G:'ID LA2 G:TYPE>1 LA2 X LAGEN G LA2:'ISQN ;Can be changed by the cross-link code/ MODIFIED TO ELIMINATE PROCESSING OF ALL BUT PATIENTS AND CONTROLS GLD 1-13-91
F I=0:0 S I=$O(TV(I)) Q:I="" S:TV(I,1)'="" ^LAH(LWL,1,ISQN,I)=TV(I,1) ;MODIFIED replaced >0 with '="" TO ALLOW 0 AS AN ACCEPTABLE VALUE GLD 1-17-92
G LA2
QC ;QC TESTING HERE; S BAD=1 IF DONT STORE
S Y(A)=IN Q
NUM(X) N LAX,JJ S LAX="" F JJ=1:1:$L(X) S:$A(X,JJ)>32 LAX=LAX_$E(X,JJ)
Q LAX
IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) S TOUT=TOUT+1 Q:TOUT>9 H 5 G IN
S ^LA(TSK,"I",0)=CNT,IN=^(CNT),TOUT=0 I ECHOALL S Z=IN D WRITE
S CTRL=$P(IN,"~",2),IN=$P(IN,"~")
Q
OUT S CNT=^LA(TSK,"O")+1,^("O")=CNT,^("O",CNT)=OUT
LOCK +^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=TSK LOCK -^LA("Q")
Q
WRITE I IO]"" O IO::1 IF $T U IO W:'ECHOALL *7 W !,Z C IO
Q
QUIT LOCK ^LA(TSK) H 1 K ^LA(TSK),^LA("LOCK",TSK) I $D(ZTSK) D KILL^%ZTLOAD K ZTSK
Q
TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLACD3500 1878 printed Dec 13, 2024@01:41:42 Page 2
LACD3500 ;SLC/DLG/FHS/PAC- CELL-DYN 1500,1600,2000 AUTOMATED DATA ; 6/2/89 8:57 AM ;
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;**8,15**;Sep 27, 1994;
+2 ;CROSS LINK BY ID OR IDE
LA1 SET LANM=$TEXT(+0)
SET TSK=$ORDER(^LAB(62.4,"C",LANM,0))
if TSK<1
QUIT
+1 if '$DATA(^LA(TSK,"I",0))
QUIT
SET LAC=","
+2 KILL LATOP
DO ^LASET
if 'TSK
QUIT
SET X="TRAP^"_LANM
SET @^%ZOSF("TRAP")
LA2 KILL TV,Y
SET TOUT=0
DO IN
if TOUT
GOTO QUIT
if CTRL'="B"
GOTO LA2
+1 DO IN
if TOUT
GOTO QUIT
if $PIECE(IN,LAC)'=""" """
GOTO LA2
SET TOUT=0
SET A=1
SET Y(A)=IN
LAC IF CTRL'="C"
DO IN
if TOUT
GOTO QUIT
SET TOUT=0
SET A=A+1
SET Y(A)=IN
GOTO LAC
+1 ;S V=$P(Y(1),",",2) D NUM S IDE=+V,V=$E($P(Y(1),",",5),2,8) D NUM S (ID,CUP)=+V,TRAY=1,V=$P(Y(1),",",4) D NUM S TYPE=+V ;MODIFIED FOR CD3000 1/10/92 GLD. ;<543/EPH> Changed 4 to 5 & 3 to 4.
+2 SET IDE=+$$NUM($PIECE(Y(1),LAC,2))
SET (ID,CUP)=+$$NUM($EXTRACT($PIECE(Y(1),LAC,5),2,8))
+3 SET TRAY=1
SET TYPE=+$$NUM($PIECE(Y(1),LAC,4))
+4 ;V COULD BE MODIFIED ON THIS LINE
FOR I=0:0
SET I=$ORDER(TC(I))
if I<1
QUIT
XECUTE TC(I,2)
SET @TC(I,1)=V
LA3 ;Can be changed by the cross-link code/ MODIFIED TO ELIMINATE PROCESSING OF ALL BUT PATIENTS AND CONTROLS GLD 1-13-91
if 'ID
GOTO LA2
if TYPE>1
GOTO LA2
XECUTE LAGEN
if 'ISQN
GOTO LA2
+1 ;MODIFIED replaced >0 with '="" TO ALLOW 0 AS AN ACCEPTABLE VALUE GLD 1-17-92
FOR I=0:0
SET I=$ORDER(TV(I))
if I=""
QUIT
if TV(I,1)'=""
SET ^LAH(LWL,1,ISQN,I)=TV(I,1)
+2 GOTO LA2
QC ;QC TESTING HERE; S BAD=1 IF DONT STORE
+1 SET Y(A)=IN
QUIT
NUM(X) NEW LAX,JJ
SET LAX=""
FOR JJ=1:1:$LENGTH(X)
if $ASCII(X,JJ)>32
SET LAX=LAX_$EXTRACT(X,JJ)
+1 QUIT LAX
IN SET CNT=^LA(TSK,"I",0)+1
IF '$DATA(^(CNT))
SET TOUT=TOUT+1
if TOUT>9
QUIT
HANG 5
GOTO IN
+1 SET ^LA(TSK,"I",0)=CNT
SET IN=^(CNT)
SET TOUT=0
IF ECHOALL
SET Z=IN
DO WRITE
+2 SET CTRL=$PIECE(IN,"~",2)
SET IN=$PIECE(IN,"~")
+3 QUIT
OUT SET CNT=^LA(TSK,"O")+1
SET ^("O")=CNT
SET ^("O",CNT)=OUT
+1 LOCK +^LA("Q")
SET Q=^LA("Q")+1
SET ^("Q")=Q
SET ^("Q",Q)=TSK
LOCK -^LA("Q")
+2 QUIT
WRITE IF IO]""
OPEN IO::1
IF $TEST
USE IO
if 'ECHOALL
WRITE *7
WRITE !,Z
CLOSE IO
+1 QUIT
QUIT LOCK ^LA(TSK)
HANG 1
KILL ^LA(TSK),^LA("LOCK",TSK)
IF $DATA(ZTSK)
DO KILL^%ZTLOAD
KILL ZTSK
+1 QUIT
TRAP ;ERROR TRAP
DO ^LABERR
SET T=TSK
DO SET^LAB
GOTO @("LA2^"_LANM)