LAWATCH ; IHS/DIR/FJE - WATCH DATA IN ^LA GLOBAL 8/8/89 11:36 ;
;;5.2;LA;;NOV 01, 1997
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
IN ;DALISC/TNN - Query user for ^LA or ^LAH - 02/02/93
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 K DIR Q:$D(DIRUT)
I X=2 D G IN
. D ^LAHWATCH
. QUIT
;DALISC/TNN - End of query
START S U="^" W !,"THIS ROUTINE WILL ALLOW YOU TO WATCH THE ACCUMULATION",!," OF DATA IN THE ^LA GLOBAL"
K DIC S DIC="^LAB(62.4,",DIC(0)="AEMQ",DIC("S")="I Y<100" 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
W !?3,"There isn't any data there! Should I leave the data in ^LA?" S %=2 D YN^DICN G QUIT:%=2!(%=-1) W !,"This will prevent the automatic processing of the data." G LA1:%=0 ;IHS/ANMC/CLS 11/1/95
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 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
LAWATCH ; IHS/DIR/FJE - WATCH DATA IN ^LA GLOBAL 8/8/89 11:36 ;
+1 ;;5.2;LA;;NOV 01, 1997
+2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
IN ;DALISC/TNN - Query user for ^LA or ^LAH - 02/02/93
+1 KILL DIR
SET DIR(0)="SO^1:RAW DATA IN LA GLOBAL;2:VERIFIABLE DATA IN LAH GLOBAL"
SET DIR("A")="Select a File to watch"
+2 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
QUIT
+3 IF X=2
Begin DoDot:1
+4 DO ^LAHWATCH
+5 QUIT
End DoDot:1
GOTO IN
+6 ;DALISC/TNN - End of query
START SET U="^"
WRITE !,"THIS ROUTINE WILL ALLOW YOU TO WATCH THE ACCUMULATION",!," OF DATA IN THE ^LA GLOBAL"
+1 KILL DIC
SET DIC="^LAB(62.4,"
SET DIC(0)="AEMQ"
SET DIC("S")="I Y<100"
DO ^DIC
IF Y<1
GOTO QUIT
SET LRTSK=+Y
SET LRINST=$PIECE(Y,"^",2)
DOWN WRITE !?7,"Do you wish to See 'Download data' "
SET %=1
DO YN^DICN
IF %<1
GOTO QUIT
IF %=1
DO LA0
DATA WRITE !!?7,"Do you wish to look at 'Upload' data nodes "
SET %=1
DO YN^DICN
IF %<1!(%=2)
GOTO QUIT
SET LANODE="I"
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 ;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
+2 ;IHS/ANMC/CLS 11/1/95
WRITE !?3,"There isn't any data there! Should I leave the data in ^LA?"
SET %=2
DO YN^DICN
IF %=2!(%=-1)
GOTO QUIT
WRITE !,"This will prevent the automatic processing of the data."
IF %=0
GOTO LA1
+3 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
LA2 READ !?5,"Begin with what number ? ",I7:DTIME
IF '$TEST!(I7="^")
QUIT
SET I7=+I7
IF '$DATA(^LA(LRTSK,LANODE,I7))
WRITE $CHAR(7),!?10,I7," DOES NOT EXIST ",!
GOTO LA2
LA3 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."
+1 READ !!?7,"To stop data display enter '^' ENTER RETURN TO CONTINUE ",X:DTIME
IF X="^"
GOTO QUIT
+2 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
+3 READ !!,"PRESS RETURN TO CONTINUE, ENTER '^' TO STOP. ",X:DTIME
IF '$TEST
GOTO END
IF X=""
GOTO LA2
+4 IF LANODE="O"
QUIT
END IF LRTSK#10=1
GOTO QUIT
WRITE !,"CLEAR INSTRUMENT ",LRINST," DATE IN ^LA(",LRTSK,") FIRST"
SET %=2
DO YN^DICN
IF %=1
KILL ^LA(LRTSK)
+1 IF %<1
SET XQH="LRHC LRWATCH"
DO EN^XQH
GOTO END
+2 IF %'=1
WRITE !,"Be sure to startup the instrument routine from the menu.",!?10,"It will NOT start on its own now."
QUIT KILL DIC,T,LANODE,%,ER,I7
QUIT
NOTSYS WRITE !!,"You can't start saving data for a interface routine."
GOTO QUIT
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
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
DONE QUIT