source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMXLIST1.m@ 1806

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

initial load of WorldVistAEHR

File size: 6.8 KB
Line 
1XMXLIST1 ;ISC-SF/GMB-List message: multiple conditions (cont.) ;08/30/2000 15:29
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Look in all of the user's baskets.
4NEWA(XMDUZ,XMTYPE,XMORDER,XMFLDS,XMAMT,XMSTART,XMF,XMTROOT) ; New messages in all baskets
5 N XMCNT,XMK,XMKN,XMZ
6 S XMCNT=0
7 S XMK=+$G(XMSTART("XMK")) I XMK S XMK=XMK-.01
8 S XMZ=$G(XMSTART("XMZ"))
9 F S XMK=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK)) Q:'XMK D Q:XMCNT=XMAMT
10 . S XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
11 . F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) Q:'XMZ D Q:XMCNT=XMAMT
12 . . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
13 . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
14 . . I $D(XMF) Q:'$$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF)
15 . . S XMCNT=XMCNT+1
16 . . S @(XMTROOT_XMCNT_")")=XMZ
17 . . Q:'$D(XMFLDS)
18 . . D FIELDS(XMDUZ,XMK,XMKN,XMZ,.XMFLDS,XMTROOT,XMCNT)
19 . . I XMFLDS["SEQN" D KSEQN(XMDUZ,XMK,XMZ,.XMFLDS,XMTROOT,XMCNT)
20 S XMSTART("XMK")=XMK
21 S XMSTART("XMZ")=XMZ
22 S @(XMTROOT_"0)")=XMCNT_U_XMAMT
23 ; Any more?
24 I 'XMK S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
25 I '$O(^XMB(3.7,XMDUZ,XMTYPE,XMK)),'$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
26 I '$D(XMF) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^1" Q
27 N XMORE
28 S XMORE=0,XMK=XMK-.01
29 F S XMK=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK)) Q:'XMK D Q:XMORE
30 . F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) Q:'XMZ D Q:XMORE
31 . . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
32 . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
33 . . I $$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF) S XMORE=1
34 S @(XMTROOT_"0)")=@(XMTROOT_"0)")_U_XMORE
35 Q
36REGAC(XMDUZ,XMORDER,XMFLDS,XMAMT,XMSTART,XMF,XMTROOT) ; Messages (by C-xref) in all baskets
37 N XMCNT,XMK,XMKN,XMKZ,XMZ
38 S XMCNT=0
39 S XMK=+$G(XMSTART("XMK")) I XMK S XMK=XMK-.01
40 S XMKZ=$G(XMSTART("XMKZ"))
41 F S XMK=$O(^XMB(3.7,XMDUZ,2,XMK)) Q:'XMK D Q:XMCNT=XMAMT
42 . S XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
43 . F S XMKZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMORDER) Q:'XMKZ S XMZ=$O(^(XMKZ,"")) D Q:XMCNT=XMAMT
44 . . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITC^XMUT4A(XMDUZ,XMK,XMZ,XMKZ)
45 . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
46 . . I $D(XMF) Q:'$$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF)
47 . . S XMCNT=XMCNT+1
48 . . S @(XMTROOT_XMCNT_")")=XMZ
49 . . Q:'$D(XMFLDS)
50 . . D FIELDS(XMDUZ,XMK,XMKN,XMZ,.XMFLDS,XMTROOT,XMCNT)
51 . . I XMFLDS["SEQN" D SEQN(XMDUZ,XMKZ,.XMFLDS,XMTROOT,XMCNT)
52 S XMSTART("XMK")=XMK
53 S XMSTART("XMKZ")=XMKZ
54 S @(XMTROOT_"0)")=XMCNT_U_XMAMT
55 ; Any more?
56 I 'XMK S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
57 I '$O(^XMB(3.7,XMDUZ,2,XMK)),'$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMORDER) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
58 I '$D(XMF) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^1" Q
59 N XMORE
60 S XMORE=0,XMK=XMK-.01
61 F S XMK=$O(^XMB(3.7,XMDUZ,2,XMK)) Q:'XMK D Q:XMORE
62 . F S XMKZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMORDER) Q:'XMKZ S XMZ=$O(^(XMKZ,"")) D Q:XMORE
63 . . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITC^XMUT4A(XMDUZ,XMK,XMZ,XMKZ)
64 . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
65 . . I $$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF) S XMORE=1
66 S @(XMTROOT_"0)")=@(XMTROOT_"0)")_U_XMORE
67 Q
68REGAZ(XMDUZ,XMORDER,XMFLDS,XMAMT,XMSTART,XMF,XMTROOT) ; Messages (by IEN) in all baskets
69 N XMCNT,XMK,XMKN,XMZ
70 S XMCNT=0
71 S XMK=+$G(XMSTART("XMK")) I XMK S XMK=XMK-.01
72 S XMZ=$G(XMSTART("XMZ"))
73 F S XMK=$O(^XMB(3.7,XMDUZ,2,XMK)) Q:'XMK D Q:XMCNT=XMAMT
74 . S XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
75 . I +XMZ=0 S XMZ=0 I XMORDER=-1 S XMZ=":"
76 . F S XMZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,XMZ),XMORDER) Q:'XMZ D Q:XMCNT=XMAMT
77 . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
78 . . I $D(XMF) Q:'$$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF)
79 . . S XMCNT=XMCNT+1
80 . . S @(XMTROOT_XMCNT_")")=XMZ
81 . . Q:'$D(XMFLDS)
82 . . D FIELDS(XMDUZ,XMK,XMKN,XMZ,.XMFLDS,XMTROOT,XMCNT)
83 . . I XMFLDS["SEQN" D KSEQN(XMDUZ,XMK,XMZ,.XMFLDS,XMTROOT,XMCNT)
84 S XMSTART("XMK")=XMK
85 S XMSTART("XMZ")=XMZ
86 S @(XMTROOT_"0)")=XMCNT_U_XMAMT
87 ; Any more?
88 I 'XMK S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
89 I '$O(^XMB(3.7,XMDUZ,2,XMK)),'$O(^XMB(3.7,XMDUZ,2,XMK,1,XMZ),XMORDER) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
90 I '$D(XMF) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^1" Q
91 N XMORE
92 S XMORE=0,XMK=XMK-.01
93 F S XMK=$O(^XMB(3.7,XMDUZ,2,XMK)) Q:'XMK D Q:XMORE
94 . I +XMZ=0 S XMZ=0 I XMORDER=-1 S XMZ=":"
95 . F S XMZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,XMZ),XMORDER) Q:'XMZ D Q:XMORE
96 . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
97 . . I $$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF) S XMORE=1
98 S @(XMTROOT_"0)")=@(XMTROOT_"0)")_U_XMORE
99 Q
100FIELDS(XMDUZ,XMK,XMKN,XMZ,XMFLDS,XMTROOT,XMCNT) ;
101 N XMZREC,XMLOOK,XMVAL
102 I XMFLDS["BSKT" D
103 . S XMLOOK=$P($P(XMFLDS,"BSKT",2),";",1)
104 . S @(XMTROOT_XMCNT_",""BSKT"")")=XMK_$S(XMLOOK["I":"",1:U_XMKN)
105 . I XMLOOK["X" S @(XMTROOT_"""BSKT"",XMKN,XMCNT)")=""
106 I XMFLDS["FROM" D
107 . I '$D(XMZREC) S XMZREC=$G(^XMB(3.9,XMZ,0))
108 . S XMLOOK=$P($P(XMFLDS,"FROM",2),";",1)
109 . I XMLOOK["I" S @(XMTROOT_XMCNT_",""FROM"")")=$P(XMZREC,U,2) Q:XMLOOK'["X"
110 . S XMVAL=$$FROM^XMXUTIL2(XMZREC)
111 . I $E(XMVAL)="<" S XMVAL=$E(XMVAL,2,$L(XMVAL)-1)
112 . I XMLOOK'["I" S @(XMTROOT_XMCNT_",""FROM"")")=$P(XMZREC,U,2)_U_XMVAL Q:XMLOOK'["X"
113 . S @(XMTROOT_"""FROM"",XMVAL,XMCNT)")=""
114 I XMFLDS["DATE" D
115 . I '$D(XMZREC) S XMZREC=$G(^XMB(3.9,XMZ,0))
116 . S XMLOOK=$P($P(XMFLDS,"DATE",2),";",1)
117 . I XMLOOK'["X" D Q
118 . . I XMLOOK["I" S @(XMTROOT_XMCNT_",""DATE"")")=$P(XMZREC,U,3) Q
119 . . I XMLOOK["F" D Q
120 . . . S XMVAL=$P(XMZREC,U,3)
121 . . . I XMVAL'?7N.E S XMVAL=$$CONVERT^XMXUTIL1(XMVAL,1) I XMVAL=-1 S XMVAL=$P(XMZREC,U,3)
122 . . . S @(XMTROOT_XMCNT_",""DATE"")")=$P(XMZREC,U,3)_U_XMVAL
123 . . S @(XMTROOT_XMCNT_",""DATE"")")=$P(XMZREC,U,3)_U_$$DATE^XMXUTIL2(XMZREC)
124 . S XMVAL=$P(XMZREC,U,3)
125 . I XMVAL'?7N.E S XMVAL=$$CONVERT^XMXUTIL1(XMVAL,1)
126 . S @(XMTROOT_"""DATE"",XMVAL,XMCNT)")=""
127 . I XMLOOK["I" S @(XMTROOT_XMCNT_",""DATE"")")=$P(XMZREC,U,3) Q
128 . I XMLOOK["F" S @(XMTROOT_XMCNT_",""DATE"")")=$P(XMZREC,U,3)_U_XMVAL Q
129 . S @(XMTROOT_XMCNT_",""DATE"")")=$P(XMZREC,U,3)_U_$$DATE^XMXUTIL2(XMZREC)
130 I XMFLDS["SUBJ" D
131 . I '$D(XMZREC) S XMZREC=$G(^XMB(3.9,XMZ,0))
132 . S XMLOOK=$P($P(XMFLDS,"SUBJ",2),";",1)
133 . I XMLOOK'["X" S @(XMTROOT_XMCNT_",""SUBJ"")")=$$SUBJ^XMXUTIL2(XMZREC) Q
134 . S XMVAL=$$SUBJ^XMXUTIL2(XMZREC)
135 . S @(XMTROOT_XMCNT_",""SUBJ"")")=XMVAL
136 . S @(XMTROOT_"""SUBJ"",XMVAL,XMCNT)")=""
137 I XMFLDS["PRI" D
138 . I '$D(XMZREC) S XMZREC=$G(^XMB(3.9,XMZ,0))
139 . S @(XMTROOT_XMCNT_",""PRI"")")=$$PRI^XMXUTIL2(XMZREC)
140 I XMFLDS["LINE" S @(XMTROOT_XMCNT_",""LINE"")")=$$LINE^XMXUTIL2(XMZ)
141 I XMFLDS["NEW" S @(XMTROOT_XMCNT_",""NEW"")")=$$NEW^XMXUTIL2(XMDUZ,XMK,XMZ)
142 I XMFLDS["RESP" S @(XMTROOT_XMCNT_",""RESP"")")=$$RESP^XMXUTIL2(XMZ)
143 I XMFLDS["READ" S @(XMTROOT_XMCNT_",""READ"")")=$$ZREAD^XMXUTIL2(XMDUZ,XMZ)
144 Q
145KSEQN(XMDUZ,XMK,XMZ,XMFLDS,XMTROOT,XMCNT) ;
146 S @(XMTROOT_XMCNT_",""SEQN"")")=$$KSEQN^XMXUTIL2(XMDUZ,XMK,XMZ)
147 Q
148SEQN(XMDUZ,XMKZ,XMFLDS,XMTROOT,XMCNT) ;
149 S @(XMTROOT_XMCNT_",""SEQN"")")=XMKZ
150 Q
Note: See TracBrowser for help on using the repository browser.