Hi. I have a transformer set up so that when an ORU^RO1 message with OBX Observation Results segments filled with an RTF file come in, I write out the contained RTF file. All RTF parts map to the path "msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION']['OBX']['OBX.5']", so I index them as I would an array. Being that the path is an array, I use the .length property of the array to know how long the for loop should go. It ends up looking like this-
------------------------
var RTF = "";
var Array_Length = msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION']['OBX']['OBX.5'].length
for (var i = 0; i < Array_Length; i++) {
RTF = RTF + msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION']['OBX']['OBX.5'][i].toString();
}
globalMap.put("RTF_File",RTF);
----------------------
Which I see no fault in assuming I'm allowed to program Javascript inside of a Transformer step. However, I get the following error message when deploying-
WARN 2007-01-24 05:37:08,893 [Thread-0] com.webreach.mirth.server.Mirth: Error deploying channels.
org.mule.config.ConfigurationException: Failed to parse configuration resource "/home/styree/Mirth-1.3/conf/mule-config.xml" (org.mule.config.ConfigurationException)
at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:196)
at com.webreach.mirth.server.Mirth.startMule(Mirth.ja va:164)
at com.webreach.mirth.server.Mirth.restartMule(Mirth. java:147)
at com.webreach.mirth.server.Mirth.run(Mirth.java:103 )
Caused by: org.mule.config.ConfigurationException: Failed to parse configuration resource "/home/styree/Mirth-1.3/conf/mule-config.xml"
at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:12 1)
at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:202)
at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:194)
... 3 more
Caused by: org.mule.umo.lifecycle.InitialisationException: Initialisation Failure: missing ) after argument list (f665cd45-94e7-47d6-b66f-578cbea265c8#1)
at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2919)
at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2945)
at org.apache.commons.digester.Digester.endElement(Di gester.java:1133)
at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digeste r.java:1685)
at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:11 9)
... 5 more
I've taken out the transformer step and it worked without problems. Is there something wrong with what I'm doing? Do I need to put each line in its own Transformer Step? Am I allowed to declare variables in a Transformer Step? Do I need the globalMap.put command or do I just declare a variable RTF_File and it does it for me? I just don't know what I'm allowed and not allowed to do.
------------------------
var RTF = "";
var Array_Length = msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION']['OBX']['OBX.5'].length
for (var i = 0; i < Array_Length; i++) {
RTF = RTF + msg['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['ORU_R01.OBSERVATION']['OBX']['OBX.5'][i].toString();
}
globalMap.put("RTF_File",RTF);
----------------------
Which I see no fault in assuming I'm allowed to program Javascript inside of a Transformer step. However, I get the following error message when deploying-
WARN 2007-01-24 05:37:08,893 [Thread-0] com.webreach.mirth.server.Mirth: Error deploying channels.
org.mule.config.ConfigurationException: Failed to parse configuration resource "/home/styree/Mirth-1.3/conf/mule-config.xml" (org.mule.config.ConfigurationException)
at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:196)
at com.webreach.mirth.server.Mirth.startMule(Mirth.ja va:164)
at com.webreach.mirth.server.Mirth.restartMule(Mirth. java:147)
at com.webreach.mirth.server.Mirth.run(Mirth.java:103 )
Caused by: org.mule.config.ConfigurationException: Failed to parse configuration resource "/home/styree/Mirth-1.3/conf/mule-config.xml"
at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:12 1)
at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:202)
at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:194)
... 3 more
Caused by: org.mule.umo.lifecycle.InitialisationException: Initialisation Failure: missing ) after argument list (f665cd45-94e7-47d6-b66f-578cbea265c8#1)
at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2919)
at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2945)
at org.apache.commons.digester.Digester.endElement(Di gester.java:1133)
at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digeste r.java:1685)
at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:11 9)
... 5 more
I've taken out the transformer step and it worked without problems. Is there something wrong with what I'm doing? Do I need to put each line in its own Transformer Step? Am I allowed to declare variables in a Transformer Step? Do I need the globalMap.put command or do I just declare a variable RTF_File and it does it for me? I just don't know what I'm allowed and not allowed to do.
Comment