go to post Ben Webb · Aug 16, 2022 Perfect, that's what I was looking for, And I would make my calls to the API there, build out a message and send the XML on to the DTL that adapts to HL7?
go to post Ben Webb · Aug 16, 2022 Hi thanks for the reply, this seems like the cleanest way and CRONs are a good option but our client won't accept external libraries
go to post Ben Webb · Aug 10, 2022 Do you know what those DTL classes would be called? I've had a look but I couldn't see any reference to JSON DTLs in HealthShare HealthConnect 2021.1Thanks, Ben
go to post Ben Webb · Nov 30, 2021 EDIT: Please ignore this I just answered my own question, I would just manually assign the path to a var in the DTL to be passed into the decode functionOne more quick question, The aim was to create a non-specific utility function for use anywhere a PDF needs to be extracted, Instead of passing the field contents in as a string as then writing that to a stream object, How would I programmatically get the path of the field in question as a string from within a DTL? E.g instead of getting the contents of the field at PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX:5(1).5,I would want to get "PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX:5(1).5" as variable varFieldPath to pass into the decode function via GetFieldStreamRaw() to give something like:Set tSC=source.GetFieldStreamRaw(.varBase64,varFieldPath )Thanks for your help, it's really appreciated :)
go to post Ben Webb · Nov 29, 2021 Ah ok thanks for explaining, I'll make some changes to avoid any potential issues, Thanks for your help
go to post Ben Webb · Nov 29, 2021 Hi Jeffrey, Thanks for your reply, I've been able to extract the PDF now,What's the advantage of using GetFieldStreamRaw() over refencing the field directly?I don't really have an understanding of best practice with this language yet but I'm trying to learn so any more info would be appreciated, Thanks for your help
go to post Ben Webb · Nov 29, 2021 Thanks for your reply, I was able to amend my code to render the PDF correctly, so thank you for your help Class ELHTPRODPKG.Functions.Utility.ExtractPDF Extends Ens.Rule.FunctionSet{ ClassMethod DecodeBase64HL7(base64String As %String, Path As %String, FileName As %String) As %String { set base64 = ##class(%Stream.GlobalBinary).%New() set Oref = ##class(%FileBinaryStream).%New() set Oref.Filename = Path_FileName_".pdf" Do base64.Write(base64String) 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 }}
go to post Ben Webb · Nov 26, 2021 Hi James, Thanks for the reply, this will help me out a lot, Much appreciated,Thanks
go to post Ben Webb · Nov 26, 2021 Thanks for the reply, I wasn't aware of the immutable state so I'll adjust my approach to suit, Thanks again
go to post Ben Webb · Oct 28, 2021 Hi Michel, Thanks for the reply, What I'm looking for is a way to have one DTL that performs the same operation (e.g changing the MSH:receiving application field) on many different event types (ADT_01, ADT_A08 etc.), without having to create a separate DTL to perform the operation for each event type, My thinking was you could programmatically build a string for DocType from the message body and use that to tell the engine how to parse each message event at runtime as the different events pass through the DTL,Is there a way of doing this, or is there a better approach?Thanks