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
@Christine Nyamu Are you trying to find the index in DTL ?
A Loop with a counter variable and check for DRG.1.3 = "PMP" could provide you the index.
Use foreach action to loop DRGgrp() and inside the loop insert the check.
Enrico
@Mary George @Enrico Parisi I should have added that multiple DRG 1.3 have "PMP" but I only need to map the first DRG segment that contains it. Hence the reason I want to know how to find the index. Thoughts?
Use foreach action to loop DRGgrp() and inside the loop insert an if action to the check if = "PMP", use break action when found.
If you need more detail, provide a sample HL7 message and specify what you need to do after finding it.
Enrico
@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
@Enrico Parisi inserting the break was sufficient on top of your previous response and that of @Mary George . Thank you!