I'm trying to do some math with the PID in a HL7 message in the transform step.
This is the Code i have:
//add 100'000 to PID
var test;
var newPID;
test = parseInt(msg['PID']['PID.3']['PID.3.1'].toString(),10);
newPID = test + 100000;
tmp['PID']['PID.3']['PID.3.1'] = newPID;
The output is:
NaN
Sample of PID Segment:
PID||ABC123|987654|ALT789|PETTY^TOM^^^^||19781218|M||2106-3|10144 MAPLE AVE^^IRVINE^CA^92614||(949)123-1234|||||0053820452|220675537||AME||||1|||||
I always get the PID as a string and i can't convert it.
I'm new to Mirth and JavaScript so I'm glad for any help.