Extending EnsLib.HL7.Operation.TCPOperation for custom error handling
Hi all.
I have a scenario where I am receiving NACKs and I'd like to adjust the error handing of the operation based on the content of the NACK.
For example, I could receive the following and want to move onto the next message:
MSH| ^~\&|||||20221025083135.489+0100||ACK ^A02^ACK|9271|D|2.5.1 MSA|AE|1664378390234 ERR|||207 ^Application internal error ^HL70357^^^^^^Cannot transfer patient, encounter is cancelled.|E
However, I could also receive the following and want to keep retrying:
MSH| ^~\&|||||20221014103828.043+0100||ACK^A03^ACK|1049|D|2.5.1 MSA|AE|1665740278804 ERR|||207^Application internal error^HL70357^^^^^^ISPN000427: Timeout after 15 seconds waiting for acks. Id=114232207|E
As both of these are "AE" errors, I don't believe the reply code actions is sufficient for my needs.
I was thinking that I'd need to extend the Operation and overwrite the OnReplyDocument() method, but I'm not exactly sure if this is the correct approach.
Has anyone done something similar before and have an example they would be able to share?
Product version: IRIS 2022.1