source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMXUTIL4.m@ 1005

Last change on this file since 1005 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 5.7 KB
Line 
1XMXUTIL4 ;ISC-SF/GMB-List message recipients (cont.) ;04/11/2002 10:44
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; All entry points are for internal MailMan use only.
4QLIST(XMZ,XMFLAGS,XMAMT,XMSTART,XMTROOT) ; list them
5 N XMCNT,XMIEN,XMREC,XMTO,XMNAME
6 S XMCNT=0,XMIEN=+$G(XMSTART("IEN"))
7 F S XMIEN=$O(^XMB(3.9,XMZ,1,XMIEN)) Q:'XMIEN D Q:XMCNT=XMAMT
8 . S XMCNT=XMCNT+1
9 . S XMREC=$G(^XMB(3.9,XMZ,1,XMIEN,0))
10 . S XMTO=$P(XMREC,U,1)
11 . S XMNAME=$$NAME^XMXUTIL(XMTO)
12 . D QDFLDS(XMZ,XMFLAGS,XMIEN,XMREC,XMNAME,XMTROOT,XMCNT)
13 S XMSTART("IEN")=XMIEN
14 S @(XMTROOT_"0)")=XMCNT_U_XMAMT_U_$S(XMAMT="*":0,1:$O(^XMB(3.9,XMZ,1,XMIEN))>0)
15 Q
16QDFLDS(XMZ,XMFLAGS,XMIEN,XMREC,XMNAME,XMTROOT,XMCNT) ;
17 S @(XMTROOT_XMCNT_",""TO"")")=$P(XMREC,U,1)
18 S @(XMTROOT_XMCNT_",""TO NAME"")")=XMNAME
19 I $D(^XMB(3.9,XMZ,1,XMIEN,"T")) S @(XMTROOT_XMCNT_",""TYPE"")")=$P(^("T"),U,1)
20 I $D(^XMB(3.9,XMZ,1,XMIEN,"F")) D FWD(XMZ,XMIEN)
21 I $P(XMREC,U,1)?.N D Q
22 . S @(XMTROOT_XMCNT_",""TO ID"")")="L" ; local user
23 . S @(XMTROOT_XMCNT_",""TO DUZ"")")=$P(XMREC,U,1)
24 . I $P(XMREC,U,2)'="" D
25 . . S @(XMTROOT_XMCNT_",""RESP"")")=$P(XMREC,U,2)
26 . I $P(XMREC,U,3)'="" D
27 . . S @(XMTROOT_XMCNT_",""LREAD"")")=$P(XMREC,U,3)
28 . . S @(XMTROOT_XMCNT_",""LREAD MM"")")=$$MMDT^XMXUTIL1($P(XMREC,U,3))
29 . I $P(XMREC,U,10)'="" D
30 . . S @(XMTROOT_XMCNT_",""FREAD"")")=$P(XMREC,U,10)
31 . . S @(XMTROOT_XMCNT_",""FREAD MM"")")=$$MMDT^XMXUTIL1($P(XMREC,U,10))
32 . I $D(^XMB(3.9,XMZ,1,XMIEN,"C")) D
33 . . N XMD
34 . . S XMD=^XMB(3.9,XMZ,1,XMIEN,"C")
35 . . S @(XMTROOT_XMCNT_",""COPY"")")=XMD
36 . . S @(XMTROOT_XMCNT_",""COPY MM"")")=$$MMDT^XMXUTIL1(XMD)
37 . I $D(^XMB(3.9,XMZ,1,XMIEN,"D")),$G(^("D")) D
38 . . N XMD
39 . . S XMD=^XMB(3.9,XMZ,1,XMIEN,"D")
40 . . S @(XMTROOT_XMCNT_",""TERM"")")=XMD
41 . . S @(XMTROOT_XMCNT_",""TERM MM"")")=$$MMDT^XMXUTIL1(XMD)
42 . I $D(^XMB(3.9,XMZ,1,XMIEN,"S")) D
43 . . S @(XMTROOT_XMCNT_",""SURR"")")=^XMB(3.9,XMZ,1,XMIEN,"S")
44 I $E(XMNAME,1,2)="F.",$P(XMREC,U,12)'=""!$P(XMREC,U,11) D Q
45 . S @(XMTROOT_XMCNT_",""TO ID"")")="F" ; fax
46 . I $P(XMREC,U,5)'="" D
47 . . S @(XMTROOT_XMCNT_",""FDATE"")")=$P(XMREC,U,5)
48 . . S @(XMTROOT_XMCNT_",""FDATE MM"")")=$$MMDT^XMXUTIL1($P(XMREC,U,5))
49 . I $P(XMREC,U,6)'="" D
50 . . S @(XMTROOT_XMCNT_",""STATUS"")")=$P(XMREC,U,6)
51 . I $P(XMREC,U,11)'="" D
52 . . S @(XMTROOT_XMCNT_",""FAX IEN"")")=$P(XMREC,U,11)
53 . I $P(XMREC,U,12)'="" D
54 . . S @(XMTROOT_XMCNT_",""ID"")")=$P(XMREC,U,12)
55 I XMNAME["@" D Q
56 . S @(XMTROOT_XMCNT_",""TO ID"")")="R" ; remote
57 . I $P(XMREC,U,4)'="" D
58 . . S @(XMTROOT_XMCNT_",""ID"")")=$P(XMREC,U,4)
59 . I $P(XMREC,U,5)'="" D
60 . . S @(XMTROOT_XMCNT_",""XDATE"")")=$P(XMREC,U,5)
61 . . S @(XMTROOT_XMCNT_",""XDATE MM"")")=$$MMDT^XMXUTIL1($P(XMREC,U,5))
62 . I $P(XMREC,U,6)'="" D
63 . . S @(XMTROOT_XMCNT_",""STATUS"")")=$P(XMREC,U,6)
64 . I $P(XMREC,U,7)'="",$D(^DIC(4.2,$P(XMREC,U,7),0)) D
65 . . S @(XMTROOT_XMCNT_",""PATH"")")=$P(XMREC,U,7)
66 . . S @(XMTROOT_XMCNT_",""PATH NAME"")")=$P(^DIC(4.2,$P(XMREC,U,7),0),U)
67 . I $P(XMREC,U,8)'="" D
68 . . S @(XMTROOT_XMCNT_",""SECS"")")=$P(XMREC,U,8)
69 I $E(XMNAME,1,3)="* (" D Q
70 . S @(XMTROOT_XMCNT_",""TO ID"")")=$E(XMNAME) ; broadcast
71 ; I ".D.H.S."[("."_$E(XMNAME,1,2))
72 S @(XMTROOT_XMCNT_",""TO ID"")")=$E(XMNAME) ; device or server
73 I $P(XMREC,U,3)'="" D
74 . S @(XMTROOT_XMCNT_",""SDATE"")")=$P(XMREC,U,3)
75 . S @(XMTROOT_XMCNT_",""SDATE MM"")")=$$MMDT^XMXUTIL1($P(XMREC,U,3))
76 I $P(XMREC,U,6)'="" D
77 . S @(XMTROOT_XMCNT_",""STATUS"")")=$P(XMREC,U,6)
78 Q
79FWD(XMZ,XMIEN) ;
80 Q:'$D(^XMB(3.9,XMZ,1,XMIEN,"F"))
81 N XMFWDREC,XMFWDBY
82 S XMFWDREC=^XMB(3.9,XMZ,1,XMIEN,"F")
83 S XMFWDBY=$P(XMFWDREC,U)
84 I $E(XMFWDBY)?1A!($E(XMFWDBY)="<") D
85 . N XMLEN
86 . S XMLEN=$L(XMFWDBY," ")
87 . S @(XMTROOT_XMCNT_",""FWD BY"")")=$P(XMFWDBY," ",1,XMLEN-4)
88 . S @(XMTROOT_XMCNT_",""FWD ON"")")=$P(XMFWDBY," ",XMLEN-3,XMLEN)
89 E I $E(XMFWDBY)?1N!($E(XMFWDBY)=".") D
90 . N XMLEN
91 . S XMFWDBY=$$NAME^XMXUTIL(+XMFWDBY)_" "_$P(XMFWDBY," ",2,99)
92 . S XMLEN=$L(XMFWDBY," ")
93 . S @(XMTROOT_XMCNT_",""FWD BY"")")=$P(XMFWDBY," ",1,XMLEN-4)
94 . S @(XMTROOT_XMCNT_",""FWD ON"")")=$P(XMFWDBY," ",XMLEN-3,XMLEN)
95 E S @(XMTROOT_XMCNT_",""FWD ON"")")=$E(XMFWDBY,2,99)
96 I $P(XMFWDREC,U,2) S @(XMTROOT_XMCNT_",""FWD BY DUZ"")")=$P(XMFWDREC,U,2)
97 I "R"'[$P(XMFWDREC,U,3) S @(XMTROOT_XMCNT_",""FWD TYPE"")")=$P(XMFWDREC,U,3)
98 Q:$P(XMFWDREC,U,4)="" ; or quit if FWD TYPE="A"
99 S @(XMTROOT_XMCNT_",""FWD BY ORIG"")")=$P(XMFWDREC,U,4)
100 I "R"'[$P(XMFWDREC,U,5) S @(XMTROOT_XMCNT_",""FWD TYPE ORIG"")")=$P(XMFWDREC,U,5)
101 Q
102QFIND(XMZ,XMFLAGS,XMFIND,XMTROOT,XMCNT) ; find them
103 S XMCNT=0
104 D FIND^DIC(200,"","","A",XMFIND,"","B^BB^C^D","I $D(^XMB(3.9,XMZ,1,""C"",+Y))")
105 I '$D(DIERR) D MOVE(200,XMZ,XMFLAGS,XMTROOT,.XMCNT)
106 Q:$O(^XMB(3.9,XMZ,1,"C",":"))="" ; Quit if there aren't any non-local addressees
107 N XMSCREEN
108 S XMSCREEN=$S(+XMFIND=XMFIND:"I '$D(^XMB(3.9,XMZ,1,""C"",XMFIND))",1:"")
109 D FIND^DIC(3.91,","_XMZ_",","","C",XMFIND,"","C",XMSCREEN)
110 I '$D(DIERR) D MOVE(3.91,XMZ,XMFLAGS,XMTROOT,.XMCNT)
111 Q:$E(XMFIND)'?1U ; Quit if the search string does not begin with an upper case letter
112 Q:$O(^XMB(3.9,XMZ,1,"C","`"))="" ; Quit if there aren't any lower case addressees
113 ; FM will translate lower case to upper case in its search, but won't
114 ; translate upper to lower, so we do it here.
115 S XMSCREEN="I ^(0)]""`""" ; Limit search to lower case addresses
116 D FIND^DIC(3.91,","_XMZ_",","","C",$$LOW^XLFSTR(XMFIND),"","C",XMSCREEN)
117 I '$D(DIERR) D MOVE(3.91,XMZ,XMFLAGS,XMTROOT,.XMCNT)
118 Q
119MOVE(XMFILE,XMZ,XMFLAGS,XMTROOT,XMCNT) ; move search results
120 N I,XMIEN,XMREC,XMNAME
121 S I=0
122 F S I=$O(^TMP("DILIST",$J,1,I)) Q:I="" D
123 . S XMIEN=^TMP("DILIST",$J,2,I)
124 . I XMFILE=200 D
125 . . S XMIEN=$O(^XMB(3.9,XMZ,1,"C",XMIEN,0))
126 . . S XMREC=$G(^XMB(3.9,XMZ,1,XMIEN,0))
127 . . S XMNAME=^TMP("DILIST",$J,1,I)
128 . E D
129 . . S XMREC=$G(^XMB(3.9,XMZ,1,XMIEN,0))
130 . . S XMNAME=$P(XMREC,U,1)
131 . S XMCNT=XMCNT+1
132 . D QDFLDS(XMZ,XMFLAGS,XMIEN,XMREC,XMNAME,XMTROOT,XMCNT)
133 Q
Note: See TracBrowser for help on using the repository browser.