When parsing an HL7 2.3 ORM message, with the OBX-2 field set to ID, the
HAPI (0.5.1) implementation throws the error bellow:

     [java] Caused by: ca.uhn.hl7v2.HL7Exception:
java.lang.NoSuchMethodException trying to set data type of OBX-5
     [java]     at ca.uhn.hl7v2.model.Varies.fixOBX5(Varies.java:148)
     [java]     at
ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:324)
     [java]     at
ca.uhn.hl7v2.parser.PipeParser.doParse(PipeParser.java:259)
     [java]     at
ca.uhn.hl7v2.parser.GenericParser.doParse(GenericParser.java:205)
     [java]     at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:151)
     [java]     at com.ibm.hl7tools.HL7Reader.read(HL7Reader.java:43)
     [java]     ... 27 more
     [java] Caused by: java.lang.NoSuchMethodException:
ca.uhn.hl7v2.model.v23.datatype.ID.<init>(ca.uhn.hl7v2.model.Message)
     [java]     at java.lang.Class.getConstructor0(Class.java:1937)
     [java]     at java.lang.Class.getConstructor(Class.java:1027)
     [java]     at ca.uhn.hl7v2.model.Varies.fixOBX5(Varies.java:137)
     [java]     ... 32 more


Reading source code, I found that the Varies implementation attempts to
call a default constructor on the class
ca.uhn.hl7v2.model.v23.datatype.ID :

Class c = factory.getTypeClass(obx2.getValue(),
segment.getMessage().getVersion());
v.setData((Type) c.getConstructor(new
Class[]{Message.class}).newInstance(new Object[]{v.getMessage()}));

Unfortunately, this constructor does not exist. All defined constructors
for the Java type ID expect a table identifier parameter (here it should
be 125).

The issue is that ID _is_ an acceptable value for field OBX-2, as
defined by the HL7 table 125, release 2.3.
And the sending application (Millennium) does use this value.

I could easily patch the HAPI 0.5.1 source code, but I would prefer not
to.
Furthermore, as the spec allow this value, I think this issue may be
reported as an HAPI bug. Should I create an entry in the issue tracker ?

Has anyone encounter a similar issue ? what was then the chosen
solution ?  

Regards,
christophe.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to