Crash using CanonicalModelClassFactory with a specific message class when no structures found.
The following is the parsing of message using CanonicalModelClassFactory and the constructor which takes a message class, where the message being parsed contains an unexpected segment.
Caused by: ca.uhn.hl7v2.HL7Exception: The HL7 version null is not recognized
at ca.uhn.hl7v2.parser.Parser.assertVersionExists(Parser.java:527)
at ca.uhn.hl7v2.parser.DefaultModelClassFactory.findClass(DefaultModelClassFactory.java:299)
at ca.uhn.hl7v2.parser.DefaultModelClassFactory.getSegmentClass(DefaultModelClassFactory.java:118)
at ca.uhn.hl7v2.parser.CanonicalModelClassFactory.getSegmentClass(CanonicalModelClassFactory.java:109)
at ca.uhn.hl7v2.model.AbstractGroup.addNonstandardSegment(AbstractGroup.java:242)
at ca.uhn.hl7v2.parser.MessageIterator.addNonStandardSegmentAtCurrentPosition(MessageIterator.java:215)
at ca.uhn.hl7v2.parser.MessageIterator.hasNext(MessageIterator.java:131)
at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:1156)
at ca.uhn.hl7v2.parser.PipeParser.doParse(PipeParser.java:222)
at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:212)
at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:1012)
at ca.uhn.sail.integration.AbstractIntegrationMapHl7.processMessage(AbstractIntegrationMapHl7.java:39)
Fixed