【发布时间】:2018-01-25 13:22:26
【问题描述】:
Hapi xml 解析器在使用 Hapi Xml 解析器对 HL7 v2.7 消息进行编码时出现以下异常。
ca.uhn.hl7v2.HL7Exception:无法对 GenericMessage 进行 XML 编码。信息 必须具有公认的结构。
下面是我用来编码消息的代码 sn-p
HapiContext context = new DefaultHapiContext(modelClassFactory)
PipeParser pipeParser = context.getPipeParser();
pipeParser.setValidationContext(new NoValidation());
pipeParser.getParserConfiguration().setAllowUnknownVersions(true);
Message msg = pipeParser.parse(document);
Parser xmlParser = context.getXMLParser();
return xmlParser.encode(msg);
有什么建议/解决方案吗?
【问题讨论】:
-
我用 hl7-v2 标记它...希望有人可以帮助您...
标签: java xml-parsing hapi hl7-v2