Question Robert Hildebrand · May 17, 2023

Looping through repetitive HL7 segment groups in business rule

Hi,

we get HL7 ORU messages from a laboratory system. Messages that do not contain an observation date should not be forwarded to the business operation. My problem is that the observation date can be in any repetition of the ORCgrp. How can I loop through the ORCgrps in a business rule?

Regards

Robert

Product version: HealthShare 2017.2
$ZV: Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2017.2.2 (Build 865_0_18359U) Wed Jul 25 2018 16:08:01 EDT [HealthShare Modules:Core:15.032.9686 + Linkage Engine:15.032.9686]

Comments

Robert Hildebrand · May 17, 2023

I already tried the asterisk:

Length(HL7.{PIDgrpgrp(1).ORCgrp(*).OBR:7.1})>0

... and the syntax with the square brackets:

Length(HL7.[OBR:7.1])>0
0
Jeffrey Drumm  May 17, 2023 to Slava Solomakha

And an upgrade, since the foreach action didn't exist in 2017.2 😉

0
Jeffrey Drumm · May 17, 2023

This should work (no looping required):

I'm using the parenthesis syntax with the Matches() function to locate a pattern of any number of punctuation characters (.P) followed by 8 numeric characters (8N) followed by any number of any character (.E).

The parenthesis syntax returns the repeating values in the form "<><><20230512191543><>" where <> represents an empty iteration of the repeating field (and fortunately qualifies as a punctuation character).

0
Larry Overkamp · Aug 7, 2024

I'm trying to do something similar, but the condition is checking the number of OBX segments in messages that can contain multiple ORC groups. The condition pasted below does not work. It also does not work if I replace the curly braces with parentheses. The only way it works is if both a PIDgrpgrp index is included and an ORCgrp index is included, and only if the outer punctuation characters are curly braces, not parentheses. We're on HealthShare version 2023.1.3.

0
Enrico Parisi  Aug 8, 2024 to Larry Overkamp

The count syntax ("*") only works if used for the last repeating element and using curly braces, so this works:

HL7.{PIDgrpgrp(1).ORCgrp(1).OBXgrp("*")}

You need to loop in the two previous groups (PID and ORC) to get the total count of OBX segments in the message.

0
Larry Overkamp  Aug 8, 2024 to Enrico Parisi

Thanks for the reply.

We have a custom function that was developed for a different purpose but will do what I need for the current use case. It will be a more succinct solution than using a foreach action.

0