source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMXLIST2.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: 3.7 KB
Line 
1XMXLIST2 ;ISC-SF/GMB-List message: multiple conditions (cont.) ;08/30/2000 11:01
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Look in just one of the user's baskets.
4NEW1(XMDUZ,XMK,XMKN,XMTYPE,XMORDER,XMFLDS,XMAMT,XMSTART,XMF,XMTROOT) ; New messages in 1 basket
5 N XMCNT,XMZ
6 S XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
7 S XMCNT=0
8 S XMZ=$G(XMSTART("XMZ"))
9 F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) Q:'XMZ D Q:XMCNT=XMAMT
10 . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
11 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
12 . I $D(XMF) Q:'$$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF)
13 . S XMCNT=XMCNT+1
14 . S @(XMTROOT_XMCNT_")")=XMZ
15 . Q:'$D(XMFLDS)
16 . D FIELDS^XMXLIST1(XMDUZ,XMK,XMKN,XMZ,.XMFLDS,XMTROOT,XMCNT)
17 . I XMFLDS["SEQN" D KSEQN^XMXLIST1(XMDUZ,XMK,XMZ,.XMFLDS,XMTROOT,XMCNT)
18 S XMSTART("XMZ")=XMZ
19 S @(XMTROOT_"0)")=XMCNT_U_XMAMT
20 ; Any more?
21 I 'XMZ S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
22 I '$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
23 I '$D(XMF) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^1" Q
24 N XMORE
25 S XMORE=0
26 F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMORDER) Q:'XMZ D Q:XMORE
27 . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
28 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
29 . I $$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF) S XMORE=1
30 S @(XMTROOT_"0)")=@(XMTROOT_"0)")_U_XMORE
31 Q
32REG1C(XMDUZ,XMK,XMKN,XMORDER,XMFLDS,XMAMT,XMSTART,XMF,XMTROOT) ; Messages (by C-xref) in one basket
33 N XMCNT,XMKZ,XMZ
34 S XMCNT=0
35 S XMKZ=$G(XMSTART("XMKZ"))
36 F S XMKZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMORDER) Q:'XMKZ S XMZ=$O(^(XMKZ,"")) D Q:XMCNT=XMAMT
37 . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITC^XMUT4A(XMDUZ,XMK,XMZ,XMKZ)
38 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
39 . I $D(XMF) Q:'$$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF)
40 . S XMCNT=XMCNT+1
41 . S @(XMTROOT_XMCNT_")")=XMZ
42 . Q:'$D(XMFLDS)
43 . D FIELDS^XMXLIST1(XMDUZ,XMK,XMKN,XMZ,.XMFLDS,XMTROOT,XMCNT)
44 . I FIELDS["SEQN" D SEQN^XMXLIST1(XMDUZ,XMKZ,.XMFLDS,XMTROOT,XMCNT)
45 S XMSTART("XMKZ")=XMKZ
46 S @(XMTROOT_"0)")=XMCNT_U_XMAMT
47 ; Any more?
48 I 'XMKZ S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
49 I '$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMORDER) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
50 I '$D(XMF) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^1" Q
51 N XMORE
52 S XMORE=0
53 F S XMKZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMORDER) Q:'XMKZ S XMZ=$O(^(XMKZ,"")) D Q:XMORE
54 . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITC^XMUT4A(XMDUZ,XMK,XMZ,XMKZ)
55 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
56 . I $$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF) S XMORE=1
57 S @(XMTROOT_"0)")=@(XMTROOT_"0)")_U_XMORE
58 Q
59REG1Z(XMDUZ,XMK,XMKN,XMORDER,XMFLDS,XMAMT,XMSTART,XMF,XMTROOT) ; Messages (by IEN) in one basket
60 N XMCNT,XMZ
61 S XMCNT=0
62 S XMZ=$G(XMSTART("XMZ"))
63 I +XMZ=0 S XMZ=0 I XMORDER=-1 S XMZ=":"
64 F S XMZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,XMZ),XMORDER) Q:'XMZ D Q:XMCNT=XMAMT
65 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
66 . I $D(XMF) Q:'$$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF)
67 . S XMCNT=XMCNT+1
68 . S @(XMTROOT_XMCNT_")")=XMZ
69 . Q:'$D(XMFLDS)
70 . D FIELDS^XMXLIST1(XMDUZ,XMK,XMKN,XMZ,.XMFLDS,XMTROOT,XMCNT)
71 . I XMFLDS["SEQN" D KSEQN^XMXLIST1(XMDUZ,XMK,XMZ,.XMFLDS,XMTROOT,XMCNT)
72 S XMSTART("XMZ")=XMZ
73 S @(XMTROOT_"0)")=XMCNT_U_XMAMT
74 ; Any more?
75 I 'XMZ S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
76 I '$O(^XMB(3.7,XMDUZ,2,XMK,1,XMZ),XMORDER) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^0" Q
77 I '$D(XMF) S @(XMTROOT_"0)")=@(XMTROOT_"0)")_"^1" Q
78 N XMORE
79 S XMORE=0
80 F S XMZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,XMZ),XMORDER) Q:'XMZ D Q:XMORE
81 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
82 . I $$GOODMSG^XMJMFB(XMDUZ,XMK,XMZ,.XMF) S XMORE=1
83 S @(XMTROOT_"0)")=@(XMTROOT_"0)")_U_XMORE
84 Q
Note: See TracBrowser for help on using the repository browser.