Hi Jordan,

Looking at the method implementation, the Remainder is being overwritten from the method. So your assignment before GetFieldStreamRaw() method call is not considered.

Set Remainder="^^PDF"

If you need to set the "^^PDF" at the end of the segment, I would set it before Storing the stream.

Set tSC=OBX.SetValueAt("OBX",0)
Set tSC=OBX.SetValueAt("RP",2)
Set tSC=OBX.SetValueAt("PDF",5.4)
Set tSC=OBX.StoreFieldStreamRaw(EmbeddedPDF,5.1,Remainder)

Hi Karthikeyan,

From the code that you are running, the file you are providing, is being evaluated as a message file.

Can you please provide the file name which doesn't start with a "." or not in the list of MAGICFILENAMES. 

Please refer to ##class(EnsLib.InteropTools.HL7.MessageAnalyzer.Workspace.FolderType).IsMessageFileName() for the name validation.

Thanks,
Arun

Hi Jack,

We had used commitSegmentByPath for Huge HL7 related transformations. 

Can you try doing an intermediate %Save on the target object in the DTL using the <code> block. You can do this save multiple times, it will save as the same object. This might help you with some memory issues.

The other method you might consider is the one below, found in the EnsLib.EDI.XML.Document (IRIS 2019.2).

/// Switch from keeping changes in memory to keeping them in storage. Allows for unlimited changes to a document without running out of memory. This mode is automatically in effect when the object is created by loading from a stored Id
Method CommittedMode(pMode As %Boolean = 1) As %Status
 

There might be other efficient ways. Please let me know what you find out.

Thanks,

Arun