From: Matias K. <ma...@et...> - 2004-05-21 15:14:21
|
Dear Bryan and Martin, Thanks for your help! I'll check out the Terser class and the DefaultApplication. Cheers, Matias Tripp, Bryan wrote: > Hi Matias, > Yes, that's probably it. As Martin said a few minutes ago, it sounds like > Terser is your best bet. It automatically accounts for differences between > versions. By the way there are some examples of Terser use in > DefaultApplication: > http://cvs.sourceforge.net/viewcvs.py/hl7api/hapi/ca/uhn/hl7v2/app/DefaultAp > plication.java?view=markup > > ... see makeACK() and fillResponseHeader() for different styles of use. > Bryan > -----Original Message----- > From: Matias Klein > To: hl7...@li... > Sent: 21/05/2004 10:55 AM > Subject: [HAPI-devel] Message Casting Error > > Hello, > > I've just started testing HAPI v0.4.1. I'm trying to cast a Message > object to an ADT_A04 object. Here is my code: > > public ADT_A04 convertMessage(Message in){ > ADT_A04 adt = (ADT_A04) in; > return adt; > } > > When I pass an ADT_A04 message to this function, I get the following > error: > > java.lang.ClassCastException > at com.test.HL7.processors.ADTProcessor.processMes > age(ADTProcessor.java:67) > at ca.uhn.hl7v2.app.MessageTypeRouter.processMessage(MessageTypeRouter. > ava:52) > at > ca.uhn.hl7v2.app.Responder.processMessage(Responder.java:159) > at ca.uhn.hl7v2.app.Receiver$Grunt.run(Receiver.java:115) > > What would cause this considering that the message being passed in is an > > ADT_A04 message? Could this be a versioning problem (i.e. the message is v2.4 and the ADT_A04 class is from the v2.3.1 model package)? > > Thanks, > > Matias > > ============ > Matias Klein > Ethidium Health Systems > 3993 Huntingdon Pike - Suite 108 > Huntingdon Valley, PA 19006-1927 > USA > Office: (215)938-8630 > Fax: (866)583-8018 > http://www.ethidium.com > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > This e-mail may contain confidential and/or privileged information > for the sole use of the intended recipient. Any review or distribution > by anyone other than the person for whom it was originally intended is > strictly > prohibited. If you have received this e-mail in error, please contact the > sender and > delete all copies. Opinions, conclusions or other information contained in > this e-mail may not be that of the organization. > |