web stats
GetSegmentsAfter not working now - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-26-2019, 05:58 PM
rutledj rutledj is offline
Mirth Guru
 
Join Date: Nov 2010
Location: North Carolina
Posts: 393
rutledj is on a distinguished road
Default GetSegmentsAfter not working now

I've been using this code template a good while now but now it is throwing an error. Has something changed? Is there a newer version? The one I have is from

Author: Nick Rupley
Date Modified: 2/13/2013


function call:

var nteSegments = getSegmentsAfter(msg,msg.ORC,'NTE',true);

Error:

SOURCE CODE:
196: // Return the output array
197: return out;
198: }
199: function getSegmentsAfter(root, startSeg, segName, consecutiveInd, stopSegNames) {
200: // The index to start collection is the next one up from the starting segment
201: var index = startSeg.childIndex()+1;
202: // The return array
203: var out = [];
204: // Boolean placeholder to stop iteration
205: var done = false;
LINE NUMBER: 201
DETAILS: TypeError: childIndex is not a function, it is xml.
at 30b99ead-72de-4fd3-8034-5f791b2c08ba:201 (getSegmentsAfter)
at 30b99ead-72de-4fd3-8034-5f791b2c08ba:838 (doTransform)
at 30b99ead-72de-4fd3-8034-5f791b2c08ba:898 (doScript)
at 30b99ead-72de-4fd3-8034-5f791b2c08ba:900
Reply With Quote
  #2  
Old 09-27-2019, 07:56 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,009
agermano is on a distinguished road
Default

My guess would be that either your message doesn't have an ORC segment or it has more than one. You have to pass a single node for startSeg so it knows which segment you are "getting after."
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 11:56 AM.


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