Question
· Apr 17, 2020

Routing Rules With Nested Repeating Segments

Hi all.

I working with ORU messages where I'm only interested in routing the message to an operation where any of the contained OBR:UniversalServiceIdentifier.identifier segments contains certain values.

The problem I'm facing is that the OBRs are nested within a repeating ORCgrp, which is then nested in a repeating PIDgrpgrp (although the source only ever uses a single PIDgrpgrp).

Is there a simple way of achieving this without a massive OR for each possible ORCgrp value?

For clarity, this is the current path with the value in the brackets set: HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:UniversalServiceIdentifier.identifier} In "ABC,DEF,GHI")

Discussion (4)1
Log in or sign up to continue

Hi Julian,

You could do this with a custom Ensemble utility function but from your description I think parenthesis syntax should work just fine.

Defining Custom Utility Functions

Parenthesis () Syntax

HL7.(PIDgrpgrp(1).ORCgrp().OBR:UniversalServiceIdentifier.identifier) should return a concatenated string from looping through the ORCgrps - you could then search that string to find the value you are looking for.

Hope that helps!

Hi Vic.

This is what I expected to work as well, but for some reason the messages don't route if I try this method.

For example this works:

HL7.{PIDgrpgrp(1).ORCgrp(1).OBR:UniversalServiceIdentifier.identifier} contains "ABC"

But this doesn't:

HL7.{PIDgrpgrp(1).ORCgrp().OBR:UniversalServiceIdentifier.identifier} contains "ABC"

Even though I'd expect the "HL7.{PIDgrpgrp(1).ORCgrp().OBR:UniversalServiceIdentifier.identifier}" to return something along the lines of "<ABC><XYZ><LMN>" and therefore would be picked up by the contains function.