LAWATCH ;DALOI/JMC - WATCH DATA IN ^LA GLOBAL ;12/07/11 12:18
;;5.2;AUTOMATED LAB INSTRUMENTS;**74**;Sep 27, 1994;Build 229
;
;
IN ; Query user for ^LA or ^LAH
;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
D Q:$D(DIRUT)
. K DIR
. S DIR(0)="SO^1:RAW DATA IN LA GLOBAL;2:VERIFIABLE DATA IN LAH GLOBAL",DIR("A")="Select a File to watch"
. D ^DIR
. I $D(DIRUT) Q
. I Y=1 D START Q
. I Y=2 D ^LAHWATCH
Q
;
;
START ;
S U="^" W !,"THIS ROUTINE WILL ALLOW YOU TO WATCH THE ACCUMULATION",!," OF DATA IN THE ^LA GLOBAL"
N DIC
S DIC="^LAB(62.4,",DIC(0)="AEMQ" D ^DIC G QUIT:Y<1 S LRTSK=+Y,LRINST=$P(Y,"^",2)
;
DOWN ;
W !?7,"Do you wish to See 'Download data' " S %=1 D YN^DICN G QUIT:%<1 I %=1 D LA0
;
;
DATA ;
W !!?7,"Do you wish to look at 'Upload' data nodes " S %=1 D YN^DICN G QUIT:%<1!(%=2) S LANODE="I"
;
;
LA1 G LA2:$D(^LA(LRTSK,"I",0)),NOTSYS:LRTSK#10=1,NOSYS:$D(^LA(+(LRTSK-1\10_1),"I",0))[0
W !?3,"There isn't any data there! Should I start saving the data" S %=2 D YN^DICN G QUIT:%=2!(%=-1) W !,"This will prevent the automatic processing of the data." G LA1:%=0
I '$D(^LA(LRTSK,"I",0))#2 S ^LA(LRTSK,"I")=0,^("I",0)=0 W !!?10,$C(7),"YOU MUST MANUALLY START THE ( "_$P(^LAB(62.4,LRTSK,0),U,3)_") PROGRAM " G QUIT
;
LA2 ;
R !?5,"Begin with what number ? ",I7:DTIME Q:'$T!(I7="^")
S I7=+I7 I '$D(^LA(LRTSK,LANODE,I7)) W $C(7),!?10,I7," DOES NOT EXIST ",! G LA2
;
;
LA3 ;
W !!!,LRINST,!," Number of Records: ",$S($D(^LA(LRTSK,LANODE))#2:^(LANODE),1:"??"),?$X+5,"Processed Records: ",$S($D(^LA(LRTSK,LANODE,0))#2:^(0),1:"??") W:$D(^LA("LOCK",LRTSK)) " Active flag SET."
R !!?7,"To stop data display enter '^' ENTER RETURN TO CONTINUE ",X:DTIME G QUIT:X="^"
S I=I7-.1 F I=I7-.1:0 S I=$O(^LA(LRTSK,LANODE,I)) Q:I="" Q:('$D(^LA(LRTSK,LANODE,I))) W !,"^LA(",LRTSK,",",LANODE,",",I,")=",^(I) S I7=I R X:.01 I X="^" Q
R !!,"PRESS RETURN TO CONTINUE, ENTER '^' TO STOP. ",X:DTIME G END:'$T,LA2:X=""
Q:LANODE="O"
;
;
END ;
G QUIT:LRTSK#10=1
W !,"CLEAR INSTRUMENT ",LRINST," DATE IN ^LA(",LRTSK,") FIRST" S %=2 D YN^DICN I %=1 K ^LA(LRTSK)
I %<1 S XQH="LRHC LRWATCH" D EN^XQH G END
W:%'=1 !,"Be sure to startup the instrument routine from the menu.",!?10,"It will NOT start on its own now."
QUIT ;
K DIC,T,LANODE,%,ER,I7,LRTSK
Q
;
;
NOTSYS W !!,"You can't start saving data for a interface routine." G QUIT
;
;
NOSYS W !!,"The LAB routine for the instrument isn't running so there",!,"is no need to continue as data will never arrive." G QUIT
;
;
LA0 ; View down load data for instrument
I '$D(^LA(LRTSK,"O")) W !?7,"There is no down load data " R !," PRESS RETURN TO CONTINUE ",X:DTIME Q
S LANODE="O" D LA2
;
;
DONE Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLAWATCH 2720 printed Dec 13, 2024@01:44:24 Page 2
LAWATCH ;DALOI/JMC - WATCH DATA IN ^LA GLOBAL ;12/07/11 12:18
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;**74**;Sep 27, 1994;Build 229
+2 ;
+3 ;
IN ; Query user for ^LA or ^LAH
+1 ;
+2 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+3 Begin DoDot:1
+4 KILL DIR
+5 SET DIR(0)="SO^1:RAW DATA IN LA GLOBAL;2:VERIFIABLE DATA IN LAH GLOBAL"
SET DIR("A")="Select a File to watch"
+6 DO ^DIR
+7 IF $DATA(DIRUT)
QUIT
+8 IF Y=1
DO START
QUIT
+9 IF Y=2
DO ^LAHWATCH
End DoDot:1
if $DATA(DIRUT)
QUIT
+10 QUIT
+11 ;
+12 ;
START ;
+1 SET U="^"
WRITE !,"THIS ROUTINE WILL ALLOW YOU TO WATCH THE ACCUMULATION",!," OF DATA IN THE ^LA GLOBAL"
+2 NEW DIC
+3 SET DIC="^LAB(62.4,"
SET DIC(0)="AEMQ"
DO ^DIC
if Y<1
GOTO QUIT
SET LRTSK=+Y
SET LRINST=$PIECE(Y,"^",2)
+4 ;
DOWN ;
+1 WRITE !?7,"Do you wish to See 'Download data' "
SET %=1
DO YN^DICN
if %<1
GOTO QUIT
IF %=1
DO LA0
+2 ;
+3 ;
DATA ;
+1 WRITE !!?7,"Do you wish to look at 'Upload' data nodes "
SET %=1
DO YN^DICN
if %<1!(%=2)
GOTO QUIT
SET LANODE="I"
+2 ;
+3 ;
LA1 if $DATA(^LA(LRTSK,"I",0))
GOTO LA2
if LRTSK#10=1
GOTO NOTSYS
if $DATA(^LA(+(LRTSK-1\10_1),"I",0))[0
GOTO NOSYS
+1 WRITE !?3,"There isn't any data there! Should I start saving the data"
SET %=2
DO YN^DICN
if %=2!(%=-1)
GOTO QUIT
WRITE !,"This will prevent the automatic processing of the data."
if %=0
GOTO LA1
+2 IF '$DATA(^LA(LRTSK,"I",0))#2
SET ^LA(LRTSK,"I")=0
SET ^("I",0)=0
WRITE !!?10,$CHAR(7),"YOU MUST MANUALLY START THE ( "_$PIECE(^LAB(62.4,LRTSK,0),U,3)_") PROGRAM "
GOTO QUIT
+3 ;
LA2 ;
+1 READ !?5,"Begin with what number ? ",I7:DTIME
if '$TEST!(I7="^")
QUIT
+2 SET I7=+I7
IF '$DATA(^LA(LRTSK,LANODE,I7))
WRITE $CHAR(7),!?10,I7," DOES NOT EXIST ",!
GOTO LA2
+3 ;
+4 ;
LA3 ;
+1 WRITE !!!,LRINST,!," Number of Records: ",$SELECT($DATA(^LA(LRTSK,LANODE))#2:^(LANODE),1:"??"),?$X+5,"Processed Records: ",$SELECT($DATA(^LA(LRTSK,LANODE,0))#2:^(0),1:"??")
if $DATA(^LA("LOCK",LRTSK))
WRITE " Active flag SET."
+2 READ !!?7,"To stop data display enter '^' ENTER RETURN TO CONTINUE ",X:DTIME
if X="^"
GOTO QUIT
+3 SET I=I7-.1
FOR I=I7-.1:0
SET I=$ORDER(^LA(LRTSK,LANODE,I))
if I=""
QUIT
if ('$DATA(^LA(LRTSK,LANODE,I)))
QUIT
WRITE !,"^LA(",LRTSK,",",LANODE,",",I,")=",^(I)
SET I7=I
READ X:.01
IF X="^"
QUIT
+4 READ !!,"PRESS RETURN TO CONTINUE, ENTER '^' TO STOP. ",X:DTIME
if '$TEST
GOTO END
if X=""
GOTO LA2
+5 if LANODE="O"
QUIT
+6 ;
+7 ;
END ;
+1 if LRTSK#10=1
GOTO QUIT
+2 WRITE !,"CLEAR INSTRUMENT ",LRINST," DATE IN ^LA(",LRTSK,") FIRST"
SET %=2
DO YN^DICN
IF %=1
KILL ^LA(LRTSK)
+3 IF %<1
SET XQH="LRHC LRWATCH"
DO EN^XQH
GOTO END
+4 if %'=1
WRITE !,"Be sure to startup the instrument routine from the menu.",!?10,"It will NOT start on its own now."
QUIT ;
+1 KILL DIC,T,LANODE,%,ER,I7,LRTSK
+2 QUIT
+3 ;
+4 ;
NOTSYS WRITE !!,"You can't start saving data for a interface routine."
GOTO QUIT
+1 ;
+2 ;
NOSYS WRITE !!,"The LAB routine for the instrument isn't running so there",!,"is no need to continue as data will never arrive."
GOTO QUIT
+1 ;
+2 ;
LA0 ; View down load data for instrument
+1 IF '$DATA(^LA(LRTSK,"O"))
WRITE !?7,"There is no down load data "
READ !," PRESS RETURN TO CONTINUE ",X:DTIME
QUIT
+2 SET LANODE="O"
DO LA2
+3 ;
+4 ;
DONE QUIT