The below code works fine when applied to Mirth 2.0.1, it replaces "&" to "and".
I have applied this javascript transformation on the destination.
var mytext;
for(var i=0;i<msg['NTE'].length();i++)
{
var tempNTE = msg['NTE'][i]['NTE.3']['NTE.3.1'].toString();
var completeValue = tempNTE.replace('&','and');
if(mytext.length==0)
{
mytext = completeValue ;
}
else
{
mytext = mytext + ';' + completeValue ;
}
delete msg['NTE'][i]
i--;
}
But the same code does not work in Mirth 3.0.3, it seems like in this version of Mirth, the message gets converted to the xml even before you apply transformation. It seems like,in this new version, Mirth treat "&" as a Subcomponent delimiter and converts the message accordingly and hence replace('&','and') does not work?
I have tried this transformation to the source in Mirth 3.0.1 but no success.
How to access the HL7 raw message in Mirth 3.0.3?
Any help/suggestions/pointers would be greatly appreciated.
I have applied this javascript transformation on the destination.
var mytext;
for(var i=0;i<msg['NTE'].length();i++)
{
var tempNTE = msg['NTE'][i]['NTE.3']['NTE.3.1'].toString();
var completeValue = tempNTE.replace('&','and');
if(mytext.length==0)
{
mytext = completeValue ;
}
else
{
mytext = mytext + ';' + completeValue ;
}
delete msg['NTE'][i]
i--;
}
But the same code does not work in Mirth 3.0.3, it seems like in this version of Mirth, the message gets converted to the xml even before you apply transformation. It seems like,in this new version, Mirth treat "&" as a Subcomponent delimiter and converts the message accordingly and hence replace('&','and') does not work?
I have tried this transformation to the source in Mirth 3.0.1 but no success.
How to access the HL7 raw message in Mirth 3.0.3?
Any help/suggestions/pointers would be greatly appreciated.
Mirth 3.0.3 - JavaScript String replace() method does not work
0 commentaires:
Enregistrer un commentaire