LA7ADL2 ;DALISC/JMC - Start/Stop Automatic Download of Test Orders ; 1/30/95 09:00;
;;5.2;LAB MESSAGING;**23,27**;Sep 27, 1994
;
EN ; Entry point to flag auto download to start/stop.
N DIR,DIRUT,DTOUT,DUOUT,X,Y,Z
S Z=$$SHOWST^LA7ADL1
S Z("CNT")=$$LACHK^LA7CHKF
S DIR(0)="SO^1:Start/Restart Auto Download Job;2:Shutdown Auto Download Job;3:Shutdown Auto Download Job and Stop Collecting Accessions"
S DIR("A")="Select action"
S DIR("A",1)="Current Status is: "_$P(Z,"^")
I $L($P(Z,"^",2)) D
. S DIR("A",2)=" at: "_$P(Z,"^",2)
. S DIR("A",3)=" by: "_$P(Z,"^",3)
. S DIR("A",4)="There are "_$S(Z("CNT"):Z("CNT"),1:"NO")_" accessions waiting checking"
. S DIR("A",5)=" "
E S DIR("A",2)="There are "_$S(Z("CNT"):Z("CNT"),1:"NO")_" accessions waiting checking",DIR("A",3)=" "
K X,Y
S DIR("?",1)="1 - Start/Restart the auto download job after changes have been made to"
S DIR("?",2)=" file #62.4, AUTO INSTRUMENT, that affect auto downloading,"
S DIR("?",3)=" i.e. instrument auto download status changed, tests added/removed,"
S DIR("?",4)=" download code changed, etc. or if background job is not running."
S DIR("?",5)=" "
S DIR("?",6)="2 - Shuts down auto download background job and set flag to not start."
S DIR("?",7)=" Accessions are still collected in list to be downloaded when"
S DIR("?",8)=" auto download job is started."
S DIR("?",9)=" "
S DIR("?")="3 - Same as 2 but stops collecting accessions to download."
D ^DIR
I $D(DIRUT) Q ; No selection by user.
I Y>0 D
. D SETSTOP^LA7ADL1(+Y,$G(DUZ)) ; Set node to flag auto download job.
. S Z=$$SHOWST^LA7ADL1
. W !,"Auto Download flag set to ",$P(Z,"^"),!
I +Y=1 D ; Task auto down to run in case it is not running.
. D ZTSK^LA7ADL
. W "Auto Download "
. I $D(ZTSK) W "- Queued to run as task #",ZTSK,! Q
. W $C(7),"- not tasked",!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLA7ADL2 1910 printed Oct 16, 2024@17:39:49 Page 2
LA7ADL2 ;DALISC/JMC - Start/Stop Automatic Download of Test Orders ; 1/30/95 09:00;
+1 ;;5.2;LAB MESSAGING;**23,27**;Sep 27, 1994
+2 ;
EN ; Entry point to flag auto download to start/stop.
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y,Z
+2 SET Z=$$SHOWST^LA7ADL1
+3 SET Z("CNT")=$$LACHK^LA7CHKF
+4 SET DIR(0)="SO^1:Start/Restart Auto Download Job;2:Shutdown Auto Download Job;3:Shutdown Auto Download Job and Stop Collecting Accessions"
+5 SET DIR("A")="Select action"
+6 SET DIR("A",1)="Current Status is: "_$PIECE(Z,"^")
+7 IF $LENGTH($PIECE(Z,"^",2))
Begin DoDot:1
+8 SET DIR("A",2)=" at: "_$PIECE(Z,"^",2)
+9 SET DIR("A",3)=" by: "_$PIECE(Z,"^",3)
+10 SET DIR("A",4)="There are "_$SELECT(Z("CNT"):Z("CNT"),1:"NO")_" accessions waiting checking"
+11 SET DIR("A",5)=" "
End DoDot:1
+12 IF '$TEST
SET DIR("A",2)="There are "_$SELECT(Z("CNT"):Z("CNT"),1:"NO")_" accessions waiting checking"
SET DIR("A",3)=" "
+13 KILL X,Y
+14 SET DIR("?",1)="1 - Start/Restart the auto download job after changes have been made to"
+15 SET DIR("?",2)=" file #62.4, AUTO INSTRUMENT, that affect auto downloading,"
+16 SET DIR("?",3)=" i.e. instrument auto download status changed, tests added/removed,"
+17 SET DIR("?",4)=" download code changed, etc. or if background job is not running."
+18 SET DIR("?",5)=" "
+19 SET DIR("?",6)="2 - Shuts down auto download background job and set flag to not start."
+20 SET DIR("?",7)=" Accessions are still collected in list to be downloaded when"
+21 SET DIR("?",8)=" auto download job is started."
+22 SET DIR("?",9)=" "
+23 SET DIR("?")="3 - Same as 2 but stops collecting accessions to download."
+24 DO ^DIR
+25 ; No selection by user.
IF $DATA(DIRUT)
QUIT
+26 IF Y>0
Begin DoDot:1
+27 ; Set node to flag auto download job.
DO SETSTOP^LA7ADL1(+Y,$GET(DUZ))
+28 SET Z=$$SHOWST^LA7ADL1
+29 WRITE !,"Auto Download flag set to ",$PIECE(Z,"^"),!
End DoDot:1
+30 ; Task auto down to run in case it is not running.
IF +Y=1
Begin DoDot:1
+31 DO ZTSK^LA7ADL
+32 WRITE "Auto Download "
+33 IF $DATA(ZTSK)
WRITE "- Queued to run as task #",ZTSK,!
QUIT
+34 WRITE $CHAR(7),"- not tasked",!
End DoDot:1
+35 QUIT