Home > Healthcare Integration > Using Rhapsody functionality to convert an XML Document into a PDF Document.

Using Rhapsody functionality to convert an XML Document into a PDF Document.

Vendor A sends an HL7 2.X message that contains a base 64 encoded XML document in an OBX.5 field. Vendor B needs the XML document converted to a PDF document and placed back in the message in OBX.5 as a base 64 encoded document. Rhapsody provides all of the filters necessary to accomplish this in a simple route.

The steps necessary are:

  1. Save off the HL7 message in a JavaScript filter with message collection enabled using the message control ID.
  2. Extract base 64 encoded XML document from the HL7 message using a JavaScript filter.
  3. Decode the base 64 encoded document using a Base 64 Encoding filter.
  4. Translate the XML document into a PDF using the XML to PDF filter.
  5. Encode the PDF in Base 64 using the Base 64 encoding filter.
  6. Insert the encoded Base 64 encoded PDF into the OBX.5 replacing the encoded XML document.

Step 4 requires a knowledge of XSL:FO and XSLT. A basic source of information can be found at http://www.w3schools.com/xslfo/. XSLT is a multiple paradigm language that can support declarative or imperative programming. In this case I took an imperative approach because of the team’s experience.

Here is what the route would look like.

TranslateXmlToPdf

Advertisements
Categories: Healthcare Integration Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: