web stats
Adding field to blank repeating segment - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 03-02-2016, 10: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
Old 03-02-2016, 11:18 AM
cward cward is offline
Join Date: Feb 2008
Posts: 84
cward is an unknown quantity at this point

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 11:23 AM.
Reply With Quote

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 04:28 PM.

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