Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: YSKFMAIL

YSKFMAIL.m

Go to the documentation of this file.
YSKFMAIL ;16IT/BL - SUBSTANCE ABUSE ;6/20/01  20:47
 ;;5.01;MENTAL HEALTH;**73**;Dec 30, 1994
MAIL ; SEND REPORT IN MAILMAN
 S DTIME=600
 I $D(YSKFEQST) G MAIL2
 S XMSUB=$P(YSKFSITE,U,1)_" "_YSKFDIS_" RPT ("_$E(YSKFBDT,4,5)_"/"_$E(YSKFBDT,6,7)_"/"_$E(YSKFBDT,2,3)_"-"_$E(YSKFEDT,4,5)_"/"_$E(YSKFEDT,6,7)_"/"_$E(YSKFEDT,2,3)_")"
 S XMTEXT="^TMP($J,"
 I YSKFMG="Y"!(YSKFMG="y") D
 .I $G(YSKFMHFG)=1 S XMY("G.YS ASI PERFORMANCE MEASURES")=""
 S XMY(DUZ)=""
 S XMDUZ="AUTOMATED MESSAGE"
 D ^XMD
MAIL2 ; SEND DATASET MAILMAN
 I (YSKFZZ="Y")!(YSKFZZ="y") D
 .S YSKFMCNT=0,YSKFMTC=(YSKFJCNT\1000)+1
 .S (YSKFCNT,YSKFCNT2)=0 F  S YSKFCNT=$O(^TMP("XM",$J,YSKFCNT)) Q:(YSKFCNT'>0)  D
 ..S YSKFCNT2=YSKFCNT2+1,^TMP("M",$J,YSKFCNT)=^TMP("XM",$J,YSKFCNT)
 ..I (YSKFCNT2=1000)!(YSKFCNT=YSKFJCNT) D
 ...S YSKFMCNT=YSKFMCNT+1
 ...S DTIME=600
 ...S XMSUB=$P(YSKFSITE,U,1)_" "_YSKFDIS_" DATA ("_$E(YSKFBDT,4,5)_"/"_$E(YSKFBDT,6,7)_"/"_$E(YSKFBDT,2,3)_"-"_$E(YSKFEDT,4,5)_"/"_$E(YSKFEDT,6,7)_"/"_$E(YSKFEDT,2,3)_")"_" "_YSKFMCNT_" OF "_YSKFMTC
 ...S XMTEXT="^TMP(""M"",$J,"
 ...I YSKFMG="Y"!(YSKFMG="y") D
 ....I $G(YSKFMHFG)=1 S XMY("G.YS ASI PERFORMANCE MEASURES")=""
 ...S XMY(DUZ)=""
 ...S XMDUZ="AUTOMATED MESSAGE"
 ...D ^XMD
 ...S YSKFCNT2=0
 ...K ^TMP("M",$J)
 .I $D(^TMP("XM",$J,"ALC")) D
 ..S YSKFMCNT=0,YSKFMTC=(YSKFJCNT\1000)+1
 ..S YSKFCNT=0,YSKFCNT2=0 F  S YSKFCNT=$O(^TMP("XM",$J,"ALC",YSKFCNT)) Q:YSKFCNT'>0  D
 ...S YSKFCNT2=YSKFCNT2+1,^TMP("M",$J,YSKFCNT)=^TMP("XM",$J,"ALC",YSKFCNT)
 ...I (YSKFCNT2=1000)!(YSKFCNT=YSKFJCNT) D
 ....S YSKFMCNT=YSKFMCNT+1
 ....S DTIME=600
 ....S XMSUB=$P(YSKFSITE,U,1)_" "_YSKFDIS_" DATA ("_$E(YSKFBDT,4,5)_"/"_$E(YSKFBDT,6,7)_"/"_$E(YSKFBDT,2,3)_"-"_$E(YSKFEDT,4,5)_"/"_$E(YSKFEDT,6,7)_"/"_$E(YSKFEDT,2,3)_")"_" "_YSKFMCNT_" OF "_YSKFMTC
 ....S XMTEXT="^TMP(""M"",$J,"
 ....I YSKFMG="Y"!(YSKFMG="y") D
 .....I $G(YSKFMHFG)=1 S XMY("G.YS ASI PERFORMANCE MEASURES")=""   ;if from MH monthly menu
 ....S XMY(DUZ)=""
 ....S XMDUZ="AUTOMATED MESSAGE"
 ....D ^XMD
 ....S YSKFCNT2=0
 ....K ^TMP("M",$J)
KILL ;KILL MAIL VARIABLES
 S DTIME=$$DTIME^XUP(DUZ)
 K XMSUB,XMTEXT,XMY,XMDUZ,^TMP($J),^TMP("XM",$J),^TMP("M",$J),^TMP("XN",$J),^TMP("XN1",$J),^TMP("YSKF",$J),YSKFMCNT,YSKFCNT,YSKFCNT2,YSKFMTC,^TMP("XN2",$J),^TMP("YSKFY",$J),^UTILITY($J)
 D KILL^XM
 Q