amida-tech / mllp

HL7's MLLP (Minimum Lower Layer Protocol) server implementation in Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MLLP Does not support Large Messages

mberryman opened this issue · comments

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);
            }

@mberryman I see you have a fix for this in your branch

do you want to send pull request and we can merge it?

sent a pull request a couple of days ago.