Closed Fritzelblitz closed 1 year ago
That makes sense and a great catch / call out. I think how we solve this is quite similar to how we solve this problem in the receiver. Specifically, we recurse until the trailer has been received (https://github.com/HCA-Healthcare/elixir-mllp/blob/27c738f62cc6b5fe4dc9ac475f81dbd79c608be9/lib/mllp/packet_framer.ex#L79).
We might be able to simply use the MLLP.PacketFramer
module and provide an option to override. The need for the ability to override is driven by the fact that unfortunately MLLP is used for more than just HL7.
We seem to have a problem where we send a message and receive the ack split into 2 TCP packets, in the first one is the MLLP start byte and the whole ML7 ack, in the second one is only the MLLP end bytes.
As a temporary solution, I have now adapted the MLLP library as follows:
How could we solve this more cleanly, preferably in such a way that we can also deal with more fragmented messages?