MAGDIR82 ;WOIFO/PMK - Read a DICOM image file ; 10/30/2008 09:20
;;3.0;IMAGING;**11,30,51,20,54**;03-July-2009;;Build 1424
;; Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
; M2MB server
;
; This routine is invoked by the ^MAGDIR8 to update statistics & add
; an image to the background processor and auto-router queues.
;
; There are two entry points, one for the "ACQUIRED" RESULT item, and
; the other (POSTPROC) for the "PROCESSED" RESULT item.
;
ACQUIRED ; update image acquisition statistics
N INSTNAME,LOCATION,STATUS
S STATUS=$P(ARGS,"|",1)
S LOCATION=$P(ARGS,"|",2)
S INSTNAME=$P(ARGS,"|",3)
D COUNT("ACQUIRED")
Q
;
POSTPROC ; update image processing statistics and add to BP & AR queues
N COUNTFLG,ERRCODE,EVAL,I,IMAGEPTR,INSTNAME,LOCATION,MACHID,MSG,STATUS
S STATUS=$P(ARGS,"|",1)
S LOCATION=$P(ARGS,"|",2)
S INSTNAME=$P(ARGS,"|",3)
S IMAGEPTR=$P(ARGS,"|",4)
S COUNTFLG=$P(ARGS,"|",5) ; zero for multiframe images
S EVAL=$P(ARGS,"|",6)
S MACHID=$P(ARGS,"|",7)
I COUNTFLG D
. D COUNT("PROCESSED") ; update the count
. Q:$T(SAVEUID^MAGDIR81)=""
. D SAVEUID^MAGDIR81(MACHID,"") ; clear the last image UID
. Q
;
S ERRCODE=""
;
I $$CONSOLID^MAGDFCNV D
. D POSTPRO2 ; consolidation code
. Q
E D
. D POSTPRO1 ; non-consolidation code
. Q
I ERRCODE="" D
. D RESULT^MAGDIR8(OPCODE,"|"_$P(ARGS,"|",2,999))
. Q
E D
. D ERROR^MAGDIR8(OPCODE,ERRCODE,.MSG,$T(+0))
. Q
Q
;
POSTPRO1 ; non-consolidation code version of post processing
Q:IMAGEPTR<0
; add the image to the jukebox queue
D:'$$JUKEBOX^MAGBAPI(IMAGEPTR)
. S I=$O(MSG(" "),-1)
. S:I I=I+1,MSG(I)=" "
. S I=I+1,MSG(I)="JUKEBOX QUEUE CREATION ERROR:"
. S I=I+1,MSG(I)="An image has not been entered into the jukebox queue."
. S I=I+1,MSG(I)="Image pointer: "_IMAGEPTR
. D ERROR^MAGDIRVE($T(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
. S ERRCODE=-401
. Q
;
D:EVAL ; Add the image to the routing evaluator queue
. D WARNROUT(0)
. D:$$EVAL^MAGBAPI(IMAGEPTR)<0
. . S I=$O(MSG(" "),-1)
. . S:I I=I+1,MSG(I)=" "
. . S I=I+1,MSG(I)="AUTOROUTER EVALUATION QUEUE CREATION ERROR:"
. . S I=I+1,MSG(I)="An image could not be evaluated for autorouting purposes."
. . S I=I+1,MSG(I)="Image pointer: "_IMAGEPTR
. . S I=I+1,MSG(I)="Error code is """_Z_"""."
. . D ERROR^MAGDIRVE($T(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
. . S ERRCODE=ERRCODE_"-402"
. . Q
. Q
Q
;
POSTPRO2 ; consolidation code version of post processing
N PLACE
Q:IMAGEPTR<0
S PLACE=$O(^MAG(2006.1,"B",LOCATION,""))
;
; add the image to the jukebox queue
D:'$$JUKEBOX^MAGBAPI(IMAGEPTR,PLACE)
. S I=$O(MSG(" "),-1)
. S:I I=I+1,MSG(I)=" "
. S I=I+1,MSG(I)="JUKEBOX QUEUE CREATION ERROR:"
. S I=I+1,MSG(I)="An image has not been entered into the jukebox queue."
. S I=I+1,MSG(I)="Image pointer: "_IMAGEPTR_" Location: "_LOCATION
. D ERROR^MAGDIRVE($T(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
. S ERRCODE=-403
. Q
;
D:EVAL ; Add the image to the routing evaluator queue
. D WARNROUT(PLACE)
. D:$$EVAL^MAGBAPI(IMAGEPTR,PLACE)<0
. . S I=$O(MSG(" "),-1)
. . S:I I=I+1,MSG(I)=" "
. . S I=I+1,MSG(I)="AUTOROUTER EVALUATION QUEUE CREATION ERROR:"
. . S I=I+1,MSG(I)="An image could not be evaluated for autorouting purposes."
. . S I=I+1,MSG(I)="Image pointer: "_IMAGEPTR_" Place: "_PLACE
. . S I=I+1,MSG(I)="Error code is """_Z_"""."
. . D ERROR^MAGDIRVE($T(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
. . S ERRCODE=ERRCODE_"-404"
. . Q
. Q
Q
;
COUNT(STEP) ; update today's count
N D2,NOW,PC,TODAY,X
S NOW=$$NOW^XLFDT,TODAY=NOW\1
L +^MAGDAUDT(2006.5762,TODAY):1E9 ; Background job MUST wait
D:'$D(^MAGDAUDT(2006.5762,TODAY))
. S X=$G(^MAGDAUDT(2006.5762,0))
. S $P(X,"^",1,2)="DICOM INSTRUMENT STATISTICS^2006.5762"
. S $P(X,"^",3)=TODAY
. S $P(X,"^",4)=$P(X,"^",4)+1
. S ^MAGDAUDT(2006.5762,0)=X
. S ^MAGDAUDT(2006.5762,TODAY,0)=TODAY
. S ^MAGDAUDT(2006.5762,"B",TODAY,TODAY)=""
. Q
S D2=$O(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,"B",INSTNAME,""))
D:'D2
. S D2=$O(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1," "),-1)+1
. S X=$G(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,0))
. S $P(X,"^",2)="2006.576211"
. S $P(X,"^",3)=D2
. S $P(X,"^",4)=$P(X,"^",4)+1
. S ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,0)=LOCATION
. S ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,0)=X
. S ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,D2,0)=INSTNAME
. S ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,"B",INSTNAME,D2)=""
. Q
S X=$G(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,D2,0))
S PC=$S(STEP="ACQUIRED":2,STEP="PROCESSED":4,1:6)
S $P(X,"^",PC)=$P(X,"^",PC)+1
S $P(X,"^",PC+1)=NOW
S ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,D2,0)=X
L -^MAGDAUDT(2006.5762,TODAY)
Q
;
WARNROUT(PLACE) N LAST,X2,X3
D:'PLACE
. S PLACE=$$PLACE^MAGDRPC2(LOCATION)
. Q
S LAST=$G(^MAG(2006.1,+PLACE,"LASTROUTE"))
S (X2,X3)=LAST\1 D:X3
. N DEST,E,I,PRI,T
. Q:$$FMDIFF^XLFDT(DT,X2,1)<7
. S X2=$P(LAST,"^",2) Q:X2'<DT ; Only send one message per day
. S (E,T,I)=0 F S I=$O(^MAGQUEUE(2006.03,"C",PLACE,"EVAL",I)) Q:I="" S E=E+1
. S PRI="" F S PRI=$O(^MAGQUEUE(2006.035,"STS",LOCATION,"WAITING",PRI)) Q:PRI="" D
. . S DEST="" F S DEST=$O(^MAGQUEUE(2006.035,"STS",LOCATION,"WAITING",PRI,DEST)) Q:DEST="" D
. . . S I="" F S I=$O(^MAGQUEUE(2006.035,"STS",LOCATION,"WAITING",PRI,DEST,I)) Q:I="" S T=T+1
. . . Q
. . Q
. S I=$O(MSG(" "),-1)
. S:I I=I+1,MSG(I)=" "
. S I=I+1,MSG(I)="More than a week has elapsed since "_(X3#100)_"-"_$P("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"," ",X3\100#100)_"-"_(X3\10000+1700)
. S I=I+1,MSG(I)="when the last activity occurred that is related"
. S I=I+1,MSG(I)="to the processing of Routed Image files."
. S I=I+1,MSG(I)=" "
. S I=I+1,MSG(I)="The site parameter for ""This is a Routing Site"" is"
. S I=I+1,MSG(I)="currently turned ON."
. S I=I+1,MSG(I)="If this site is no longer actively routing image files"
. S I=I+1,MSG(I)="this site parameter must be turned OFF."
. S I=I+1,MSG(I)="This parameter needs to be turned OFF on each VistA"
. S I=I+1,MSG(I)="DICOM Gateway that processes incoming images."
. S I=I+1,MSG(I)=" "
. S I=I+1,MSG(I)="There are currently "_E_" entr"_$S(E=1:"y",1:"ies")
. S I=I+1,MSG(I)="waiting to be processed in the evaluation queue."
. S I=I+1,MSG(I)=" "
. S I=I+1,MSG(I)="There are currently "_T_" entr"_$S(T=1:"y",1:"ies")
. S I=I+1,MSG(I)="waiting to be processed in the transmission queue."
. S I=I+1,MSG(I)=" "
. S I=I+1,MSG(I)="If this site is still a routing site, then both the"
. S I=I+1,MSG(I)="Routing Rule Evaluator and the Routing Transmitter"
. S I=I+1,MSG(I)="must be restarted."
. D ERROR^MAGDIRVE($T(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
. S ERRCODE=ERRCODE_"-405"
. S $P(^MAG(2006.1,PLACE,"LASTROUTE"),"^",2)=DT
. Q
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGDIR82 7842 printed Dec 13, 2024@02:00:22 Page 2
MAGDIR82 ;WOIFO/PMK - Read a DICOM image file ; 10/30/2008 09:20
+1 ;;3.0;IMAGING;**11,30,51,20,54**;03-July-2009;;Build 1424
+2 ;; Per VHA Directive 2004-038, this routine should not be modified.
+3 ;; +---------------------------------------------------------------+
+4 ;; | Property of the US Government. |
+5 ;; | No permission to copy or redistribute this software is given. |
+6 ;; | Use of unreleased versions of this software requires the user |
+7 ;; | to execute a written test agreement with the VistA Imaging |
+8 ;; | Development Office of the Department of Veterans Affairs, |
+9 ;; | telephone (301) 734-0100. |
+10 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 ; M2MB server
+18 ;
+19 ; This routine is invoked by the ^MAGDIR8 to update statistics & add
+20 ; an image to the background processor and auto-router queues.
+21 ;
+22 ; There are two entry points, one for the "ACQUIRED" RESULT item, and
+23 ; the other (POSTPROC) for the "PROCESSED" RESULT item.
+24 ;
ACQUIRED ; update image acquisition statistics
+1 NEW INSTNAME,LOCATION,STATUS
+2 SET STATUS=$PIECE(ARGS,"|",1)
+3 SET LOCATION=$PIECE(ARGS,"|",2)
+4 SET INSTNAME=$PIECE(ARGS,"|",3)
+5 DO COUNT("ACQUIRED")
+6 QUIT
+7 ;
POSTPROC ; update image processing statistics and add to BP & AR queues
+1 NEW COUNTFLG,ERRCODE,EVAL,I,IMAGEPTR,INSTNAME,LOCATION,MACHID,MSG,STATUS
+2 SET STATUS=$PIECE(ARGS,"|",1)
+3 SET LOCATION=$PIECE(ARGS,"|",2)
+4 SET INSTNAME=$PIECE(ARGS,"|",3)
+5 SET IMAGEPTR=$PIECE(ARGS,"|",4)
+6 ; zero for multiframe images
SET COUNTFLG=$PIECE(ARGS,"|",5)
+7 SET EVAL=$PIECE(ARGS,"|",6)
+8 SET MACHID=$PIECE(ARGS,"|",7)
+9 IF COUNTFLG
Begin DoDot:1
+10 ; update the count
DO COUNT("PROCESSED")
+11 if $TEXT(SAVEUID^MAGDIR81)=""
QUIT
+12 ; clear the last image UID
DO SAVEUID^MAGDIR81(MACHID,"")
+13 QUIT
End DoDot:1
+14 ;
+15 SET ERRCODE=""
+16 ;
+17 IF $$CONSOLID^MAGDFCNV
Begin DoDot:1
+18 ; consolidation code
DO POSTPRO2
+19 QUIT
End DoDot:1
+20 IF '$TEST
Begin DoDot:1
+21 ; non-consolidation code
DO POSTPRO1
+22 QUIT
End DoDot:1
+23 IF ERRCODE=""
Begin DoDot:1
+24 DO RESULT^MAGDIR8(OPCODE,"|"_$PIECE(ARGS,"|",2,999))
+25 QUIT
End DoDot:1
+26 IF '$TEST
Begin DoDot:1
+27 DO ERROR^MAGDIR8(OPCODE,ERRCODE,.MSG,$TEXT(+0))
+28 QUIT
End DoDot:1
+29 QUIT
+30 ;
POSTPRO1 ; non-consolidation code version of post processing
+1 if IMAGEPTR<0
QUIT
+2 ; add the image to the jukebox queue
+3 if '$$JUKEBOX^MAGBAPI(IMAGEPTR)
Begin DoDot:1
+4 SET I=$ORDER(MSG(" "),-1)
+5 if I
SET I=I+1
SET MSG(I)=" "
+6 SET I=I+1
SET MSG(I)="JUKEBOX QUEUE CREATION ERROR:"
+7 SET I=I+1
SET MSG(I)="An image has not been entered into the jukebox queue."
+8 SET I=I+1
SET MSG(I)="Image pointer: "_IMAGEPTR
+9 DO ERROR^MAGDIRVE($TEXT(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
+10 SET ERRCODE=-401
+11 QUIT
End DoDot:1
+12 ;
+13 ; Add the image to the routing evaluator queue
if EVAL
Begin DoDot:1
+14 DO WARNROUT(0)
+15 if $$EVAL^MAGBAPI(IMAGEPTR)<0
Begin DoDot:2
+16 SET I=$ORDER(MSG(" "),-1)
+17 if I
SET I=I+1
SET MSG(I)=" "
+18 SET I=I+1
SET MSG(I)="AUTOROUTER EVALUATION QUEUE CREATION ERROR:"
+19 SET I=I+1
SET MSG(I)="An image could not be evaluated for autorouting purposes."
+20 SET I=I+1
SET MSG(I)="Image pointer: "_IMAGEPTR
+21 SET I=I+1
SET MSG(I)="Error code is """_Z_"""."
+22 DO ERROR^MAGDIRVE($TEXT(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
+23 SET ERRCODE=ERRCODE_"-402"
+24 QUIT
End DoDot:2
+25 QUIT
End DoDot:1
+26 QUIT
+27 ;
POSTPRO2 ; consolidation code version of post processing
+1 NEW PLACE
+2 if IMAGEPTR<0
QUIT
+3 SET PLACE=$ORDER(^MAG(2006.1,"B",LOCATION,""))
+4 ;
+5 ; add the image to the jukebox queue
+6 if '$$JUKEBOX^MAGBAPI(IMAGEPTR,PLACE)
Begin DoDot:1
+7 SET I=$ORDER(MSG(" "),-1)
+8 if I
SET I=I+1
SET MSG(I)=" "
+9 SET I=I+1
SET MSG(I)="JUKEBOX QUEUE CREATION ERROR:"
+10 SET I=I+1
SET MSG(I)="An image has not been entered into the jukebox queue."
+11 SET I=I+1
SET MSG(I)="Image pointer: "_IMAGEPTR_" Location: "_LOCATION
+12 DO ERROR^MAGDIRVE($TEXT(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
+13 SET ERRCODE=-403
+14 QUIT
End DoDot:1
+15 ;
+16 ; Add the image to the routing evaluator queue
if EVAL
Begin DoDot:1
+17 DO WARNROUT(PLACE)
+18 if $$EVAL^MAGBAPI(IMAGEPTR,PLACE)<0
Begin DoDot:2
+19 SET I=$ORDER(MSG(" "),-1)
+20 if I
SET I=I+1
SET MSG(I)=" "
+21 SET I=I+1
SET MSG(I)="AUTOROUTER EVALUATION QUEUE CREATION ERROR:"
+22 SET I=I+1
SET MSG(I)="An image could not be evaluated for autorouting purposes."
+23 SET I=I+1
SET MSG(I)="Image pointer: "_IMAGEPTR_" Place: "_PLACE
+24 SET I=I+1
SET MSG(I)="Error code is """_Z_"""."
+25 DO ERROR^MAGDIRVE($TEXT(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
+26 SET ERRCODE=ERRCODE_"-404"
+27 QUIT
End DoDot:2
+28 QUIT
End DoDot:1
+29 QUIT
+30 ;
COUNT(STEP) ; update today's count
+1 NEW D2,NOW,PC,TODAY,X
+2 SET NOW=$$NOW^XLFDT
SET TODAY=NOW\1
+3 ; Background job MUST wait
LOCK +^MAGDAUDT(2006.5762,TODAY):1E9
+4 if '$DATA(^MAGDAUDT(2006.5762,TODAY))
Begin DoDot:1
+5 SET X=$GET(^MAGDAUDT(2006.5762,0))
+6 SET $PIECE(X,"^",1,2)="DICOM INSTRUMENT STATISTICS^2006.5762"
+7 SET $PIECE(X,"^",3)=TODAY
+8 SET $PIECE(X,"^",4)=$PIECE(X,"^",4)+1
+9 SET ^MAGDAUDT(2006.5762,0)=X
+10 SET ^MAGDAUDT(2006.5762,TODAY,0)=TODAY
+11 SET ^MAGDAUDT(2006.5762,"B",TODAY,TODAY)=""
+12 QUIT
End DoDot:1
+13 SET D2=$ORDER(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,"B",INSTNAME,""))
+14 if 'D2
Begin DoDot:1
+15 SET D2=$ORDER(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1," "),-1)+1
+16 SET X=$GET(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,0))
+17 SET $PIECE(X,"^",2)="2006.576211"
+18 SET $PIECE(X,"^",3)=D2
+19 SET $PIECE(X,"^",4)=$PIECE(X,"^",4)+1
+20 SET ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,0)=LOCATION
+21 SET ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,0)=X
+22 SET ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,D2,0)=INSTNAME
+23 SET ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,"B",INSTNAME,D2)=""
+24 QUIT
End DoDot:1
+25 SET X=$GET(^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,D2,0))
+26 SET PC=$SELECT(STEP="ACQUIRED":2,STEP="PROCESSED":4,1:6)
+27 SET $PIECE(X,"^",PC)=$PIECE(X,"^",PC)+1
+28 SET $PIECE(X,"^",PC+1)=NOW
+29 SET ^MAGDAUDT(2006.5762,TODAY,1,LOCATION,1,D2,0)=X
+30 LOCK -^MAGDAUDT(2006.5762,TODAY)
+31 QUIT
+32 ;
WARNROUT(PLACE) NEW LAST,X2,X3
+1 if 'PLACE
Begin DoDot:1
+2 SET PLACE=$$PLACE^MAGDRPC2(LOCATION)
+3 QUIT
End DoDot:1
+4 SET LAST=$GET(^MAG(2006.1,+PLACE,"LASTROUTE"))
+5 SET (X2,X3)=LAST\1
if X3
Begin DoDot:1
+6 NEW DEST,E,I,PRI,T
+7 if $$FMDIFF^XLFDT(DT,X2,1)<7
QUIT
+8 ; Only send one message per day
SET X2=$PIECE(LAST,"^",2)
if X2'<DT
QUIT
+9 SET (E,T,I)=0
FOR
SET I=$ORDER(^MAGQUEUE(2006.03,"C",PLACE,"EVAL",I))
if I=""
QUIT
SET E=E+1
+10 SET PRI=""
FOR
SET PRI=$ORDER(^MAGQUEUE(2006.035,"STS",LOCATION,"WAITING",PRI))
if PRI=""
QUIT
Begin DoDot:2
+11 SET DEST=""
FOR
SET DEST=$ORDER(^MAGQUEUE(2006.035,"STS",LOCATION,"WAITING",PRI,DEST))
if DEST=""
QUIT
Begin DoDot:3
+12 SET I=""
FOR
SET I=$ORDER(^MAGQUEUE(2006.035,"STS",LOCATION,"WAITING",PRI,DEST,I))
if I=""
QUIT
SET T=T+1
+13 QUIT
End DoDot:3
+14 QUIT
End DoDot:2
+15 SET I=$ORDER(MSG(" "),-1)
+16 if I
SET I=I+1
SET MSG(I)=" "
+17 SET I=I+1
SET MSG(I)="More than a week has elapsed since "_(X3#100)_"-"_$PIECE("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"," ",X3\100#100)_"-"_(X3\10000+1700)
+18 SET I=I+1
SET MSG(I)="when the last activity occurred that is related"
+19 SET I=I+1
SET MSG(I)="to the processing of Routed Image files."
+20 SET I=I+1
SET MSG(I)=" "
+21 SET I=I+1
SET MSG(I)="The site parameter for ""This is a Routing Site"" is"
+22 SET I=I+1
SET MSG(I)="currently turned ON."
+23 SET I=I+1
SET MSG(I)="If this site is no longer actively routing image files"
+24 SET I=I+1
SET MSG(I)="this site parameter must be turned OFF."
+25 SET I=I+1
SET MSG(I)="This parameter needs to be turned OFF on each VistA"
+26 SET I=I+1
SET MSG(I)="DICOM Gateway that processes incoming images."
+27 SET I=I+1
SET MSG(I)=" "
+28 SET I=I+1
SET MSG(I)="There are currently "_E_" entr"_$SELECT(E=1:"y",1:"ies")
+29 SET I=I+1
SET MSG(I)="waiting to be processed in the evaluation queue."
+30 SET I=I+1
SET MSG(I)=" "
+31 SET I=I+1
SET MSG(I)="There are currently "_T_" entr"_$SELECT(T=1:"y",1:"ies")
+32 SET I=I+1
SET MSG(I)="waiting to be processed in the transmission queue."
+33 SET I=I+1
SET MSG(I)=" "
+34 SET I=I+1
SET MSG(I)="If this site is still a routing site, then both the"
+35 SET I=I+1
SET MSG(I)="Routing Rule Evaluator and the Routing Transmitter"
+36 SET I=I+1
SET MSG(I)="must be restarted."
+37 DO ERROR^MAGDIRVE($TEXT(+0),"DICOM IMAGE PROCESSING ERROR",.MSG)
+38 SET ERRCODE=ERRCODE_"-405"
+39 SET $PIECE(^MAG(2006.1,PLACE,"LASTROUTE"),"^",2)=DT
+40 QUIT
End DoDot:1
+41 QUIT
+42 ;