Hello everyone!
On Mirth 2.2.2.6388 i have a channel that calls a webservice and parses the response fields . In trasformer extract a field that I use as a filter in the destination . All right when that field has a value , but when it is not valued get the error " TypeError : undefined is not an XML object . "
How can I do so that when that field is not set there is no mistake ? I can check if message is valid XML and, if not, discard it?
Here is the piece of code
var risultato = msg.soapEnv::Body.*::PollingAdapterOutput.*::Messa ges.*::Body.toString();
var result = new XML(risultato);
channelMap.put("result", result);
//Here error is generated when this is not enhanced
var aslresidenza = result..*::controlActProcess.*::subject.*::registr ationEvent.*::subject1.*::patient.*::patientPerson .*::asPatientOfOtherProvider[0].*::subjectOf.*::careProvision.*::performer.*::ass ignedProvider.*::representedOrganization.*::id['@extension'].toString();
channelMap.put("aslresidenza", aslresidenza);
channelMap.put("result", result);
On Mirth 2.2.2.6388 i have a channel that calls a webservice and parses the response fields . In trasformer extract a field that I use as a filter in the destination . All right when that field has a value , but when it is not valued get the error " TypeError : undefined is not an XML object . "
How can I do so that when that field is not set there is no mistake ? I can check if message is valid XML and, if not, discard it?
Here is the piece of code
var risultato = msg.soapEnv::Body.*::PollingAdapterOutput.*::Messa ges.*::Body.toString();
var result = new XML(risultato);
channelMap.put("result", result);
//Here error is generated when this is not enhanced
var aslresidenza = result..*::controlActProcess.*::subject.*::registr ationEvent.*::subject1.*::patient.*::patientPerson .*::asPatientOfOtherProvider[0].*::subjectOf.*::careProvision.*::performer.*::ass ignedProvider.*::representedOrganization.*::id['@extension'].toString();
channelMap.put("aslresidenza", aslresidenza);
channelMap.put("result", result);
TypeError: undefined is not an xml object.
0 commentaires:
Enregistrer un commentaire