DGJBGJ1 ;ALB/MAF - IRT BACKGROUND JOB (CONT.) - MAY 3 1993
;;5.3;Registration;**31,44,126,1015**;Aug 13, 1993;Build 21
MSG N DGJCNT,DGJDV,DGJDT,DGJCA
S (DGJCNT,DGJDV,DGJDT,DGJCA)=0
F S DGJDV=$O(^TMP("VAS",$J,DGJDV)) Q:DGJDV']"" F S DGJDT=$O(^TMP("VAS",$J,DGJDV,DGJDT)) Q:DGJDT']"" F S DGJCA=$O(^TMP("VAS",$J,DGJDV,DGJDT,DGJCA)) Q:DGJCA']"" S DGJCNT=DGJCNT+1 S DGJMSG(DGJCNT,0)=^TMP("VAS",$J,DGJDV,DGJDT,DGJCA,0)
I '$D(DGJMSG(1)) G Q
;quit it no text in message
S XMSUB="PATIENTS DISCHARGED LESS THAN 48 HOURS"
S XMTEXT="DGJMSG("
S DGJB=+$P($G(^DG(43,1,"NOT")),"^",14)
S XMY("G."_$P($G(^XMB(3.8,DGJB,0)),"^",1))="" ; pass mailgroup
; makes sure it gets sent to someone
I '$D(XMY) S XMY(.5)=""
; make postmaster the sender so it will show up as new to DUZ
S XMDUZ=.5
D ^XMD:$D(XMY)
Q K DGSM,DGB,DGTEXT,XMR,DGII,XMY,XMTEXT,XMDUZ,XMSUB Q
DGJBGJ1 ;ALB/MAF - IRT BACKGROUND JOB (CONT.) - MAY 3 1993
+1 ;;5.3;Registration;**31,44,126,1015**;Aug 13, 1993;Build 21
MSG NEW DGJCNT,DGJDV,DGJDT,DGJCA
+1 SET (DGJCNT,DGJDV,DGJDT,DGJCA)=0
+2 FOR
SET DGJDV=$ORDER(^TMP("VAS",$JOB,DGJDV))
IF DGJDV']""
QUIT
FOR
SET DGJDT=$ORDER(^TMP("VAS",$JOB,DGJDV,DGJDT))
IF DGJDT']""
QUIT
FOR
SET DGJCA=$ORDER(^TMP("VAS",$JOB,DGJDV,DGJDT,DGJCA))
IF DGJCA']""
QUIT
SET DGJCNT=DGJCNT+1
SET DGJMSG(DGJCNT,0)=^TMP("VAS",$JOB,DGJDV,DGJDT,DGJCA,0)
+3 IF '$DATA(DGJMSG(1))
GOTO Q
+4 ;quit it no text in message
+5 SET XMSUB="PATIENTS DISCHARGED LESS THAN 48 HOURS"
+6 SET XMTEXT="DGJMSG("
+7 SET DGJB=+$PIECE($GET(^DG(43,1,"NOT")),"^",14)
+8 ; pass mailgroup
SET XMY("G."_$PIECE($GET(^XMB(3.8,DGJB,0)),"^",1))=""
+9 ; makes sure it gets sent to someone
+10 IF '$DATA(XMY)
SET XMY(.5)=""
+11 ; make postmaster the sender so it will show up as new to DUZ
+12 SET XMDUZ=.5
+13 IF $DATA(XMY)
DO ^XMD
Q KILL DGSM,DGB,DGTEXT,XMR,DGII,XMY,XMTEXT,XMDUZ,XMSUB
QUIT