MLLP Does not support Large Messages
mberryman opened this issue · comments
mberryman commented
Hi Dmitri,
After a little trouble shooting of
mllp-node\index.js:26
var msg_id = data[0][10];
^
TypeError: Cannot read property '0' of null
at ackn (D:\Node\OPFlow\Server\node_modules\mllp-node\index.js:26:30)
at Socket.<anonymous> (D:\Node\OPFlow\Server\node_modules\mllp-node\index.js
:51:23)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:529:20)
I have found that node-mllp does not support messages larger than one TCP Envelope. There was a bit of massaging but hear's the crux
if (data.indexOf(FS + CR) > -1)
{
message = message.replace(FS + CR, '');
var data2 = hl7.parseString(message);
console.log("Message:\r\n" + message + "\r\n\r\n");
self.emit('hl7', message);
var ack = ackn(data2, "AA");
sock.write(VT + ack + FS + CR);
}
Dmitry Kachaev commented
@mberryman I see you have a fix for this in your branch
do you want to send pull request and we can merge it?
mberryman commented
sent a pull request a couple of days ago.
Afsin Ustundag commented
fixed