Sidebar

How do I move an HL7 segment with all the fields.

0 votes
476 views
asked Jun 21, 2016 by brandon-w-8204 (33,270 points)
I want to move an SCH segment so it is after the MSH segment.

1 Answer

0 votes

Here is a code snippet to accomplish moving the SCH segment

// Retrieve the SCH Segment with its fields.
var schSegment = message.getNode('SCH');
// Remove the SCH segment from its current location
message.removeFirstNode('SCH');
// Add it back in after the MSH segement.
message.addChildAfter('MSH', 'SCH', schSegment);
answered Jun 21, 2016 by brandon-w-8204 (33,270 points)
...