LADJOB ;SLC/DLG - JOB DIRECT CONNECTED AUTOMATED LAB ROUTINES ;6/25/90 13:46
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
INST S U="^" W !,"This is an option to start/restart direct connected automated Lab routines. " D STATUS
S DIC=62.4,DIC(0)="AEMQ",DIC("S")="I Y<99,(Y#10'=1)" 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 (LRJOBIO,X)=$S($D(^LAB(62.4,LRJOBN,0)):$P(^(0),U,2),1:"") G END:X']""
S IOP=X,%ZIS="NQ" D ^%ZIS I POP W !!?7,$C(7),"CAN'T OPEN "_X_" DEVICE" G END
I ^%ZOSF("VOL")'=$P(^%ZIS(1,IOS,0),U,9),$P(^(0),U,9)]"" G RONG
A W !!!,"System status will tell you if the direct connect routine is running.",!,"Look for the name of the routine ",$P(LRJOB,U,2)," in the system status.",!!
X $S($D(^%ZOSF("SY")):^("SY"),1:^%ZOSF("SS")) D ^LRPARAM
W !,"Is the routine name ",$P(LRJOB,U,2)," listed in the system status?" S %=2 D YN^DICN I %=1 W !,"You do not want to start a job that is running!!",$C(7) G END
W !,"Do you want to start the direct connect ",LRJOB," routine now?" S %=1 D YN^DICN G END:%'=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 ZTDESC="Direct Connect Instrument",ZTRTN=LRJOB,ZTDTH=$H D ^%ZTLOAD K ZTSK,ZTRTN,LRJOB,ZTDTH W !,"Check system status to see if job started."
H 5 W "." H 5 X $S($D(^%ZOSF("SS")):^("SS"),1:^%ZOSF("SY")) D ^LRPARAM
END K I,LRPGM,LRTIME,LRIO,Y,DIC,LRJOB,LRJOBN,% Q
RONG W !!,$C(7),"The job selected is not interfaced to this computer",!! G END
STATUS ;DISPLAY LSI STATUS.
W !! D DASH W !,?18,"DIRECT CONNECT AUTOINSTRUMENT INTERFACE STATUS",! D DASH
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"
D DASH F IX=0:0 S IX=$O(^LAB(62.4,IX)) Q:IX<1!(IX>99) I IX#10>1,($P(^LAB(62.4,IX,0),U,2)]"") 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
DASH S X="",$P(X,"-",79)="" W !,X Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLADJOB 2463 printed Nov 22, 2024@16:52:22 Page 2
LADJOB ;SLC/DLG - JOB DIRECT CONNECTED AUTOMATED LAB ROUTINES ;6/25/90 13:46
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
INST SET U="^"
WRITE !,"This is an option to start/restart direct connected automated Lab routines. "
DO STATUS
+1 SET DIC=62.4
SET DIC(0)="AEMQ"
SET DIC("S")="I Y<99,(Y#10'=1)"
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 (LRJOBIO,X)=$SELECT($DATA(^LAB(62.4,LRJOBN,0)):$PIECE(^(0),U,2),1:"")
if X']""
GOTO END
+4 SET IOP=X
SET %ZIS="NQ"
DO ^%ZIS
IF POP
WRITE !!?7,$CHAR(7),"CAN'T OPEN "_X_" DEVICE"
GOTO END
+5 IF ^%ZOSF("VOL")'=$PIECE(^%ZIS(1,IOS,0),U,9)
IF $PIECE(^(0),U,9)]""
GOTO RONG
A WRITE !!!,"System status will tell you if the direct connect routine is running.",!,"Look for the name of the routine ",$PIECE(LRJOB,U,2)," in the system status.",!!
+1 XECUTE $SELECT($DATA(^%ZOSF("SY")):^("SY"),1:^%ZOSF("SS"))
DO ^LRPARAM
+2 WRITE !,"Is the routine name ",$PIECE(LRJOB,U,2)," listed in the system status?"
SET %=2
DO YN^DICN
IF %=1
WRITE !,"You do not want to start a job that is running!!",$CHAR(7)
GOTO END
+3 WRITE !,"Do you want to start the direct connect ",LRJOB," routine now?"
SET %=1
DO YN^DICN
if %'=1
GOTO END
+4 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 ZTDESC="Direct Connect Instrument"
SET ZTRTN=LRJOB
SET ZTDTH=$HOROLOG
DO ^%ZTLOAD
KILL ZTSK,ZTRTN,LRJOB,ZTDTH
WRITE !,"Check system status to see if job started."
+2 HANG 5
WRITE "."
HANG 5
XECUTE $SELECT($DATA(^%ZOSF("SS")):^("SS"),1:^%ZOSF("SY"))
DO ^LRPARAM
END KILL I,LRPGM,LRTIME,LRIO,Y,DIC,LRJOB,LRJOBN,%
QUIT
RONG WRITE !!,$CHAR(7),"The job selected is not interfaced to this computer",!!
GOTO END
STATUS ;DISPLAY LSI STATUS.
+1 WRITE !!
DO DASH
WRITE !,?18,"DIRECT CONNECT AUTOINSTRUMENT INTERFACE STATUS",!
DO DASH
+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 DO DASH
FOR IX=0:0
SET IX=$ORDER(^LAB(62.4,IX))
if IX<1!(IX>99)
QUIT
IF IX#10>1
IF ($PIECE(^LAB(62.4,IX,0),U,2)]"")
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)
QUIT
DASH SET X=""
SET $PIECE(X,"-",79)=""
WRITE !,X
QUIT