source: FOIAVistA/trunk/r/MAILMAN-XM/XMXADDR4.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1XMXADDR4 ;ISC-SF/GMB-XMXADDRG (cont.) ;04/17/2002 13:50
2 ;;8.0;MailMan;;Jun 28, 2002
3DISTR(XMDUZ,XMG,XMSTRIKE,XMPREFIX,XMLATER) ;
4 ; XMGN Distribution group name
5 N XMGM,XMGN
6 S XMGM=""
7 F S XMGM=$O(^XMB(3.8,XMG,7,"B",XMGM)) Q:'XMGM D I XMLATER,'$G(XMIA) Q
8 . I '$D(^XMB(3.816,XMGM)) D DELETE1(XMG,7,XMGM) Q
9 . S XMGN=$P(^XMB(3.816,XMGM,0),U,1) Q:XMGN=""
10 . I ".S.s.D.d.H.h.G.g."'[("."_$E(XMGN,1,2)) S XMGN="G."_XMGN
11 . W:$G(XMIA) !,$$EZBLD^DIALOG(39080),XMGN ;Distribution List:
12 . D:'XMLATER EXPDISTR(XMDUZ,XMG,XMGM,XMGN,XMSTRIKE,XMPREFIX,XMLATER)
13 Q
14EXPDISTR(XMDUZ,XMG,XMGM,XMGN,XMSTRIKE,XMPREFIX,XMLATER) ;
15 N XMI,XMDOMAIN
16 ;S:".G.g."'[("."_$E(XMGM,1,2)) XMLATER="" ; XMLATER not appropriate for Servers or Devices.
17 S XMI=0
18 F S XMI=$O(^XMB(3.816,XMGM,1,"B",XMI)) Q:'XMI D
19 . Q:XMI=^XMB("NUM")
20 . S XMDOMAIN=$P($G(^DIC(4.2,XMI,0)),U,1) Q:XMDOMAIN=""
21 . N XMERROR,XMIA,XMVIA
22 . D DNS^XMXADDRD(XMDUZ,XMDOMAIN,.XMVIA)
23 . I $D(XMERROR) S ^TMP("XM",$J,"GRPERR",XMG,"D",XMGN_"@"_XMDOMAIN)=$$GETERR Q
24 . S XMGMBRS=1
25 . D SETEXP^XMXADDR(XMGN_"@"_XMDOMAIN,XMVIA,XMSTRIKE,XMPREFIX,XMLATER)
26 Q
27FAXGROUP(XMDUZ,XMG,XMSTRIKE,XMPREFIX,XMLATER) ;
28 N XMGM,XMI
29 S XMGM=""
30 F S XMGM=$O(^XMB(3.8,XMG,9,"B",XMGM)) Q:XMGM="" D I XMLATER,'$G(XMIA) Q
31 . S XMGN=$P($G(^AKF("FAXG",XMGM,0)),U)
32 . I XMGN="" D DELETE1(XMG,9,XMGM) Q
33 . W:$G(XMIA) !,$$EZBLD^DIALOG(39081),XMGN ;Fax Group:
34 . S XMI=""
35 . F S XMI=$O(^AKF("FAXG",XMGM,2,"B",XMI)) Q:XMI="" D FAX(XMDUZ,XMI,XMSTRIKE,XMPREFIX,XMLATER)
36 Q
37FAX(XMDUZ,XMG,XMSTRIKE,XMPREFIX,XMLATER) ;
38 N XMGN
39 S XMGN=$P($G(^AKF("FAXR",XMG,0)),U)
40 Q:XMGN=""
41 W:$G(XMIA) !,$$EZBLD^DIALOG(39082),XMGN ;Fax Recipient:
42 ;D SETEXP^XMXADDR("F."_XMGN,XMG,XMSTRIKE,XMPREFIX,"") ; XMLATER not appropriate
43 D:'XMLATER SETEXP^XMXADDR("F."_XMGN,XMG,XMSTRIKE,XMPREFIX,XMLATER)
44 S XMGMBRS=1
45 Q
46FAXINDIV(XMDUZ,XMG,XMSTRIKE,XMPREFIX,XMLATER) ;
47 ; XMGM Group member
48 N XMGM,XMCNT
49 S XMGM="",XMCNT=0
50 F S XMGM=$O(^XMB(3.8,XMG,8,"B",XMGM)) Q:XMGM="" D I XMLATER,'$G(XMIA) Q
51 . I '$D(^AKF("FAXR",XMGM)) D DELETE1(XMG,8,XMGM) Q
52 . D FAX(XMDUZ,XMGM,XMSTRIKE,XMPREFIX,XMLATER)
53 Q
54DELETE1(XMGIEN,XMNODE,XMGM) ;
55 N DIK,DA
56 L +^XMB(3.8,XMGIEN,XMNODE):0 E Q
57 S DA=$O(^XMB(3.8,XMG,XMNODE,"B",XMGM,0))
58 S DA(1)=XMGIEN
59 S DIK="^XMB(3.8,"_DA(1)_","_XMNODE_","
60 D ^DIK
61 L -^XMB(3.8,XMGIEN,XMNODE)
62 Q
63DELETE2(XMGIEN,XMNODE,DA) ;
64 N DIK
65 L +^XMB(3.8,XMGIEN,XMNODE):0 E Q
66 S DA(1)=XMGIEN
67 S DIK="^XMB(3.8,"_DA(1)_","_XMNODE_","
68 D ^DIK
69 L -^XMB(3.8,XMGIEN,XMNODE)
70 Q
71GRPERR(XMDUZ,XMG,XMGN) ; Send a bulletin about errors in groups.
72 N XMGIEN,XMPARM,XMINSTR
73 S XMINSTR("FROM")=.5
74 S XMPARM(1)=XMGN
75 S XMGIEN=0
76 F S XMGIEN=$O(^TMP("XM",$J,"GRPERR",XMGIEN)) Q:'XMGIEN D
77 . N XMTXT,XMI,XMTO
78 . S XMI=0
79 . I XMGIEN'=XMG D
80 . . N XMPARM S XMPARM(1)=$P($G(^XMB(3.8,XMGIEN,0)),U,1),XMPARM(2)=XMGIEN
81 . . S XMI=XMI+1,XMTXT(XMI)=""
82 . . S XMI=XMI+1,XMTXT(XMI)=$$EZBLD^DIALOG(39083,.XMPARM) ;Problems in member group: |1| (IEN=|2|)
83 . I $D(^TMP("XM",$J,"GRPERR",XMGIEN,"L")) D GRPTXT(XMGIEN,"L",39084,.XMTXT,.XMI) ;Local Member:
84 . I $D(^TMP("XM",$J,"GRPERR",XMGIEN,"R")) D GRPTXT(XMGIEN,"R",39085,.XMTXT,.XMI) ;Remote Member:
85 . I $D(^TMP("XM",$J,"GRPERR",XMGIEN,"D")) D GRPTXT(XMGIEN,"D",39086,.XMTXT,.XMI) ;Distribution List Domain:
86 . I $D(^TMP("XM",$J,"GRPERR",XMGIEN,"C")) D GRPTXT(XMGIEN,"C",39087,.XMTXT,.XMI) ;Circular Group Reference:
87 . S XMTO(XMDUZ)="" ; Person sending the message
88 . D GRPADDR(XMG,.XMTO)
89 . I XMG'=XMGIEN D GRPADDR(XMGIEN,.XMTO)
90 . D TASKBULL^XMXBULL(XMDUZ,"XM GROUP ERROR",.XMPARM,"XMTXT",.XMTO,.XMINSTR)
91 Q
92GRPTXT(XMGIEN,XMTYPE,XMPROB,XMTXT,XMI) ;
93 N XMNAME
94 S XMNAME=""
95 F S XMNAME=$O(^TMP("XM",$J,"GRPERR",XMGIEN,XMTYPE,XMNAME)) Q:XMNAME="" D
96 . S XMI=XMI+1,XMTXT(XMI)=""
97 . S XMI=XMI+1,XMTXT(XMI)=$$EZBLD^DIALOG(XMPROB)_XMNAME
98 . S XMI=XMI+1,XMTXT(XMI)=$$EZBLD^DIALOG(39088)_^TMP("XM",$J,"GRPERR",XMGIEN,XMTYPE,XMNAME) ;Error:
99 Q
100GRPADDR(XMGIEN,XMTO) ;
101 N I
102 S I=$P($G(^XMB(3.8,XMGIEN,3)),U,1) S:I XMTO(I)="" ; Organizer
103 S I=$P($G(^XMB(3.8,XMGIEN,0)),U,7) S:I XMTO(I)="" ; Coordinator
104 Q:'$D(^XMB(3.8,XMGIEN,4,"B"))
105 S I=0
106 F S I=$O(^XMB(3.8,XMGIEN,4,"B",I)) Q:'I D
107 . S XMTO(I)="" ; Authorized sender
108 Q
109SETERR(XMIA,XMFORMAT,XMDIALOG,XMP1,XMP2,XMP3) ;
110 S XMERROR=XMDIALOG
111 I $D(XMP1) S XMERROR(1)=XMP1
112 I $D(XMP2) S XMERROR(2)=XMP2
113 I $D(XMP3) S XMERROR(3)=XMP3
114 I XMIA D WRIERR(XMFORMAT)
115 Q
116WRIERR(XMFORMAT) ;
117 I XMFORMAT="" W $$GETERR Q
118 I XMFORMAT'="P" D EN^DDIOL($$GETERR,"",XMFORMAT) Q
119 N XMTEXT
120 D BLD^DIALOG(XMERROR,.XMERROR,"","XMTEXT","F")
121 D MSG^DIALOG("WE","","","","XMTEXT")
122 Q
123GETERR() ;
124 Q $$EZBLD^DIALOG(XMERROR,.XMERROR)
Note: See TracBrowser for help on using the repository browser.