Changeset 1204 for ccr/trunk/p/C0CMIME.m


Ignore:
Timestamp:
Jun 23, 2011, 3:01:41 PM (13 years ago)
Author:
George Lilly
Message:

updates for MU Certification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CMIME.m

    r1191 r1204  
    1 C0CMIME ; CCDCCR/GPL - MIME manipulation utilities; 3/8/11
     1C0CMIME ; CCDCCR/GPL - MIME manipulation utilities; 3/8/11 ; 5/16/11 2:32pm
    22 ;;1.0;C0C;;Mar 8, 2011;
    33 ;Copyright 2008 George Lilly.  Licensed under the terms of the GNU
     
    8181 S C0CGM(4)="It is purely test data used for software development"
    8282 S C0CGM(5)="It does not represent information about any person living or dead"
    83  S ZTO("glilly@glilly.net")=""
    84  S ZTO("LILLY.GEORGE@mdc-crew.net")=""
     83 ;S ZTO("glilly@glilly.net")=""
     84 ;S ZTO("george.lilly@pobox.com")=""
     85 ;S ZTO("george@nhin.openforum.opensourcevista.net")=""
     86 ;S ZTO("mish@nhin.openforum.opensourcevista.net")=""
     87 S ZTO("brooks.richard@securemail.opensourcevista.net")=""
     88 ;S ZTO("LILLY.GEORGE@mdc-crew.net")=""
    8589 ;S ZTO("ncoal@live.com")=""
    8690 ;S ZTO("martijn@djigzo.com")=""
    8791 ;S ZTO("profmish@gmail.com")=""
    8892 ;S ZTO("nanthracite@earthlink.net")=""
    89  S ZFROM="ANTHRACITE.NANCY"
     93 S ZTO("gpl.doctortest@gmail.com")=""
     94 S ZFROM="LILLY.GEORGE"
    9095 S ZATTACH=$NA(^GPL("CCR"))
    9196 I $G(@ZATTACH@(1))="" D  ; NO CCR THERE
     
    9398 . M @ZATTACH=GPL ; PUT IT IN THERE FOR NEXT TIME
    9499 S ZSUBJECT="TEST OF THE NEW MAILSEND ROUTINE"
    95  D MAILSEND(.GR,ZFROM,"ZTO",,ZSUBJECT,"C0CGM",ZATTACH)
     100 D MAILSEND(.GR,ZFROM,"ZTO",,ZSUBJECT,"C0CGM",ZATTACH,"CCR.xml")
    96101 ZWR GR
    97102 Q
    98103 ;
    99 MAILSEND(RTN,FROM,TO,CC,SUBJECT,MESSAGE,ATTACH,FLAGS) ; MAIL SENDING INTERFACE
     104LINE(C0CFILE,C0CTO) ; read a file name passed in C0CFILE and send it to
     105 ; the email address in C0CTO
     106 ; the directory and the "from" are all hard coded
     107 ;
     108 N ZZFROM S ZZFROM="LILLY.GEORGE"
     109 N GN S GN=$NA(^TMP("C0CMIME2",$J))
     110 N GN1 S GN1=$NA(@GN@(1))
     111 K @GN
     112 I '$D(C0CFILE) Q  ; NO FILENAME PASSED
     113 I '$D(C0CTO) S C0CTO="brooks.richard@securemail.opensourcevista.net"
     114 S ZZTO(C0CTO)=""
     115 N ZMESS S ZMESS(1)="file transmission from wvehr3-09"
     116 N GD S GD="/home/wvehr3-09/EHR/" ; directory
     117 I '$$FTG^%ZISH(GD,C0CFILE,GN1,3) Q  D  ;
     118 . W !,"error reading file",C0CFILE
     119 D MAILSEND(.ZRTN,ZZFROM,"ZZTO",,"file transmission","ZMESS",GN,C0CFILE)
     120 K @GN ; CLEAN UP
     121 ;ZWR ZRTN
     122 W !,$G(ZRTN(1))
     123 Q
     124 ;
     125MAILSEND(RTN,FROM,TO,CC,SUBJECT,MESSAGE,ATTACH,FNAME,FLAGS) ; MAIL SENDING INTERFACE
    100126 ; RTN IS THE RETURN ARRAY PASSED BY REFERENCE
    101127 ; FROM IS PASSED BY VALUE AND IS THE EMAIL ADDRESS OF THE SENDER
     
    107133 ; MESSAGE IS PASSED BY NAME AND IS AN ARRAY OF TEXT
    108134 ; ATTACH IS PASSED BY NAME AND IS AN XML OR HTML FILE TO BE ATTACHED
    109  ;
     135 ; FNAME IS THE FILENAME OF THE ATTACHMENT, DEFAULT IS ccr.xml
     136 ;
     137 I '$D(FNAME) S FNAME="ccr.xml" ; default filename
    110138 N GN
    111139 S GN=$NA(^TMP($J,"C0CMIME"))
     
    113141 S GM(1)="MIME-Version: 1.0"
    114142 S GM(2)="Content-Type: multipart/mixed; boudary=""1234567"""
    115  S GM(3)=" "
    116  S GM(4)=" "
     143 S GM(3)=""
     144 S GM(4)=""
    117145 ;S GM(5)="--123456788888"
    118146 ;S GM(5)=$$REPEAT^XLFSTR("-",$L(X))
    119147 S GM(5)="--123456899999"
    120  S GM(6)="Content-Type: text/xml; name=""ccr.xml"""
     148 S GM(6)="Content-Type: text/xml; name="_FNAME
    121149 S GM(7)="Content-Transfer-Encoding: base64"
    122  S GM(8)="Content-Disposition: attachment; filename=""ccr.xml"""
    123  S GM(9)=" "
    124  S GM(10)=" " ; FOR THE END
     150 S GM(8)="Content-Disposition: attachment; filename="_FNAME
     151 S GM(9)=""
     152 S GM(10)="" ; FOR THE END
    125153 ;S GM(11)="--123456788888--"
    126154 S GM(11)="--123456899999--"
    127  S GM(12)=" "
    128  S GM(13)=" "
     155 S GM(12)=""
     156 S GM(13)=""
    129157 S GG(1)="--123456899999"
    130158 S GG(2)="Content-Type: text/plain; charset=ISO-8859-1; format=flowed"
    131159 S GG(3)="Content-Transfer-Encoding: 7bit"
    132  S GG(4)=" "
     160 S GG(4)=""
    133161 S GG(5)="This is a test message."
    134162 S GG(6)="A Continuity of Care record is attached"
     
    136164 S GG(8)="It is purely test data used for software development"
    137165 S GG(9)="It does not represent information about any person living or dead"
    138  S GG(10)=" "
     166 S GG(10)=""
    139167 S GG(11)="--123456899999--"
    140168 ;S GG(11)="Content-Type: text/plain; charset=""us-ascii"""
    141  S GG(12)=" "
     169 S GG(12)=""
    142170 ;S GG(13)="This is a test message."
    143171 S GG(14)="A Continuity of Care record is attached"
     
    145173 S GG(16)="It is purely test data used for software development"
    146174 S GG(17)="It does not represent information about any person living or dead"
    147  S GG(18)=" "
     175 S GG(18)=""
    148176 S GG(19)="--123456899999"
    149177 S GG(20)="--987654321--"
     
    183211 S GM(1)="MIME-Version: 1.0"
    184212 S GM(2)="Content-Type: multipart/mixed; boudary=""1234567"""
    185  S GM(3)=" "
    186  S GM(4)=" "
     213 S GM(3)=""
     214 S GM(4)=""
    187215 S GM(5)="--1234567"
    188216 ;S GM(5)=$$REPEAT^XLFSTR("-",$L(X))
     
    191219 S GM(8)="Content-Disposition: attachment; filename=""ccr.xml"""
    192220 ;S GM(6)=$$UUBEGFN^LRSRVR2A("CCR.xml")
    193  S GM(9)=" "
    194  S GM(10)=" " ; FOR THE END
     221 S GM(9)=""
     222 S GM(10)="" ; FOR THE END
    195223 S GM(11)="--frontier--"
    196224 S GM(12)="."
    197  S GM(13)=" "
     225 S GM(13)=""
    198226 K GBLD
    199227 ;D QUEUE^C0CXPATH("GBLD","GM",1,9)
     
    232260 S GM(1)="MIME-Version: 1.0"
    233261 S GM(2)="Content-Type: multipart/mixed; boudary=""1234567"""
    234  S GM(3)=" "
    235  S GM(4)=" "
     262 S GM(3)=""
     263 S GM(4)=""
    236264 S GM(5)="--1234567"
    237265 ;S GM(5)=$$REPEAT^XLFSTR("-",$L(X))
     
    240268 S GM(8)="Content-Disposition: attachment; filename=""ccr.xml"""
    241269 ;S GM(6)=$$UUBEGFN^LRSRVR2A("CCR.xml")
    242  S GM(9)=" "
    243  S GM(10)=" " ; FOR THE END
     270 S GM(9)=""
     271 S GM(10)="" ; FOR THE END
    244272 S GM(11)="--1234567--"
    245  S GM(12)=" "
    246  S GM(13)=" "
     273 S GM(12)=""
     274 S GM(13)=""
    247275 K GBLD
    248276 D QUEUE^C0CXPATH("GBLD","GM",5,9)
Note: See TracChangeset for help on using the changeset viewer.