source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMFAX.m@ 1432

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

initial load of WorldVistAEHR

File size: 2.8 KB
RevLine 
[613]1XMFAX ;ISC-SF/GMB-Fax ;04/08/2002 14:46
2 ;;8.0;MailMan;;Jun 28, 2002
3FAX(XMZ) ; Fax a message
4 N XMABORT,XMCNT,XMFIEN,XMQUIET
5 S XMQUIET=1 ; "quiet flag"
6 S XMABORT=0
7 D CRE8FAX(XMZ,XMQUIET,.XMCNT,.XMABORT) Q:XMABORT
8 D SENDFAX(XMQUIET,XMFIEN,XMCNT)
9 Q
10CRE8FAX(XMZ,XMQUIET,XMCNT,XMABORT) ;
11 N XMFID
12 D RECORD(XMQUIET,.XMFID,.XMFIEN,.XMABORT) Q:XMABORT
13 L +^AKF("FAX",XMFIEN)
14 D RECIPS(XMZ,XMFID,XMFIEN,.XMCNT)
15 D BODY(XMZ,XMFIEN)
16 L -^AKF("FAX",XMFIEN)
17 Q
18RECORD(AKQ,AKFAX,AKIEN,XMABORT) ; Add record to fax file
19 ; AKFAX Fax ID
20 ; AKIEN Record number in ^AKF("FAX",
21 D NE^AKFAX0 I '$D(AKFAX) S XMABORT=1 Q ; Add record to fax file
22 S $P(^AKF("FAX",AKIEN,0),U,4)=1 ; This is a MailMan-generated fax
23 Q
24RECIPS(XMZ,XMFID,XMFIEN,XMCNT) ; Add recipients to fax record and update recipient record in mail msg.
25 N I,XMREC,XMIENS,XMFDA
26 S I="",XMCNT=0
27 F S I=$O(^XMB(3.9,XMZ,1,"AFAX",I)) Q:I="" D
28 . S XMREC=$G(^AKF("FAXR",I,0)) Q:XMREC=""
29 . S XMCNT=XMCNT+1
30 . S XMIENS="+1,"_XMFIEN_","
31 . S XMFDA(589500.01,XMIENS,.01)=I ; Pointer to recipient
32 . S XMFDA(589500.01,XMIENS,1)=$$EZBLD^DIALOG(39303.7) ;Awaiting Transmission Path
33 . S XMFDA(589500.01,XMIENS,2)=$P(XMREC,U,2) ; Recipient fax phone
34 . S XMFDA(589500.01,XMIENS,3)=$P(XMREC,U,3) ; Recipient physical location
35 . S XMFDA(589500.01,XMIENS,4)=$P(XMREC,U,4) ; Recipient voice phone
36 . D UPDATE^DIE("","XMFDA") ; Add recipient to fax record
37 . S XMIENS=$O(^XMB(3.9,XMZ,1,"AFAX",I,""))_","_XMZ_","
38 . S XMFDA(3.91,XMIENS,4)=$$NOW^XLFDT() ; Current date/time
39 . S XMFDA(3.91,XMIENS,5)="@" ; get rid of status
40 . S XMFDA(3.91,XMIENS,13)="@" ; get rid of xref
41 . S XMFDA(3.91,XMIENS,14)=XMFID ; fax id
42 . D FILE^DIE("","XMFDA") ; Update mail msg recipient
43 Q
44BODY(XMZ,XMFIEN) ; Copy the msg text to the fax text
45 N XMTEXT,XMREC,I,XMDATE,XMFROM
46 S XMREC=^XMB(3.9,XMZ,0)
47 S I=1,XMTEXT(I)=$$EZBLD^DIALOG(34536,$P(XMREC,U,1))_" "_$$EZBLD^DIALOG(34537,XMZ) ; Subj: |1| [#|1|]
48 S XMDATE=$$MMDT^XMXUTIL1($P(XMREC,U,3))
49 I $L(XMTEXT(I))+$L(XMDATE)+1>79 S I=I+1,XMTEXT(I)=XMDATE
50 E S XMTEXT(I)=XMTEXT(I)_" "_XMDATE
51 S I=I+1,XMTEXT(I)=$$EZBLD^DIALOG(39330,^XMB("NETNAME")) ;Site: |1|
52 S I=I+1,XMTEXT(I)=$$EZBLD^DIALOG(34538,$$NAME^XMXUTIL($P(XMREC,U,2),1)) ; From: |1|
53 I DUZ'=$P(XMREC,U,2) S I=I+1,XMTEXT(I)=$$EZBLD^DIALOG(39331,$$NAME^XMXUTIL(DUZ,1)) ;Sender: |1|
54 S I=I+1,XMTEXT(I)="-------------------------------------------------------------------------------"
55 S I=I+1,XMTEXT(I)=""
56 D WP^DIE(589500,XMFIEN_",",7,"","XMTEXT")
57 D WP^DIE(589500,XMFIEN_",",7,"A","^XMB(3.9,"_XMZ_",2)")
58 Q
59SENDFAX(AKQ,AKIEN,AKML) ;
60 W !,$$EZBLD^DIALOG(39332) ;Sending to fax
61 D QUE^AKFAX0
62 Q
63FAXHDR(XMFID,XMFTO) ; Print the fax header
64 W !,$$EZBLD^DIALOG(39333,XMFTO) ;MailMan FAX for |1|
65 N XMPARM S XMPARM(1)=XMFID,XMPARM(2)=$$FMTE^XLFDT($$NOW^XLFDT,5)
66 W !,$$EZBLD^DIALOG(39334,.XMPARM),! ;FAXmail ID: |1|, Faxed: |2|
67 Q
Note: See TracBrowser for help on using the repository browser.