hl7apy icon indicating copy to clipboard operation
hl7apy copied to clipboard

<CRLF> at the end of a file with find_groups=false will throw a "Segment not found" error

Open AwfulMoo opened this issue 2 years ago • 1 comments

When attempting to parse a message, with find_groups=False, files with "\r\n" on the final line will fail as the final segment will be "\n", which is then stripped to "".

This causes an key not found exception when attempting to retrieve the element name for that "segment".

HL7 spec version used: 2.3.1 Message type: ORU_R01

AwfulMoo avatar Apr 09 '22 17:04 AwfulMoo

You'll need to replace the sequence '\n'r' to '\r' before parsing the message with the library

svituz avatar Mar 13 '24 10:03 svituz