Recent posts:
Recent replies:

I do something similar to what you are trying to do, I Decode the PDF, save the PDF locally, and return a path to the DTL.

Several on the developer community helped me figure this out...

ClassMethod DecodeBase64HL7ToFile(base64 As %Stream.GlobalBinary, Ancillary As %String, FileName As %String) As %String


    set ArchDir = "/ensemble/data/transfer/AncillaryPDF/"

    set ArchAncDir = ArchDir_Ancillary_"/"

    set FaxDateDir = ArchAncDir_$PIECE($ZDATE($HOROLOG,7)," ",1)_"-"_$PIECE($ZDATE($HOROLOG,7)," ",2)_"-1/"

    if '##class(%Library.File).DirectoryExists(ArchDir)


        do ##class(%Library.File).CreateDirectory(ArchDir)


    if '##class(%Library.File).DirectoryExists(ArchAncDir)


        do ##class(%Library.File).CreateDirectory(ArchAncDir)


    if '##class(%Library.File).DirectoryExists(FaxDateDir)


        do ##class(%Library.File).CreateDirectory(FaxDateDir)




    set Oref = ##class(%FileBinaryStream).%New()


    set Oref.Filename = FaxDateDir_FileName

    Do base64.Rewind()

    While 'base64.AtEnd {

        set ln = base64.ReadLine()

        set lnDecoded = $system.Encryption.Base64Decode(ln)

        do Oref.Write(lnDecoded)


    Do Oref.%Save()

    set PDFFilePath = FaxDateDir_FileName

    return PDFFilePath


I believe Intersystems has stopped any development/enhancements on the Atelier plug in. They are now more focusing on using Visual Studio Code. Personally I never got into Atelier, but Visual Studio Code seems to be better than IRIS Studio.

Does this make sense.. What if I didn't use the %SYS.OAuth2 library and just treat it as another POST object that I put in my Operation as OnInit()? Do you think that would work?

Global Masters badges: