Written by

Sr Application Development Analyst at The Ohio State University Wexner Medical Center
Question Scott Roth · Apr 9

Business Rule Editor - Using Foreach Action and how to account for the counter

I have a segment within a Group (grp) that needs to be validated that it is populated within the message. 

When you use a Foreach within a Business Rule how should you account for the counter in the group?

For example, Epic sends their MFN message in the following format.

MSH~MFI~[~{~MFE~STF~PRA~[~ZPR~]~[~ZLK~]~[~CER~]~[~ZMG~]~[~ZTF~]~[~ZGP~]~[~ZDD~]~}~]

so, the ZLK segment might not exist until the last MFEgrp that is in the message. I need to verify if there is an Employee ID associated with the Provider in the HL7 message before I run it through the translation.

Product version: IRIS 2024.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:06:39 EDT [HealthConnect:7.2.0-1.r1]

Comments

Justin Owens · Apr 9

You don't use the counter in the Rule Editor. In the When condition inside the Foreach, you would use Segment.{LinkToSER.Identifier}. Below is an example that is similar to what you have.

0