LAC178HP ;SLC/FHS - DUAL CORNING 178 VIA HP COMPUTER ;8/16/90 14:12
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
EN ;
;Cross linked by IDE
;Enter transmitted test name in PARAM 3
S:$D(ZTQUEUED) ZTREQ="@"
S LANM=$T(+0),TSK=$O(^LAB(62.4,"C",LANM,0)) Q:'$D(^LA(TSK,"I",0))
S SS="CH" D ^LASET Q:TSK<1 S X="TRAP^"_LANM,@^%ZOSF("TRAP")
F I=0:0 S I=$O(TC(I)) Q:I'>0 S LA(TC(I,4))=TC(I,1)
S (TOUT,ID)=0,TRAY=1
LA2 D IN G QUIT:TOUT G LA2:$E(IN,1,7)'="Corning" D IN S X=$E(IN,20,30) D PACK G:X="---" LA2 S (CUP,ID,IDE)=X
TEST ;
F A=0:0 D IN Q:IN="" S TEST=$P(IN," "),X=$E(IN,8,13) D PACK I $D(LA(TEST)) S @LA(TEST)=X
X LAGEN F I=0:0 S I=$O(TV(I)) Q:I<1 S R=$S($D(TV(I,1)):TV(I,1),1:"") S:R'="" ^LAH(LWL,1,ISQN,I)=R
F I=0:0 S I=$O(TC(I)) Q:I<1 S:$D(TC(I,1)) @TC(I,1)=""
G LA2
PACK S Y=X,X="" F I=1:1:$L(Y) S:$A(Y,I)-32 X=X_$E(Y,I)
Q:X="" S:X'?.P1N.NP X="---" Q
IN S CNT=^LA(TSK,"I",0)+1 IF '$D(^(CNT)) Q:TOUT>9 S TOUT=TOUT+1 H 9 G IN
S IN=^(CNT),^(0)=CNT,TOUT=0
Q
QUIT F I=0:0 LOCK ^LA(TSK):1 Q:$T H 5 G QUIT
K ^LA(TSK),^LA("LOCK",TSK) LOCK
Q
TRAP D ^LABERR S T=TSK D SET^LAB G @("LA2^"_LANM) ;ERROR TRAP
;
FORMAT ;Data stream should look like.
;
;Corning 178-1 xx/xx/xx 00:00
; ACC #
;pH 7.401
;pCO2 57.8
;pO2 47.5
;COMMENT
;
;Spacing is not exact
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLAC178HP 1337 printed Dec 13, 2024@01:41:39 Page 2
LAC178HP ;SLC/FHS - DUAL CORNING 178 VIA HP COMPUTER ;8/16/90 14:12
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
EN ;
+1 ;Cross linked by IDE
+2 ;Enter transmitted test name in PARAM 3
+3 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+4 SET LANM=$TEXT(+0)
SET TSK=$ORDER(^LAB(62.4,"C",LANM,0))
if '$DATA(^LA(TSK,"I",0))
QUIT
+5 SET SS="CH"
DO ^LASET
if TSK<1
QUIT
SET X="TRAP^"_LANM
SET @^%ZOSF("TRAP")
+6 FOR I=0:0
SET I=$ORDER(TC(I))
if I'>0
QUIT
SET LA(TC(I,4))=TC(I,1)
+7 SET (TOUT,ID)=0
SET TRAY=1
LA2 DO IN
if TOUT
GOTO QUIT
if $EXTRACT(IN,1,7)'="Corning"
GOTO LA2
DO IN
SET X=$EXTRACT(IN,20,30)
DO PACK
if X="---"
GOTO LA2
SET (CUP,ID,IDE)=X
TEST ;
+1 FOR A=0:0
DO IN
if IN=""
QUIT
SET TEST=$PIECE(IN," ")
SET X=$EXTRACT(IN,8,13)
DO PACK
IF $DATA(LA(TEST))
SET @LA(TEST)=X
+2 XECUTE LAGEN
FOR I=0:0
SET I=$ORDER(TV(I))
if I<1
QUIT
SET R=$SELECT($DATA(TV(I,1)):TV(I,1),1:"")
if R'=""
SET ^LAH(LWL,1,ISQN,I)=R
+3 FOR I=0:0
SET I=$ORDER(TC(I))
if I<1
QUIT
if $DATA(TC(I,1))
SET @TC(I,1)=""
+4 GOTO LA2
PACK SET Y=X
SET X=""
FOR I=1:1:$LENGTH(Y)
if $ASCII(Y,I)-32
SET X=X_$EXTRACT(Y,I)
+1 if X=""
QUIT
if X'?.P1N.NP
SET X="---"
QUIT
IN SET CNT=^LA(TSK,"I",0)+1
IF '$DATA(^(CNT))
if TOUT>9
QUIT
SET TOUT=TOUT+1
HANG 9
GOTO IN
+1 SET IN=^(CNT)
SET ^(0)=CNT
SET TOUT=0
+2 QUIT
QUIT FOR I=0:0
LOCK ^LA(TSK):1
if $TEST
QUIT
HANG 5
GOTO QUIT
+1 KILL ^LA(TSK),^LA("LOCK",TSK)
LOCK
+2 QUIT
TRAP ;ERROR TRAP
DO ^LABERR
SET T=TSK
DO SET^LAB
GOTO @("LA2^"_LANM)
+1 ;
FORMAT ;Data stream should look like.
+1 ;
+2 ;Corning 178-1 xx/xx/xx 00:00
+3 ; ACC #
+4 ;pH 7.401
+5 ;pCO2 57.8
+6 ;pO2 47.5
+7 ;COMMENT
+8 ;
+9 ;Spacing is not exact