LAJOB ;SLC/DCM - JOB AUTOMATED LAB ROUTINES ;4/27/89 09:41 ;
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
INST S U="^",$P(LRDASH,"-",79)="" W !!,"This is an option to manually start automated Lab routines that "
W !,"for some reason did not get started by the master lab program."
W !!,"Have you checked the status of the Lab computer (LSI)?" S %=1 D YN^DICN G @$S(%=1:"LA2",%=0:"INST",%=2:"LA3",1:"END")
LA3 D ASK^LA1103 W !!,"Is the Lab computer working?" S %=1 D YN^DICN G @$S(%=1:"LA2",%=0:"LA3",1:"END")
LA2 D STATUS
S DIC=62.4,DIC(0)="AEZMQ",DIC("S")="I Y<99" D ^DIC K DIC I Y<1 W !,"NO JOB SELECTED",! G END
S LRJOB=$P(^LAB(62.4,+Y,0),U,3),LRJOBN=+Y,ZTIO=""
S X=$S(LRJOBN>10:$E(LRJOBN-1,1)_1,1:1),(LRJOBIO,X)=$S($D(^LAB(62.4,X,0)):$P(^(0),U,2),1:"") I X']"" W !!?10,$C(7),"CAN NOT OPEN LAB PROGRAM DEVICE" G END
S IOP=X,%ZIS="NQ" D ^%ZIS I POP W !!?10,$C(7),X_" DEVICE IS UNKNOWN" G END
A ;
S (LREND,TOT,LAB)=0 D EN1^LASTATUS
W !,"Is the automated instrument routine running?" S %=2 D YN^DICN I %=1 W !,"You do not want to start a job that is running!!",$C(7) G END
G @$S(%=0:"A",%=2:"A1",1:"END")
A1 W !,"Do you want to start the automated ** { ",LRJOB," } ** routine now?" S %=1 D YN^DICN G A1:%=0 G END:%=2!(%=-1)
I LRJOBN#10=1 S T=LRJOBN,ZTIO=LRJOBIO D SET^LAB
JOB I '$D(^LA(LRJOBN,"I")) W !!,$C(7),"There is no data in that file to be processed!!! JOB NOT STARTED!!!",$C(7) G END
K ^LA("LOCK",LRJOBN) S ZTRTN=LRJOB,ZTDTH=$H S:'$D(ZTIO) ZTIO="" D ^%ZTLOAD K ZTSK,ZTRTN,ZTDTH W !,"Re-check later to see if job is running." G END
RONG W !!,$C(7),"The job selected is not interfaced to this computer!",!
END K I,LRPGM,LRTIME,LRIO,Y,DIC,LRJOB,LRJOBIO,LRJOBN,%,LRDASH,LREND Q
STATUS ;DISPLAY LSI STATUS.
W !! W LRDASH,! W !,?30,"LSI INTERFACE STATUS" W !,LRDASH,!
W !,?6,"INST.",?18,"DATA",?25,"DATA",?34,"++ PROGRAM STATUS LINK +++",?67,"DEVICE"
W !,?1," #",?6,"NAME",?18,"IN LA?",?25,"IN LAH?",?34,"NAME",?44,"ACTIVE",?52,"BY",?58,"TO",?67,"NAME"
W !,LRDASH,! F IX=0:0 S IX=$O(^LAB(62.4,IX)) Q:IX<1!(IX>90) D STA2
W !! K IX Q
STA2 S X=$S($D(^LAB(62.4,IX,0)):^(0),1:"") W !,?1,$J(IX,2),?6,$E($P(X,"^",1),1,10),?18,$S($D(^LA(IX,"I")):"Yes",1:"No"),?25,$S($D(^LAH(+$P(X,"^",4))):"Yes",1:"No")
W ?34,$P(X,"^",3),?44,$S($D(^LA("LOCK",IX)):"Yes",1:"No"),?52,$E($P(X,"^",7),1,3),?58 S Y=$P(X,"^",6) W $S(Y["LOG":"Acc.",Y["SEQN":"Seq.",Y["IDEN":"Invoice",Y["LLIST":"T/C",1:"")
W ?67,$E($P(X,"^",2),1,10) Q:'$D(^LA(IX,"ENV")) S X=^("ENV") W !?10,"[UCI = "_$P(X,U)_" ]",?30,"[VOL SET = "_$P(X,U,2)_" ]" I $L($P(X,U,3)) W ?50,"[VAX NODE = "_$P(X,U,3)_" ]" W !
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLAJOB 2615 printed Nov 22, 2024@16:52:58 Page 2
LAJOB ;SLC/DCM - JOB AUTOMATED LAB ROUTINES ;4/27/89 09:41 ;
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
INST SET U="^"
SET $PIECE(LRDASH,"-",79)=""
WRITE !!,"This is an option to manually start automated Lab routines that "
+1 WRITE !,"for some reason did not get started by the master lab program."
+2 WRITE !!,"Have you checked the status of the Lab computer (LSI)?"
SET %=1
DO YN^DICN
GOTO @$SELECT(%=1:"LA2",%=0:"INST",%=2:"LA3",1:"END")
LA3 DO ASK^LA1103
WRITE !!,"Is the Lab computer working?"
SET %=1
DO YN^DICN
GOTO @$SELECT(%=1:"LA2",%=0:"LA3",1:"END")
LA2 DO STATUS
+1 SET DIC=62.4
SET DIC(0)="AEZMQ"
SET DIC("S")="I Y<99"
DO ^DIC
KILL DIC
IF Y<1
WRITE !,"NO JOB SELECTED",!
GOTO END
+2 SET LRJOB=$PIECE(^LAB(62.4,+Y,0),U,3)
SET LRJOBN=+Y
SET ZTIO=""
+3 SET X=$SELECT(LRJOBN>10:$EXTRACT(LRJOBN-1,1)_1,1:1)
SET (LRJOBIO,X)=$SELECT($DATA(^LAB(62.4,X,0)):$PIECE(^(0),U,2),1:"")
IF X']""
WRITE !!?10,$CHAR(7),"CAN NOT OPEN LAB PROGRAM DEVICE"
GOTO END
+4 SET IOP=X
SET %ZIS="NQ"
DO ^%ZIS
IF POP
WRITE !!?10,$CHAR(7),X_" DEVICE IS UNKNOWN"
GOTO END
A ;
+1 SET (LREND,TOT,LAB)=0
DO EN1^LASTATUS
+2 WRITE !,"Is the automated instrument routine running?"
SET %=2
DO YN^DICN
IF %=1
WRITE !,"You do not want to start a job that is running!!",$CHAR(7)
GOTO END
+3 GOTO @$SELECT(%=0:"A",%=2:"A1",1:"END")
A1 WRITE !,"Do you want to start the automated ** { ",LRJOB," } ** routine now?"
SET %=1
DO YN^DICN
if %=0
GOTO A1
if %=2!(%=-1)
GOTO END
+1 IF LRJOBN#10=1
SET T=LRJOBN
SET ZTIO=LRJOBIO
DO SET^LAB
JOB IF '$DATA(^LA(LRJOBN,"I"))
WRITE !!,$CHAR(7),"There is no data in that file to be processed!!! JOB NOT STARTED!!!",$CHAR(7)
GOTO END
+1 KILL ^LA("LOCK",LRJOBN)
SET ZTRTN=LRJOB
SET ZTDTH=$HOROLOG
if '$DATA(ZTIO)
SET ZTIO=""
DO ^%ZTLOAD
KILL ZTSK,ZTRTN,ZTDTH
WRITE !,"Re-check later to see if job is running."
GOTO END
RONG WRITE !!,$CHAR(7),"The job selected is not interfaced to this computer!",!
END KILL I,LRPGM,LRTIME,LRIO,Y,DIC,LRJOB,LRJOBIO,LRJOBN,%,LRDASH,LREND
QUIT
STATUS ;DISPLAY LSI STATUS.
+1 WRITE !!
WRITE LRDASH,!
WRITE !,?30,"LSI INTERFACE STATUS"
WRITE !,LRDASH,!
+2 WRITE !,?6,"INST.",?18,"DATA",?25,"DATA",?34,"++ PROGRAM STATUS LINK +++",?67,"DEVICE"
+3 WRITE !,?1," #",?6,"NAME",?18,"IN LA?",?25,"IN LAH?",?34,"NAME",?44,"ACTIVE",?52,"BY",?58,"TO",?67,"NAME"
+4 WRITE !,LRDASH,!
FOR IX=0:0
SET IX=$ORDER(^LAB(62.4,IX))
if IX<1!(IX>90)
QUIT
DO STA2
+5 WRITE !!
KILL IX
QUIT
STA2 SET X=$SELECT($DATA(^LAB(62.4,IX,0)):^(0),1:"")
WRITE !,?1,$JUSTIFY(IX,2),?6,$EXTRACT($PIECE(X,"^",1),1,10),?18,$SELECT($DATA(^LA(IX,"I")):"Yes",1:"No"),?25,$SELECT($DATA(^LAH(+$PIECE(X,"^",4))):"Yes",1:"No")
+1 WRITE ?34,$PIECE(X,"^",3),?44,$SELECT($DATA(^LA("LOCK",IX)):"Yes",1:"No"),?52,$EXTRACT($PIECE(X,"^",7),1,3),?58
SET Y=$PIECE(X,"^",6)
WRITE $SELECT(Y["LOG":"Acc.",Y["SEQN":"Seq.",Y["IDEN":"Invoice",Y["LLIST":"T/C",1:"")
+2 WRITE ?67,$EXTRACT($PIECE(X,"^",2),1,10)
if '$DATA(^LA(IX,"ENV"))
QUIT
SET X=^("ENV")
WRITE !?10,"[UCI = "_$PIECE(X,U)_" ]",?30,"[VOL SET = "_$PIECE(X,U,2)_" ]"
IF $LENGTH($PIECE(X,U,3))
WRITE ?50,"[VAX NODE = "_$PIECE(X,U,3)_" ]"
WRITE !
+3 QUIT