RGEQDMN1 ;BHM/RGY-DEQUEUE PROCESSOR CONTINUED ;2/17/98
;;1.0;CLINICAL INFO RESOURCE NETWORK;**19**;30 Apr 99
STOP ;Stop dequeue processor
NEW ENT,DIR,DTOUT,DUOUT,DIRUT,DIE,DA,DR,Y,STAT
S DIR("A")="Do you want to stop ALL MPI/PD processing"
S DIR(0)="Y",DIR("B")="NO"
D ^DIR K DIR Q:$D(DIRUT)
I Y=1 S ^RGEQ("ASTOP")="YES" W " ... Done" Q
S DIR("A")="Do you want to ENABLE/DISABLE a particular data class"
S DIR(0)="Y",DIR("B")="NO"
D ^DIR K DIR Q:$D(DIRUT)
I Y=1 D
.S DIR(0)="PO^995:QEAM",DIR("A")="Select MPI/PD Data Class"
.D ^DIR K DIR Q:$D(DIRUT)
.S ENT=+Y,STAT=+$P(^RGEQASN(ENT,0),"^",5)
.W !
.S DIR("A",1)="NOTE: This class is currently "_$P("enabled^disabled","^",STAT+1)
.S DIR("A")=" ...Do you want to "_$P("DISABLE^ENABLE","^",STAT+1)
.S DIR(0)="Y",DIR("B")="NO"
.D ^DIR K DIR Q:$D(DIRUT)
.I Y=0 Q
.S DIE="^RGEQASN(",DA=ENT,DR="5////^S X="_$P("1^0","^",STAT+1) D ^DIE
.W " ...Done."
.Q
Q
START ;Start the queue processor
NEW DIR,DTOUT,DUOUT,DIRUT,ZTSK,ZTIO,ZTRTN,ZTSAVE,ZTDESC
L +^RGEQ("MAIN"):0 E D Q
.W !!,"The MPI/PD processor is already running!"
.Q
L -^RGEQ("MAIN")
S DIR("A")="Are you sure you want to start the MPI/PD processor"
S DIR(0)="Y",DIR("B")="NO"
D ^DIR K DIR Q:$D(DIRUT)
I Y=1 D Q
.S ZTRTN="MAIN^RGEQDMN",ZTDESC="'MAIN' MPI/PD process"
.S ZTREQ="@",ZTDTH=$H,ZTIO=""
.D ^%ZTLOAD
.I $G(ZTSK) W " ... done."
.S ^RGEQ("ASTOP")="NO"
.Q
W "...NOT queued"
Q
AUTO ;Automatically start background process
NEW ZTSK,ZTIO,ZTRTN,ZTSAVE,ZTDESC
L +^RGEQ("MAIN"):0 E Q
L -^RGEQ("MAIN")
S ZTRTN="MAIN^RGEQDMN",ZTDESC="'MAIN' MPI/PD process"
S ZTREQ="@",ZTDTH=$H,ZTIO=""
D ^%ZTLOAD
S ^RGEQ("ASTOP")="NO"
Q
TEST(TYPE,PARAM,ERROR,HL7) ;Test queue processor
Q
ESTOP(TYPE) ;Check to see if filer should stop
I ($G(^RGEQ("ASTOP"))="YES")!($$SEND^RGJUSITE=0) Q 1
I TYPE="MAIN" Q 0
Q ($$SEND^RGJUSITE=2)!(+$P($G(^RGEQASN(+$O(^RGEQASN("B",TYPE,0)),0)),"^",5))
STATUS ;check current status of event queue, used for menu entry actions
;added by CML 4/1/99
L +^RGEQ("MAIN"):0 E D Q
.W !!,"=> MPI/PD Event Queue processor is currently running.",!
.Q
W $C(7),$C(7),!!,"=> MPI/PD Event Queue processor is <<NOT>> currently running.",!
L -^RGEQ("MAIN")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRGEQDMN1 2321 printed Oct 16, 2024@17:42:26 Page 2
RGEQDMN1 ;BHM/RGY-DEQUEUE PROCESSOR CONTINUED ;2/17/98
+1 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**19**;30 Apr 99
STOP ;Stop dequeue processor
+1 NEW ENT,DIR,DTOUT,DUOUT,DIRUT,DIE,DA,DR,Y,STAT
+2 SET DIR("A")="Do you want to stop ALL MPI/PD processing"
+3 SET DIR(0)="Y"
SET DIR("B")="NO"
+4 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+5 IF Y=1
SET ^RGEQ("ASTOP")="YES"
WRITE " ... Done"
QUIT
+6 SET DIR("A")="Do you want to ENABLE/DISABLE a particular data class"
+7 SET DIR(0)="Y"
SET DIR("B")="NO"
+8 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+9 IF Y=1
Begin DoDot:1
+10 SET DIR(0)="PO^995:QEAM"
SET DIR("A")="Select MPI/PD Data Class"
+11 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+12 SET ENT=+Y
SET STAT=+$PIECE(^RGEQASN(ENT,0),"^",5)
+13 WRITE !
+14 SET DIR("A",1)="NOTE: This class is currently "_$PIECE("enabled^disabled","^",STAT+1)
+15 SET DIR("A")=" ...Do you want to "_$PIECE("DISABLE^ENABLE","^",STAT+1)
+16 SET DIR(0)="Y"
SET DIR("B")="NO"
+17 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+18 IF Y=0
QUIT
+19 SET DIE="^RGEQASN("
SET DA=ENT
SET DR="5////^S X="_$PIECE("1^0","^",STAT+1)
DO ^DIE
+20 WRITE " ...Done."
+21 QUIT
End DoDot:1
+22 QUIT
START ;Start the queue processor
+1 NEW DIR,DTOUT,DUOUT,DIRUT,ZTSK,ZTIO,ZTRTN,ZTSAVE,ZTDESC
+2 LOCK +^RGEQ("MAIN"):0
IF '$TEST
Begin DoDot:1
+3 WRITE !!,"The MPI/PD processor is already running!"
+4 QUIT
End DoDot:1
QUIT
+5 LOCK -^RGEQ("MAIN")
+6 SET DIR("A")="Are you sure you want to start the MPI/PD processor"
+7 SET DIR(0)="Y"
SET DIR("B")="NO"
+8 DO ^DIR
KILL DIR
if $DATA(DIRUT)
QUIT
+9 IF Y=1
Begin DoDot:1
+10 SET ZTRTN="MAIN^RGEQDMN"
SET ZTDESC="'MAIN' MPI/PD process"
+11 SET ZTREQ="@"
SET ZTDTH=$HOROLOG
SET ZTIO=""
+12 DO ^%ZTLOAD
+13 IF $GET(ZTSK)
WRITE " ... done."
+14 SET ^RGEQ("ASTOP")="NO"
+15 QUIT
End DoDot:1
QUIT
+16 WRITE "...NOT queued"
+17 QUIT
AUTO ;Automatically start background process
+1 NEW ZTSK,ZTIO,ZTRTN,ZTSAVE,ZTDESC
+2 LOCK +^RGEQ("MAIN"):0
IF '$TEST
QUIT
+3 LOCK -^RGEQ("MAIN")
+4 SET ZTRTN="MAIN^RGEQDMN"
SET ZTDESC="'MAIN' MPI/PD process"
+5 SET ZTREQ="@"
SET ZTDTH=$HOROLOG
SET ZTIO=""
+6 DO ^%ZTLOAD
+7 SET ^RGEQ("ASTOP")="NO"
+8 QUIT
TEST(TYPE,PARAM,ERROR,HL7) ;Test queue processor
+1 QUIT
ESTOP(TYPE) ;Check to see if filer should stop
+1 IF ($GET(^RGEQ("ASTOP"))="YES")!($$SEND^RGJUSITE=0)
QUIT 1
+2 IF TYPE="MAIN"
QUIT 0
+3 QUIT ($$SEND^RGJUSITE=2)!(+$PIECE($GET(^RGEQASN(+$ORDER(^RGEQASN("B",TYPE,0)),0)),"^",5))
STATUS ;check current status of event queue, used for menu entry actions
+1 ;added by CML 4/1/99
+2 LOCK +^RGEQ("MAIN"):0
IF '$TEST
Begin DoDot:1
+3 WRITE !!,"=> MPI/PD Event Queue processor is currently running.",!
+4 QUIT
End DoDot:1
QUIT
+5 WRITE $CHAR(7),$CHAR(7),!!,"=> MPI/PD Event Queue processor is <<NOT>> currently running.",!
+6 LOCK -^RGEQ("MAIN")
+7 QUIT