This project is read-only.

OBX-5 is valued, but OBX-2 is not. A datatype for OBX-5 must be specified using OBX-2.

Oct 20, 2016 at 9:31 PM
it appears that HAPI can deal with this issue

http://hl7api.sourceforge.net/configuring_hapi.html

HAPI Parser

The HAPI Parser may be configured using a ParserConfiguration object.

The ParserConfiguration is a bean which sets and retrieves parser configuration properties and may be shared among multiple parser instances.

Default behaviour for OBX-2
In a normal OBX (Observation) segment, OBX-2 provides the datatype to be applied to OBX-5. So, for instance if an OBX repetition was conveying a timestamp (TS), it might look like:

OBX||TS|||200901011259
If the OBX-2 value is missing (which sometimes happens because of a misbehaving sending system), you may see an error such as "OBX-5 is valued, but OBX-2 is not. A datatype for OBX-5 must be specified using OBX-2".

In this case, you may specify that HAPI should use a default type when none is found by specifying a default OBX-2 type:

parser.getParserConfiguration().setDefaultObx2Type("ST");
ORU_R01 parsedMessage = (ORU_R01)parser.parse(someInvalidMessage);
If the OBX-2 value is invalid, meaning that it has a value but that value is not a valid HL7 datatype (e.g. "String" instead of "ST"), you may specify a default type to assume if the OBX-2 value can not be understood.

parser.getParserConfiguration().setInvalidObx2Type("ST");
ORU_R01 parsedMessage = (ORU_R01)parser.parse(someInvalidMessage);

but can this be done in nHAPI ?