Announcement

Collapse
No announcement yet.

Getting all segments between OBR

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting all segments between OBR

    Is there a way to use getSegmentsAfter (or some other function) to return all of the segments after a given OBR up to the next (regardless of which segment type it is)?

    I'm trying to take duplicate OBR's, create a new message and add the dup OBR and associated segments.


  • #2
    This should work for getting all of the segments from one OBR to the next. The regex matches any segment name, and the default false value of consecutiveInd means that it will stop once it encounters another segment with the same name as startSeg.

    Code:
    for each (var obr in msg.OBR) {
        var segs = getSegmentsAfter(msg, obr, /.*/);
    }

    Comment

    Working...
    X