LASTATUS ;SLC/FHS - TO CHECK SYSTEM STATUS OF AUTO INSTRUMENT JOBS ;11/6/89 12:03
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
EN ;
D CLEAN W !! K DIC,LRPOSX,LRTOTX S (TOT,LAB)=0,DIC="^LAB(62.4,",DIC(0)="AZEQ",U="^",DIC("S")="I +Y<99" D ^DIC G:Y<1 CLEAN
EN1 ;
I '$D(^LA(+Y,"I")) W !!?7,"No data for ",$P(^LAB(62.4,+Y,0),U) S LREND=1 Q
W !!?10,"Enter '^' to abort process ",$C(7),!
S LAROUT=$P(Y(0),U,3),LRINST=+Y,LRINSTN=$P(Y,U,2)
I LRINST#10=1 S LAB=1
I 'LAB W !!?10,LRINSTN," has ",^LA(LRINST,"I")," entries ",! S LRTOT=^("I") I $D(^("I",0)) W !?10,"And ",^(0)," have been processed ",! S LRPROS=^(0)
LAB ;
W !!?10,"Checking process has started",!
G:LAB SYS R X:.01 G:X="^" CLEAN H 10 W !!,"CHECKING ",LRINSTN,! S TOT=TOT+1 I $D(^LA(LRINST,"I")),^("I")'=LRTOT S LRTOTX=^("I") W !,LRINSTN," is runing, now there are ",LRTOTX," entries in ^LA(",LRINST,! S LRTOT=LRTOTX
I '$D(^LA(LRINST,"I")) W !?10,LRINSTN," has been cleared " G CLEAN
I '$D(^LA(LRINST,"I",0)) W !?10,LRINSTN," NOT BEEN COMPLETELY SET UP YET " G CLEAN
I $D(^LA(LRINST,"I",0)),^LA(LRINST,"I",0)'=LRPROS S LRPROSX=^(0)
I $D(LRPROSX),LRPROSX'=LRPROS W !?7,LAROUT," routine is running - Now on entry ",LRPROSX S LRPROS=LRPROSX
I TOT=10,'$D(LRTOTX) W $C(7),!!?10,"No data is being processed OUT of ^LA( for ",LRINSTN
I TOT=10,'$D(LRPROSX) W $C(7),!!?10,"NO DATA IS BEING PROCESSED INTO ^LA( for ",LRINSTN
I TOT=10 G CLEAN
G LAB
Q
SYS I '$D(^LA(LRINST,"R")) W !?7,LRINSTN," IS NOT RUNNING ",! G CLEAN
S LRTOT=^LA(LRINST,"R")
SYS1 R X:.01 G:X="^" CLEAN H 10 S TOT=TOT+1 I '$D(^LA(LRINST,"R")) W !," DATA HAS BEEN CLEARED " G CLEAN
I ^LA(LRINST,"R")'=LRTOT W !,LRINSTN," IS RUNNING " S LRTOTX=1,LRTOT=^LA(LRINST,"R")
W !,"CHECKING " I TOT<10 G SYS1
I '$D(LRTOTX) W $C(7),!!,LAROUT," IS NOT RUNNING "
CLEAN ;
K I,DIC,LAB,LAROUT,LRINST,LRPROSX,LRPROS,LRTOT,TOT,LRINSTN,Y Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLASTATUS 1886 printed Dec 13, 2024@01:44:18 Page 2
LASTATUS ;SLC/FHS - TO CHECK SYSTEM STATUS OF AUTO INSTRUMENT JOBS ;11/6/89 12:03
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
EN ;
+1 DO CLEAN
WRITE !!
KILL DIC,LRPOSX,LRTOTX
SET (TOT,LAB)=0
SET DIC="^LAB(62.4,"
SET DIC(0)="AZEQ"
SET U="^"
SET DIC("S")="I +Y<99"
DO ^DIC
if Y<1
GOTO CLEAN
EN1 ;
+1 IF '$DATA(^LA(+Y,"I"))
WRITE !!?7,"No data for ",$PIECE(^LAB(62.4,+Y,0),U)
SET LREND=1
QUIT
+2 WRITE !!?10,"Enter '^' to abort process ",$CHAR(7),!
+3 SET LAROUT=$PIECE(Y(0),U,3)
SET LRINST=+Y
SET LRINSTN=$PIECE(Y,U,2)
+4 IF LRINST#10=1
SET LAB=1
+5 IF 'LAB
WRITE !!?10,LRINSTN," has ",^LA(LRINST,"I")," entries ",!
SET LRTOT=^("I")
IF $DATA(^("I",0))
WRITE !?10,"And ",^(0)," have been processed ",!
SET LRPROS=^(0)
LAB ;
+1 WRITE !!?10,"Checking process has started",!
+2 if LAB
GOTO SYS
READ X:.01
if X="^"
GOTO CLEAN
HANG 10
WRITE !!,"CHECKING ",LRINSTN,!
SET TOT=TOT+1
IF $DATA(^LA(LRINST,"I"))
IF ^("I")'=LRTOT
SET LRTOTX=^("I")
WRITE !,LRINSTN," is runing, now there are ",LRTOTX," entries in ^LA(",LRINST,!
SET LRTOT=LRTOTX
+3 IF '$DATA(^LA(LRINST,"I"))
WRITE !?10,LRINSTN," has been cleared "
GOTO CLEAN
+4 IF '$DATA(^LA(LRINST,"I",0))
WRITE !?10,LRINSTN," NOT BEEN COMPLETELY SET UP YET "
GOTO CLEAN
+5 IF $DATA(^LA(LRINST,"I",0))
IF ^LA(LRINST,"I",0)'=LRPROS
SET LRPROSX=^(0)
+6 IF $DATA(LRPROSX)
IF LRPROSX'=LRPROS
WRITE !?7,LAROUT," routine is running - Now on entry ",LRPROSX
SET LRPROS=LRPROSX
+7 IF TOT=10
IF '$DATA(LRTOTX)
WRITE $CHAR(7),!!?10,"No data is being processed OUT of ^LA( for ",LRINSTN
+8 IF TOT=10
IF '$DATA(LRPROSX)
WRITE $CHAR(7),!!?10,"NO DATA IS BEING PROCESSED INTO ^LA( for ",LRINSTN
+9 IF TOT=10
GOTO CLEAN
+10 GOTO LAB
+11 QUIT
SYS IF '$DATA(^LA(LRINST,"R"))
WRITE !?7,LRINSTN," IS NOT RUNNING ",!
GOTO CLEAN
+1 SET LRTOT=^LA(LRINST,"R")
SYS1 READ X:.01
if X="^"
GOTO CLEAN
HANG 10
SET TOT=TOT+1
IF '$DATA(^LA(LRINST,"R"))
WRITE !," DATA HAS BEEN CLEARED "
GOTO CLEAN
+1 IF ^LA(LRINST,"R")'=LRTOT
WRITE !,LRINSTN," IS RUNNING "
SET LRTOTX=1
SET LRTOT=^LA(LRINST,"R")
+2 WRITE !,"CHECKING "
IF TOT<10
GOTO SYS1
+3 IF '$DATA(LRTOTX)
WRITE $CHAR(7),!!,LAROUT," IS NOT RUNNING "
CLEAN ;
+1 KILL I,DIC,LAB,LAROUT,LRINST,LRPROSX,LRPROS,LRTOT,TOT,LRINSTN,Y
QUIT