web stats
Adding field to blank repeating segment - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-02-2016, 09:41 AM
scottsmith scottsmith is offline
What's HL7?
 
Join Date: Aug 2015
Posts: 5
scottsmith is on a distinguished road
Default Adding field to blank repeating segment

All I need to do is "loop" through FT1 and add a value to a null field. Below is my code. The code does not create any errors, but looks like it just skips the step. Any suggestions?

for (var x=0; x<msg['FT1'].length(); x++ ) {
var coding_system = msg['FT1'][x]['FT1.19']['FT1.19.3'].toString();
}
if (coding_system.length > 0){
msg['FT1'][x]['FT1.19']['FT1.19.3'] = 'ICD10CM';
}
Reply With Quote
  #2  
Old 03-02-2016, 10:18 AM
cward cward is offline
 
Join Date: Feb 2008
Posts: 84
cward is an unknown quantity at this point
Default

try something like this

for each(seg in msg..FT1){
if(seg['FT1.19']['FT1.19.3'].toString().length > 0){
seg['FT1.19']['FT1.19.3'] = "ICD10CM";
}
}

Last edited by cward; 03-02-2016 at 10:23 AM.
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 02:12 AM.


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