Hello there,

I'm new to HAPI. The problem I'm facing is I'm not able to typecast a ADT
message to generic ADT_AXX message type. So as a result when I try to parse
a segment eg. IN1 which is not present in a specific ADT Event type(eg
ADT_A01) I get an HL7Exception like

"IN1 does not exist in the group ca.uhn.hl7v2.model.v251.message.ADT_A01"

I'm using the following code to parse my message

HapiContext context = new DefaultHapiContext();
Parser p = context.getGenericParser();

Message hapiMsg;
try {
   // The parse method performs the actual parsing
   hapiMsg = p.parse(msg1);
} catch (EncodingNotSupportedException e) {
   e.printStackTrace();
   return;
} catch (HL7Exception e) {
   e.printStackTrace();
   return;
}

Any help would be highly appreciated.

Best Regards
Sumit
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to