Julian Matthews · 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")

0 281
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.

Hi Julian,

You're using curly brackets rather than parentheses at the outermost level. If that still presents an issue I'd recommend adding some traces to see what's actually getting referenced.

Ahh, I missed the difference between { and (.

I'll give that a try and let you know how that goes.


Yep, that did it. Thanks Vic!