1

Closed

Can't get multiple OBXs of an OBR in HL7 2.5.1

description

Hi,

Im using the 2.5.1 API and my test message has an OBR and 2 OBX, I only can inquiry the first OBX.

Does anyone can help me?

Thanks in advance,
Closed Jan 28, 2015 at 7:04 AM by djedwards

comments

steveshort wrote Dec 19, 2014 at 7:51 AM

djedwards wrote Jan 28, 2015 at 7:03 AM

I just checked by creating a sample message for V2.5, with multiple OBX segments and have been able to iterate over the results.

I'm guessing the confusion here is just the rather ... interesting method required to iterate over the results

Here's some sample code for you to look at, this should at least point you in the right direction hopefully :-)
var parser = new PipeParser();
var oru = new NHapi.Model.V25.Message.ORU_R01();    
oru = (NHapi.Model.V25.Message.ORU_R01)parser.Parse(GetMessage());

var repetitions = oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).OBSERVATIONRepetitionsUsed;
for (int i = 0; i < repetitions; i++)
{
    var obx = oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).GetOBSERVATION(i).OBX;
    foreach (var obx5Value in obx.GetObservationValue())
    {
        var typed = obx5Value.Data as Model.V25.Datatype.FT;
        var typedValue = typed.Value;
    }
}
Hope this helps!

cransaxbeth wrote Feb 2, 2015 at 3:35 PM

Thanks for your response.

Yes with a 2.5 Message version works perfectly, the problem is with the dll version 2.5.1

djedwards wrote Feb 2, 2015 at 11:44 PM

My apologies, I thought you were referring to the 2.5 dll.

I can see that there in fact appears to in fact be a problem with the generated code for the v2.5.1 dll.

Thank you for raising this.

I'm hoping to get access to the later versions of the HL7 specification databases soon (2.6+), so I'll look into this further once I've obtained the specification databases to work with.