nodengine-hl7
nodengine-hl7 copied to clipboard
[FIXED] Parser incorrectly grabbing whitespace chars in the beginning…
… of messages
These are ending from the previous lines \r\n
Is there a test you can add for this?
@evanlucas what would you suggest, I assumed your existing tests would have been validating message parsing. I would be happy to add something per your suggestion.
@jjviscomi The tests are. That is where I'm a little confused. Do you have an example of where this actually fails?
@evanlucas this primarily has to do with properly consuming the whitespace at the end of a line. moving HL7 files between different OS's the end-of-line encodings can change. Windows is primarily CRLF (char(13)+char(10)) or \r\n. While on unix/linux/osx it is LF. This simply applies trim after you parse out a new line and strips any leading or trailing whitespace, since this is not allowed in HL7, but can been induced as a side effect from transferring files. I will grab a ADT message with the two different encodings with fake data and attach it later.
@evanlucas I am attaching two files they are identical parse them both with and without my changes. Feedback will be appreciated.