This error is caused by not converting string representations of a segment to an HL7 message model using qie.parseHL7String. For example:
var segment = 'RXA|0|1|20130701|...' ;
segment.setNode('RXA-1', '2');
Note that the above "segment" variable is just a string. Before calling getNode or setNode etc. it needs to be converted to an hl7 message using: qie.parseHL7String like:
var segment = qie.parseHL7String('RXA|0|1|20130701|...');
segment.setNode('RXA-1', '2');