Sidebar

How can I put a PDF in a ORU message base64 encoded

0 votes
1.3K views
asked Oct 14, 2014 by brandon-w-8204 (33,270 points)
edited Oct 14, 2014 by brandon-w-8204
I want to put a PDF in a ORU message. How can I get the PDF in a base64 string.

1 Answer

0 votes
 
Best answer

Use the following code to get the file you want into a base64 string.

message = qie.createHL7Message('UTF-8');

var bytes = qie.readFile('c:\\hl7\\Sample Report.pdf');
var base64 = qie.base64EncodeBytes(bytes);

message.setNode('OBX-5', base64);

 

answered Oct 14, 2014 by brandon-w-8204 (33,270 points)
edited Mar 29, 2018 by michael-h-5027
...