首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用带有DefaultHapiContext的HAPI v2.2解析HL7消息

使用带有DefaultHapiContext的HAPI v2.2解析HL7消息
EN

Stack Overflow用户
提问于 2014-08-28 16:32:50
回答 1查看 881关注 0票数 2

我在尝试解析HL7消息时遇到此错误。我不知道为什么和如何修复它。我使用的是hapi v2.2。所以请帮帮我。提前谢谢你!这里是catlog!

代码语言:javascript
复制
08-28 15:03:28.552: E/dalvikvm(642): Could not find class 'ca.uhn.hl7v2.DefaultHapiContext', referenced from method com.example.hl7demo.MainActivity.onCreate


08-28 15:03:28.673: E/AndroidRuntime(642): java.lang.NoClassDefFoundError: ca.uhn.hl7v2.DefaultHapiContext

08-28 15:03:28.673: E/AndroidRuntime(642):  at com.example.hl7demo.MainActivity.onCreate(MainActivity.java:38)

以本教程http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/ExampleParseMessages.html为基础

EN

回答 1

Stack Overflow用户

发布于 2014-08-28 17:33:51

您似乎忘记将Hapi库添加到您的构建中。如果您使用maven,则只需添加适当的maven依赖项,如此处所述http://hl7api.sourceforge.net/using_maven.html

代码语言:javascript
复制
<!-- This is the core HAPI library -->
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-base</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>       

<!-- This is the structure JAR for HL7 v2.1 -->
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v21</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>

<!-- 
        If you want to use log4j for logging (recommended), you should include
        it, as well as the slf4j adaptor
-->
<dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
</dependency>
<dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
</dependency>

<!-- 
        Also add hapi-structures-v22, v23, etc. depending on which versions 
        of HL7 you need to create or parse 
-->     
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v22</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v23</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v231</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v24</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v25</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v251</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>
<dependency>
        <groupId>ca.uhn.hapi</groupId>
        <artifactId>hapi-structures-v26</artifactId>
        <version>${hapi.version.stable}</version>
</dependency>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25544278

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档