I've knocked up a quick example using dual ack's.
I've put the source code in a gist here...
Save the code to a file and import into a test namespace.
Either create the "in" and "archive" folders are per the inbound test file feeder, or change to suit your environment.
Drop an HL7 message into the "in" folder and this is what you will see in the trace...
The ACK message is sent into the service and is automatically forwarded to the sending operation where it is returned to the calling process as if it was original messages ACK.
Make sure to follow the instructions here when configuring the service and operation, they specifically need to be implemented using EnsLib.HL7.Operation.TCPAckOutOperation and EnsLib.HL7.Service.TCPAckInService
Also note, that you need to set the reply code actions so that the AE ACK is returned to the process, otherwise it will stop at the operation, I have set the actions to...
Where a match on ?E will just warn and continue as if the message was ok.
Take a look at the custom class Examples.DeferredHL7.CustomProcess
Which contains the following OnResponse method...
Method OnResponse(request As EnsLib.HL7.Message, ByRef response As EnsLib.HL7.Message, callrequest As EnsLib.HL7.Message, callresponse As EnsLib.HL7.Message, pCompletionKey As %String) As %Status
$$$TRACE("request contains the inbound request "_request.RawContent)
$$$TRACE("callrequest contains the sent request "_callrequest.RawContent)
$$$TRACE("callresponse contains the deferred ACK "_callresponse.RawContent)
This is where you will have both the original request messages and the ACK in the same scope. From here you can construct a new message from the data in both messages.
This is just one approach but should fit your needs.