LRWATCH ;SLC/RWF/FHS- WATCH DATA IN ^LA GLOBAL ;8/8/89 11:36 ;
;;V~5.0~;LAB;**42**;02/27/90 17:09
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\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,*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 *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="" 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,LRTSK,%,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
Q
LRWATCH ;SLC/RWF/FHS- WATCH DATA IN ^LA GLOBAL ;8/8/89 11:36 ;
+1 ;;V~5.0~;LAB;**42**;02/27/90 17:09
+2 SET U="^"
WRITE !,"THIS ROUTINE WILL ALLOW YOU TO WATCH THE ACCUMULATION",!," OF DATA IN THE ^LA GLOBAL"
+3 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\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,*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 *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
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,LRTSK,%,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
+3 QUIT