Android – 用HAPI v 2.2和DefaultHapiContext解析HL7消息

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

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所述。

   ca.uhn.hapi hapi-base ${hapi.version.stable}    ca.uhn.hapi hapi-structures-v21 ${hapi.version.stable}    org.slf4j slf4j-log4j12 ${slf4j.version}   log4j log4j ${log4j.version}    ca.uhn.hapi hapi-structures-v22 ${hapi.version.stable}   ca.uhn.hapi hapi-structures-v23 ${hapi.version.stable}   ca.uhn.hapi hapi-structures-v231 ${hapi.version.stable}   ca.uhn.hapi hapi-structures-v24 ${hapi.version.stable}   ca.uhn.hapi hapi-structures-v25 ${hapi.version.stable}   ca.uhn.hapi hapi-structures-v251 ${hapi.version.stable}   ca.uhn.hapi hapi-structures-v26 ${hapi.version.stable}