S h o r t S t o r i e s

// Tales from software development

Archive for August 2014

NHapi bug: OBX-5 repetitions not handled correctly

with 4 comments

Recently I stumbled across a bug in NHapi in which the second and further repetitions of an OBX-5 field are not correctly processed. It’s surprising that this bug hasn’t been noticed before as it appears to have been there from the start.

The Varies class in NHapi.Base.Model implements a method called fixOBX5() which instantiates an NHapi HL7 data type instance of the type specified in OBX-2 for each repetition in the OBX-5 and stores it in the data property of the Varies instance associated with the repetition.

Unfortunately, fixOBX5() is written in such a way that only the first repetition is processed. This means that the data property of the Varies instance for the first repetition will be correctly set to an instance of the type specified in OBX-2 (e.g. TX, CE, NM, SN, etc) but the subsequent repetitions, if any, won’t.

The problem has been logged on CodePlex, the new home (as of April 2014) for NHapi.

I’ve also forked the NHapi source, fixed the bug, and sent the NHapi team a pull request so that they can incorporate the fix.

 

Advertisements

Written by Sea Monkey

August 19, 2014 at 8:00 pm

Posted in HL7

Tagged with

A few months coding can save days of planning

leave a comment »

A priceless comment from “Max” on The Workplace regarding weak upstream practices in software development:

“A few months coding can save days of planning.”

Written by Sea Monkey

August 11, 2014 at 8:00 pm

Posted in Comment

Tagged with