1 | YSKFMAIL ;16IT/BL - SUBSTANCE ABUSE ;6/20/01 20:47
|
---|
2 | ;;5.01;MENTAL HEALTH;**73**;Dec 30, 1994
|
---|
3 | MAIL ; SEND REPORT IN MAILMAN
|
---|
4 | S DTIME=600
|
---|
5 | I $D(YSKFEQST) G MAIL2
|
---|
6 | 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)_")"
|
---|
7 | S XMTEXT="^TMP($J,"
|
---|
8 | I YSKFMG="Y"!(YSKFMG="y") D
|
---|
9 | .I $G(YSKFMHFG)=1 S XMY("G.YS ASI PERFORMANCE MEASURES")=""
|
---|
10 | S XMY(DUZ)=""
|
---|
11 | S XMDUZ="AUTOMATED MESSAGE"
|
---|
12 | D ^XMD
|
---|
13 | MAIL2 ; SEND DATASET MAILMAN
|
---|
14 | I (YSKFZZ="Y")!(YSKFZZ="y") D
|
---|
15 | .S YSKFMCNT=0,YSKFMTC=(YSKFJCNT\1000)+1
|
---|
16 | .S (YSKFCNT,YSKFCNT2)=0 F S YSKFCNT=$O(^TMP("XM",$J,YSKFCNT)) Q:(YSKFCNT'>0) D
|
---|
17 | ..S YSKFCNT2=YSKFCNT2+1,^TMP("M",$J,YSKFCNT)=^TMP("XM",$J,YSKFCNT)
|
---|
18 | ..I (YSKFCNT2=1000)!(YSKFCNT=YSKFJCNT) D
|
---|
19 | ...S YSKFMCNT=YSKFMCNT+1
|
---|
20 | ...S DTIME=600
|
---|
21 | ...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
|
---|
22 | ...S XMTEXT="^TMP(""M"",$J,"
|
---|
23 | ...I YSKFMG="Y"!(YSKFMG="y") D
|
---|
24 | ....I $G(YSKFMHFG)=1 S XMY("G.YS ASI PERFORMANCE MEASURES")=""
|
---|
25 | ...S XMY(DUZ)=""
|
---|
26 | ...S XMDUZ="AUTOMATED MESSAGE"
|
---|
27 | ...D ^XMD
|
---|
28 | ...S YSKFCNT2=0
|
---|
29 | ...K ^TMP("M",$J)
|
---|
30 | .I $D(^TMP("XM",$J,"ALC")) D
|
---|
31 | ..S YSKFMCNT=0,YSKFMTC=(YSKFJCNT\1000)+1
|
---|
32 | ..S YSKFCNT=0,YSKFCNT2=0 F S YSKFCNT=$O(^TMP("XM",$J,"ALC",YSKFCNT)) Q:YSKFCNT'>0 D
|
---|
33 | ...S YSKFCNT2=YSKFCNT2+1,^TMP("M",$J,YSKFCNT)=^TMP("XM",$J,"ALC",YSKFCNT)
|
---|
34 | ...I (YSKFCNT2=1000)!(YSKFCNT=YSKFJCNT) D
|
---|
35 | ....S YSKFMCNT=YSKFMCNT+1
|
---|
36 | ....S DTIME=600
|
---|
37 | ....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
|
---|
38 | ....S XMTEXT="^TMP(""M"",$J,"
|
---|
39 | ....I YSKFMG="Y"!(YSKFMG="y") D
|
---|
40 | .....I $G(YSKFMHFG)=1 S XMY("G.YS ASI PERFORMANCE MEASURES")="" ;if from MH monthly menu
|
---|
41 | ....S XMY(DUZ)=""
|
---|
42 | ....S XMDUZ="AUTOMATED MESSAGE"
|
---|
43 | ....D ^XMD
|
---|
44 | ....S YSKFCNT2=0
|
---|
45 | ....K ^TMP("M",$J)
|
---|
46 | KILL ;KILL MAIL VARIABLES
|
---|
47 | S DTIME=$$DTIME^XUP(DUZ)
|
---|
48 | 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)
|
---|
49 | D KILL^XM
|
---|
50 | Q
|
---|