From: Shrock, C. <Sh...@in...> - 2004-12-02 22:27:31
|
I just did some checking and it turns out that I am dealing with some vendor hybrids of hl7 and not the base spec. I will have to start adapting HAPI to meet them. Thank you for all your help. -----Original Message----- From: Shrock, Court Sent: Thursday, December 02, 2004 2:16 PM To: Shrock, Court; 'hl7...@li...' Subject: RE: [HAPI-devel] model.Varies.fixOBX5() question "AbstractType" and "Varies" both implement "Type". "ST" extends "AbstractType". Therefore, I don't see how a "ST" could be cast to a "Varies". Changing the implementation of v2.1 OBX segment to add Varies.class instead of ST.class for OBX-5 removes the error for me. I can't find v2.1 specs on hl7.org. Anyone have some pointers that they can share? -----Original Message----- From: Shrock, Court [mailto:Sh...@in...] Sent: Tuesday, November 30, 2004 4:18 PM To: 'hl7...@li...' Subject: [HAPI-devel] model.Varies.fixOBX5() question I have tracked an issue to a version issue. I get an exception (the line numbers are a little off because I am debugging things): 455 ERROR [ca.uhn.hl7v2.app.Responder] Attempting to send error message to remote system. ca.uhn.hl7v2.HL7Exception: java.lang.ClassCastException trying to set data type of OBX-5 at ca.uhn.hl7v2.model.Varies.fixOBX5(Varies.java:130) at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:325) at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:262) at ca.uhn.hl7v2.app.Responder.processMessage(Responder.java:139) at ca.uhn.hl7v2.app.Receiver$Grunt.run(Receiver.java:120) Caused by: java.lang.ClassCastException at ca.uhn.hl7v2.model.Varies.fixOBX5(Varies.java:107) The offending line is: Varies v = (Varies) segment.getField(5, 0); The test message I have broken it down to is: MSH|^~\&|RAD|SHM||SHM|200411291512||ORU^R01|OUTBOUND.5.32158|D|2.1 PID|1|Z4882|Z000004931|Z4882|RED^CODE^^^^||19650328|F||||||||||Z00006227 ORC||#SHM#000002707|4780550||D||||200411291512 OBX|1|TX||| This is a test Change the version to 2.2, and the message is parsed. The difference that I can see is in the implementation of the OBX segment; The 2.1 implementation handles OBX-5 by: this.add(ST.class, true, 1, 65, null); The 2.2 implementation handles OBX-5 by: this.add(Varies.class, false, 1, 65536, null); The only thing that makes sense to me at this point is that since the 2.2 is explicitly returning a (Varies) and not a (ST) like 2.1, the class casting is working. My question is what would govern the successful casting of (ST) to (Varies) and is it related to the actual HL7 message being parsed? If so, any hints? I know that the HL7 message is not standard. I have been trying to troubleshoot things and I want to see if by trying to troubleshoot, I have broken an assumption that is necessary for it to work. Thank you for any insight/shared experience that may have in this matter, Court ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Hl7api-devel mailing list Hl7...@li... https://lists.sourceforge.net/lists/listinfo/hl7api-devel |