Question Ryan Hulslander · Apr 13, 2023

Need to have TCP/IP HL7 Inbound service/adapter just write to file - no persistence anywhere in the engine

Curious if anyone has modified the HL7 TCP/IP Service and adapter class to receive an HL7 message, ACK it, and just dump it straight to a file? I don't want the messages in the engine at all - just receive and dump. Has anyone done this before and have code you're willing to share?

Thank you very much in advance!

Product version: IRIS 2022.2

Comments

André-Claude Gendron · May 10, 2023

You could have a 0 day Ens.Util.Purge task running every 5 mins and clearing the production messages. That way you could use only built-in components such as the hl7 tcp service and hl7 file operation

0
James MacKeith · May 11, 2023

Apologies if too late but I tried the following based on the Non Persistence option used in the EnsLib.HTTP/REST/SOAP Generic classes (also see  Accelerate Ensemble)

1. Custom TCP Service Extends EnsLib.HL7.Service.TCPService:

Class Community.NonPersistService Extends EnsLib.HL7.Service.TCPService
{

Parameter SETTINGS = "PersistInProcData:Additional";/// Persist data to operations with invocation InProc<br/>/// The default is On. <br/>/// This setting is only used if calling an operation with invocation InProc. <br/>/// If this setting is off then no message headers will be created and message bodies will not be saved.<br/>/// If this setting is off there will be no trace in the message viewer. <br/>/// If this setting is off there will be no retry attempts by the operation - only one attempt will be made. <br/> Property PersistInProcData As%Boolean [ InitialExpression = 1 ];

Method OnInit() As%Status
{
    Set$$$EnsInProcPersist=..PersistInProcDataQuit##super()
}

}

2. Custom HL7 File Operation invoked InProc that is the target of the service

Class Community.InProcOperation Extends EnsLib.HL7.Operation.FileOperation
{

Parameter INVOCATION = "InProc";

}

Note the property description from EnsLib.HTTP.GenericService for PersistInProcData states for synchronous sends but this needs to be removed since not relevant for InProc. Sufficient that InProc target processed via OnMessage.

0
James MacKeith  May 11, 2023 to James MacKeith

my mistake the current non persist code does require Sync due to a missing check for no  request header created in Ens.BusinessService::SendRequestAsync() [there is such a check in SendRequestSync()]. I'll correct that.

0