MIME encoding for PDF file

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf MIME encoding for PDF file

  • Creator
    Topic
  • #50422
    Henry Bauer
    Participant

    Does the code

    set fi [open $fileName r]

      fconfigure $fi -translation {binary binary}

      set en64Var [encode [read $fi]]

      close $

    just create a mime file?  I need to create an HL7 transaction that looks like this(below), need to know how to break up the mime into individual OBX segments. Is there a way to do this? Any help would be greatly appreciated.

    MSH|^~&|COPATHPLUS|PPS_SC|4MEDICA|uon1|20081027123000||ORU^R01|500000000006|P|2.3

    PID|1||02366688^^^uon1||LXROUNDIII^Two^C||19771121|F||W|6516 NEWPORT AVENUE^^OMAHA^NE^68154^United States||(402)559-8223|(402)559-8552|||||456-12-3456

    PV1|1||OCUS||||||||||||||5710^Berg^Teresa|C|56659451|B||||||||||||||||||||||||200808280000

    ORC|RE|129192022|S08-194^CoPathPlus||CM||||200809220851|^Gerken^Milissa||9117^Luckasen^John

    OBR|1|129192022|S08-194_1|SR|||200809220849|||||||200809220849||9117||||||200809220852||SP|F||||||||^Gerken^Milissa

    OBX|2|ED||1|Content-Type: text/plain; charset=US-ASCII; name=c:MimeTmime.pdf

    OBX|3|ED||1|Content-transfer-encoding: base64

    OBX|4|ED||1|

    OBX|5|ED||1|JVBERi0xLjQNJeLjz9MNCjYgMCBvYmoNPDwvTGluZWFyaXplZCAxL0wgMzUw

    OBX|6|ED||1|MzkvTyA4L0UgMzA5NDUvTiAxL1QgMzQ4NzMvSCBbIDY3NiAxNzhdPj4NZW5k

    OBX|7|ED||1|b2JqDSAgICAgICAgICAgICAgICAgICAgDQp4cmVmDQo

Viewing 0 reply threads
  • Author
    Replies
    • #66046
      Charlie Bursell
      Participant

      The encode command will do base-64 encoding.  Mime is a spec which includes a lot more than encoding, e.g., multi-parts, etc.

      MIME is specified in six linked RFC memoranda: RFC 2045, RFC 2046, RFC 2047, RFC 4288, RFC 4289 and RFC 2077, which together define the specifications.

      Take a look

Viewing 0 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10