Re: Base64 Encoded text

2019-02-14 Thread Robert McKeever via 4D_Tech
Actually, I look for the HL7 delimiters (the vertical bar | and the carat ^). 
It breaks the HL7 into its component parts wonderfully well. I appreciate the 
comment. 

> On Feb 14, 2019, at 12:10 PM, slerch via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> BASE64 can be split into multiple lines so if you are looking for a CR or
> CRLF break between OBX segments, you could be getting the character found
> inside the BASE64 segment instead and so when you go to pull the info you
> actually have just part of the full BASE64 text. Therefore when it attempts
> to convert it back it fails since it does not actually have the full
> segment.
> 
> 
> 
> --
> Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> **
> 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
> **

_
Bob McKeever  http://www.mswl.com 
McKeever's Software Wizardry
Port Coquitlam, B.C.
bobmckee...@mac.com




**
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
**

Re: Base64 Encoded text

2019-02-14 Thread Robert McKeever via 4D_Tech
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 
> <4d_tech@lists.4d.com> 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 
>> <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 
>> '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:4d_tech-unsubscr...@lists.4d.com
> **

_
Bob McKeever  http://www.mswl.com 
McKeever's Software Wizardry
Port Coquitlam, B.C.
bobmckee...@mac.com




**
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
**

Re: Base64 Encoded text

2019-02-14 Thread slerch via 4D_Tech
BASE64 can be split into multiple lines so if you are looking for a CR or
CRLF break between OBX segments, you could be getting the character found
inside the BASE64 segment instead and so when you go to pull the info you
actually have just part of the full BASE64 text. Therefore when it attempts
to convert it back it fails since it does not actually have the full
segment.



--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
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
**

Re: Base64 Encoded text

2019-02-14 Thread Koen Van Hooreweghe via 4D_Tech
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 
> <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 
> '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:4d_tech-unsubscr...@lists.4d.com
**

Base64 Encoded text

2019-02-13 Thread Robert McKeever via 4D_Tech
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?
_
Bob McKeever  http://www.mswl.com 
McKeever's Software Wizardry
Port Coquitlam, B.C.
bobmckee...@mac.com




**
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
**