Yes It works as you suggest
if can be useful, this is the code:
ED encapsuledData = new ED(mdm_message);
encapsuledData.getTypeOfData().setValue("multipart");
encapsuledData.getDataSubtype().setValue("x-hl7-cda-level-one");
encapsuledData.getEncoding().setValue("A");
// MIME message with a xml and a pdf file
javax.mail.internet.MimeMultipart mimeMessage=
createMIME(xmlMessage,pdfFileName);
// send the MIME message into a ByteArrayOutputStream
ByteArrayOutputStream byte1=new ByteArrayOutputStream();
mimeMessage.writeTo(byte1);
// set the value of ED with the String
encapsuledData.getData().setValue( byte1.toString() );
// setting the data in the OBX segment
obx.getObservationValue(0).setData(encapsuledData);
Cheers, Alessandro
alessandro ha scritto:
> Thanks very much for the response
>
> I was thinking to write the MIME information adding String in the OBX-5;
> and then in particular I have to add some XML and a PDF document in this
> object, so I can add as you suggest with StringOutputStream
>
> Thanks Alessandro
>
>
> James Agnew ha scritto:
>
>> Hi Allesandro,
>>
>> Have you had any luck with this yet?
>>
>> I would imagine you could accomplish this by using a
>> "StringOutputStream" to capture the output of the MimeMultipart's
>> writeTo method, and then use that as the string to place in an
>> encapsulated data object.
>>
>> Here's an example of how to create a StringOutputStream:
>> http://www.m0interactive.com/archives/2006/11/30/convert_a_outputstream_to_a_java_string.html
>>
>> Cheers,
>> James
>>
>>
>> On Wed, Jul 8, 2009 at 11:56 AM, alessandro
>> <[email protected] <mailto:[email protected]>>
>> wrote:
>>
>> Hi all, I will be very happy to have an help about this:
>>
>> I have to do add the CDA-basedMML in to the OBX-5 of a MDM^T02
>> HL7 v.2.3.1
>>
>> the CDA-basedMML document is a multimedia object
>> and it is exchanged as a package in MIME
>> (Multipurpose Internet Mail Exchange: RFC2046)
>> format and encoded as an encapsulated data type
>> (ca.uhn.hl7v2.model.v231.datatype.ED ?).
>>
>> but the the ED tpye accept only String setting data:
>>
>> I write this code:
>>
>> ED encapsuledData = obx.getObservationValue(0).getData();
>>
>> encapsuledData.getTypeOfData().setValue("multipart");
>> encapsuledData.getDataSubtype().setValue("x-hl7-cda-level-one");
>> encapsuledData.getEncoding().setValue("A");
>>
>> and then i have
>> encapsuledData.getData().setValue(String value) ???
>>
>>
>> It's possible to add an object like this?
>>
>> javax.mail.internet.MimeMultipart mimeMessage = new
>> javax.mail.internet.MimeMultipart();
>>
>> MimeBodyPart parteUno= new MimeBodyPart( inputStream );
>> mimeMessage.addBodyPart(parteUno);
>>
>> Thanks a lot
>>
>>
>> ------------------------------------------------------------------------------
>> Enter the BlackBerry Developer Challenge
>> This is your chance to win up to $100,000 in prizes! For a limited
>> time,
>> vendors submitting new applications to BlackBerry App World(TM)
>> will have
>> the opportunity to enter the BlackBerry Developer Challenge. See
>> full prize
>> details at: http://p.sf.net/sfu/Challenge
>> _______________________________________________
>> Hl7api-devel mailing list
>> [email protected]
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>
>>
>>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Hl7api-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel