Hi all,
I'm using a snippet I found from Scott Roth to extract, decode, and save a PDF from a HL7 message and save it to a specified file path, but I'm running issues with the following error:.png)
My approach was to a create a utility function accessible from a DTL like this:
Class ELHTPRODPKG.Functions.Utility.ExtractPDF Extends Ens.Rule.FunctionSet
{
ClassMethod DecodeBase64HL7(base64 As %Stream.GlobalBinary, Path As %String, FileName As %String) As %String [ Final ]
{
//Debug
WRITE $LENGTH(base64)
// Decode
set Oref = ##class(%FileBinaryStream).%New()
set Oref.Filename = Path_FileName
Do base64.Rewind()
While 'base64.AtEnd
{
set ln=base64.ReadLine()
set lnDecoded=$system.Encryption.Base64Decode(ln)
do Oref.Write(lnDecoded)
}
Do Oref.%Save()
return Oref.Filename
}
}
I recently published 
.png)
Developing the project .png)
.png)


