gpt4 book ai didi

java - Android - Java 使用带有 DefaultHapiContext 的 HAPI v 2.2 解析 HL7 消息

转载 作者:行者123 更新时间:2023-11-30 09:03:46 25 4
gpt4 key购买 nike

我在尝试解析 HL7 消息时遇到此错误。我不知道为什么以及如何解决它。我正在使用 hapi v2.2 。所以请帮助我。提前致谢!。这里是目录!!!

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

最佳答案

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

<!-- 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>

关于java - Android - Java 使用带有 DefaultHapiContext 的 HAPI v 2.2 解析 HL7 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25544278/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com