Question
· Feb 25, 2021

Having trouble looping through multiple NTE segments in the routing rule

We have multiple NTE segments in the ADT message.  I need to loop through all of the NTE segments looking for "NAVIRADTHPT" in the NTE-4 field.  I have yet to get this to work using the following code.  

HL7.(NTE:4()) Contains "<NAVIRADTHPT>"

Here's how the segments look.

NTE|1||This patient is currently being seen for radiation therapy.|AHRADTHPT||20210223093342
NTE|2||This patient is currently being seen for radiation therapy.|NAVIRADTHPT||20210223113634

I've also tried it this way with no luck.

HL7.(NTE():4) Contains "<NAVIRADTHPT>"

Any help would be greatly appreciated!

Product version: IRIS 2019.1
Discussion (2)0
Log in or sign up to continue

Hi Joey, 

@Arun Tiriveedhi is correct that you need to use square bracket syntax, as this returns a comma delimited list.

I had a case where I had a whitelist of OBR-4.1 values for filtering result messages to a particular system.

@Stephen Renshaw made a great suggestion to create a function to loop through the list and query the lookup table here: https://community.intersystems.com/post/using-lookup-or-exists-repeating-fields-ensemble-business-rule

Regards

Stuart