Hi,
I'm getting an exception
ca.uhn.hl7v2.HL7Exception: The HL7 version 2.5.1
EVN is not recognized
at ca.uhn.hl7v2.parser.Parser.assertVersionExists(Parser.java:527) ~[387:hl7Service:5.0.10]
at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:208) ~[387:hl7Service:5.0.10]
at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:1018) ~[387:hl7Service:5.0.10]
at com.company.hl7Server.MessageHandler.process(MessageHandler.java:177) ~[387:hl7Service:5.0.10]
...
The start of my message, from the third party is like:
MSH|^~\&|SYSTEM|DFT|HOSPI|BILLING|20200227133531||DFT^P03|GEO000031|P|2.5.1
EVN|P03|20200227133531
followed by PID, PV1, FT1, IN1.
And the third party software is based on 2.5.1 (and says 2.5.1 in MSH).
How do I parse this without getting the error? I see there is an EVN in 2.5.1?
https://hapifhir.github.io/hapi-hl7v2/v251/apidocs/ca/uhn/hl7v2/model/v251/segment/EVN.html
Thanks
Daniel
There is likely no proper HL7 segment separator after the 2.5.1 at the end of the MSH segment, so it treats the beginning of the next line as part of the version number.
Segment separator must be a "\r" (corresponding to file saved with Mac linebreaks).
Thanks that was it.