Question
· 13 hr ago

Retrieve Segments (repeating) with a certain value using BPL

Hello, I am trying to get some fields from HL7 message and create a file using BPL.  The values I need are in a repeating segment (AIG).  Even in the repeating segment, I just want the iteration that has a certain field (AIG:3 populated).  With the help of documentation and community posts, I was able to create the BPL to loop through all of AIG and create the file.  But when I try to narrow the results even further (AIG:3 present), the process gets stuck.  I am not sure I am missing anything or have anything incorrectly set up.  Also, since the process gets stuck, it doesn't even seem to hit the 'Trace' step.  Below is our current BPL setup.

 

 

To Get the AIG Count to Loop through

Within the While Loop

Checking if AGI:3 has a value

request.GetValueAt("RGSgrp(1).AIGgrp(context.AIGitr).AIG:3)")'=""

Sample (trying to retrieve only lines in red)

RGS|1||1
AIS|1||1070002102^EXPLORATORY LAPAROTOMY|20260205100000|0|S|600|S||||
AIG|1|||7.221^Chest Instruments||||20260205100000|0|S|2580|S
AIG|2|||7.414^Defibrillator Paddles Internal Sm 4.5Cm||||20260205100000|0|S|2580|S
AIG|3|||7.695^Endo Scope Bronch Non Video Or||||20260205100000|0|S|2580|S
AIG|4|||7.1284^Major Set||||20260205100000|0|S|2580|S
AIG|5|||7.1466^Power Stryker Sternal Saw Trauma Room||||20260205100000|0|S|2580|S
AIG|6|||7.2914^Donor Network Instrument and Retractor Tray||||20260205100000|0|S|2580|S
AIG|7|||7.2928^Donor Network Sternal Retractors||||20260205100000|0|S|2580|S
AIG|8|||7.3066^Major Vascular Tray Number 1||||20260205100000|0|S|2580|S
AIG|9|||7.3283^Bin Scope Transport||||20260205100000|0|S|2580|S
AIG|10|||7.3360^Power Stryker Sternal Saw||||20260205100000|0|S|2580|S
AIG|11|||7.3458^Major Vascular Tray Number 2||||20260205100000|0|S|2580|S
AIG|12|||7.2914^Donor Network Instrument and Retractor Tray||||20260205100000|0|S|2580|S
AIG|13||900057^SYNTHES NEURO FIXATION PLATING SYSTEM|Implant Tray||||20260205100000||||
AIG|14||472^900880 BOTTOM TRAY RIGHT SIDE|Implant Tray||||20260205100000||||
AIG|15||900057^SYNTHES NEURO FIXATION PLATING SYSTEM|Implant Tray||||20260205100000||||

Final goal is to output lines with AIG:3 value and get a count of similar items.  In the example above 900057 will have a count of 2 and 472 will have a count of 1.  Any help is greatly appreciated.

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