Hi Bob,

It is normal the HL7text is longer than the PDF size. As Base64 encoding 
converts a binary file to be sent by a text protocol.
I decoded the starting part of your hl7 record you provided and I get '%PDF-1.4 
%' which is the start of a PDF file. Looks good to me.

For start you could try to copy the pdf part of the hl7 message and paste it 
into an online decoding tool (like www.base64decode.org) to see what you get. 
Maybe there are some trailing characters in the base64 part of the message 
which you need to eliminate?

You could also try the other way and encode the provided PDF file to base64 
using 4D and compare it to its hl7 counterpart. Maybe you can discover some 

Kind regards,

> Op 14 feb. 2019, om 06:30 heeft Robert McKeever via 4D_Tech 
> <4d_tech@lists.4d.com> het volgende geschreven:
> The health authority has decided to release some results (discharge reports) 
> in PDF form which we receive in HL7 format.
> The line received begins with 
> I’ve tried 
> $BlobText:=substring([PatientLabResults]HL7Text;36;length([PatientLabResults]HL7Text))
> BASE64 DECODE($BlobText;[PatientLabRequests]PDF_Blob)
> which does not work.
> They were nice enough to include a sample HL7 file and the sample PDF. The 
> size of the PDF is 68,076, while the length of the HL7Text is 85,807.
> So, what do I need to do to turn the encoded text into a PDF?

Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Aalter
tel +32 495 511.653

4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com

Reply via email to