web stats
HL7 parsing for repeated segments - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2020, 04:59 AM
Mano Mano is offline
Mirth Newb
 
Join Date: Oct 2019
Posts: 11
Mano is on a distinguished road
Default HL7 parsing for repeated segments

Hello friends,I am working on HL7 message parsing,I am fine with those segments which are not repeated but for segments like GT1,IN1,NK1 I am not able to get proper output which I am looking for.Like GT1 I want to get GT1.9.1 and 1.9.2,so after extracting all GT1 loop should go for IN1 and then NK1.Anyone has done this before please let me know.Thank you.
Reply With Quote
  #2  
Old 02-07-2020, 05:16 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,360
cory_cole is on a distinguished road
Default

for each(gt1 in msg['GT1']
{
var gt119 = gt1['GT.19']['GT.19.1'].toString();
}
Reply With Quote
  #3  
Old 02-07-2020, 05:17 AM
obsessio obsessio is offline
Mirth Guru
 
Join Date: Mar 2015
Location: Turkey
Posts: 177
obsessio is on a distinguished road
Default

First of all, iterate over GT1 than other segments.

PHP Code:
var guarantorASList Lists.list();
for (var 
0getArrayOrXmlLength(msg['GT1']); i++) {

    var 
gas;

    try {
        
gas msg['GT1'][i]['GT1.9']['GT1.9.1'].toString();
    } catch (
e) {
        
logger.error(e);
        
gas '';
    }

    
guarantorASList.add(gas);

}
channelMap.put('guarantorASList 'guarantorASList.toArray());

--
IN1

--NK1 
Reply With Quote
  #4  
Old 02-07-2020, 07:07 AM
Mano Mano is offline
Mirth Newb
 
Join Date: Oct 2019
Posts: 11
Mano is on a distinguished road
Default

Thank You so much.

Last edited by Mano; 02-07-2020 at 07:08 AM. Reason: typo
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:58 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation