I hate to admit it, but I surrender. I must be missing something simple in the formatting of this javascript code to change a value in an MSH header. I looked around and found this code from late last year in the forums:
I tried duplicating that - as it looked like it would work. However, the messages fly right through the channel without the slightest change in MSH3.
"MY" CODE:
Please tell me what I am missing, I beg of you.
Code:
var obr21 = msg['OBR']['OBR.2']['OBR.2.1'].toString(); //assign the obr21 value to a variable obr21 = obr21.replace("-0","-2"«»); //perform replacement on variable msg['OBR']['OBR.2']['OBR.2.1'] = obr21; //place the new value back into the message
"MY" CODE:
Code:
var msh3 = msg['MSH']['MSH.3']['MSH.3.1'].toString(); msh3=msh3.replace("oldValue","newValue"«»); msg['MSH']['MSH.3']['MSH.3.1']=msh3;
Comment