Well, this works but I don’t understand why:

1. Strip off the leading portion (…Base64^). Find the next  vertical bar and 
strip off the vertical bar and anything after it.

2. Base64 decode it into a blob.

3. Create a PDF Document. Do Blob to Document (Yep, opens with Acrobat). Import 
the document into my Blob field.

Note that this method (and the HL7 they decided to use) differs from the last 
time they decided to send us PDF documents.


> On Feb 14, 2019, at 12:16 AM, Koen Van Hooreweghe via 4D_Tech 
> <[email protected]> wrote:
> 
> 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 
> differences?
> 
> Kind regards,
> Koen
> 
> 
>> Op 14 feb. 2019, om 06:30 heeft Robert McKeever via 4D_Tech 
>> <[email protected]> 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 
>> 'OBX|1|ED|PDF^PDF||^TEXT^PDF^Base64^JVBERi0xLjQKJdP0zOEKM’. 
>> 
>> 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
> Belgium
> 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:[email protected]
> **********************************************************************

_________________________________________
Bob McKeever                      http://www.mswl.com <http://www.mswl.com/>
McKeever's Software Wizardry
Port Coquitlam, B.C.
[email protected]




**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to