Question
· Dec 7, 2023

How to find the Index of a segment that contains a certain value in the DTL

I have an interface with repeating DRG segments with messages coming in as DRGgrp().DRG(1). I know how to find the count of DRG groups:

 (source.{DRGgrp("*")}) BUT I am stuck at how to find the index of the segment that has DRG.1.3 having a specific value = "PMP". Any ideas please?

Thank you

Product version: IRIS 2021.2
Discussion (6)2
Log in or sign up to continue

@Enrico Parisi Thank you, sample message below. I would like that if PMP found, send only the first segment containing PMP and ignore the rest. 

MSH|^~\&|MESA_OP|XYZ_HOSPITAL|iFW|ABC_HOSPITAL|040112043835||BAR^P05|0000000001|T|2.3|
EVN||20200420134725||
PID|||3000222452||DOE^JOHN^E||19931114|M||||||||||1546740|666381774|
PV1||I|BRACKENRIDGE|||||023434|||||||||023434|||||||||||||||||||||||||||20031121||
PV2||||||||||||||||||||||||||||||||||||||
OBX|||||4100|
DG1|1||784.3^APHASIA^I9C||200750816|A
DG1|2||784.0^HEADACHE^I9C||200750816|A
DRG|640^^APP-DRG S43 (2024)^^^^I10||015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|Admission DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC Admit DRG|015|.2017|||^^0|^^|0|||Completed|20231204085141|PMP, CODER|CODER||N
ABS|||||||20231204085141
DRG|555^^PMP S43 (2024)^^^^I10||015|.2017|3.1|3.1|^^97585.77|^^|1358.36|||Completed|20231204085141|PMP, CODER|CODER||Y
ABS|||||||20231204085141
DRG|555^^PMP S43 (2024)^^^^I10|HAC Dx Included|015|.2017|3.1|3.1|^^97585.77|^^|1358.36|||Completed|20231204085141|PMP, CODER|CODER||N
ABS|||||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10||015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|Admission DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC Admit DRG|015|.2017|||^^0|^^|0|||Completed|20231204085141|PMP, CODER|CODER||N
ABS|||||||20231204085141