From: Younan <yfa...@ha...> - 2014-12-17 21:05:16
|
Hi James, can you add to that example? How can you pass in that custom parser you wrote into the Context? I have the code, and the unrecognized version 2.7 exception is still thrown. How do I pass in my own PipeParser in this case?: HapiContext context = new DefaultHapiContext(); context.getParserConfiguration().setAllowUnknownVersions(true); context.getParserConfiguration().setValidating(false); context.getPipeParser().getParserConfiguration().setAllowUnknownVersions (true); context.getPipeParser().getParserConfiguration().setValidating(false); Connection connection = null; try{ connection = context.newClient(host, port, useTLS); ((ActiveConnection)connection).getParser().getParserConfiguration().setA llowUnknownVersions(true); ((ActiveConnection)connection).getParser().getParserConfiguration().setV alidating(false); Message response = connection.getInitiator().sendAndReceive(message); String respStr = response.encode(); logger.info("Message sent, response received: ' " + respStr + "'"); connection.close(); } catch (HL7Exception ex){..} |