Announcement

Collapse
No announcement yet.

Unable file reader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable file reader

    I'm testing mirth.
    I have a outbound channel that reads message from file.
    In Raw Messages column I see the messages without CR an LF. I tried it with and without LF.

    I get the following error in both cases:

    org.mozilla.javascript.EcmaError: TypeError: error: Unexpected character encountered (lex state 3): '|' (1aa71ca1-05e0-4a7c-8b07-43c83a89b81f#2)
    at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3226)
    at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3216)
    at org.mozilla.javascript.ScriptRuntime.typeError(Scr iptRuntime.java:3232)
    at org.mozilla.javascript.xmlimpl.XML.createFromJS(XM L.java:378)
    at org.mozilla.javascript.xmlimpl.XML.jsConstructor(X ML.java:3050)
    at org.mozilla.javascript.xmlimpl.XMLObjectImpl.execI dCall(XMLObjectImpl.java:546)
    at org.mozilla.javascript.IdFunctionObject.call(IdFun ctionObject.java:124)
    at org.mozilla.javascript.BaseFunction.construct(Base Function.java:310)
    at org.mozilla.javascript.ScriptRuntime.newObject(Scr iptRuntime.java:2067)
    at org.mozilla.javascript.gen.c11._c1(1aa71ca1-05e0-4a7c-8b07-43c83a89b81f:2)
    at org.mozilla.javascript.gen.c11.call(1aa71ca1-05e0-4a7c-8b07-43c83a89b81f)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c11._c0(1aa71ca1-05e0-4a7c-8b07-43c83a89b81f:4)
    at org.mozilla.javascript.gen.c11.call(1aa71ca1-05e0-4a7c-8b07-43c83a89b81f)
    at org.mozilla.javascript.ContextFactory.doTopCall(Co ntextFactory.java:337)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(Scr iptRuntime.java:2755)
    at org.mozilla.javascript.gen.c11.call(1aa71ca1-05e0-4a7c-8b07-43c83a89b81f)
    at org.mozilla.javascript.gen.c11.exec(1aa71ca1-05e0-4a7c-8b07-43c83a89b81f)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateFilterScript(JavaScriptTra nsformer.java:210)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:173)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.providers.soap.axis.AxisMessageDispatcher .doDispatch(AxisMessageDispatcher.java:194)
    at org.mule.providers.AbstractMessageDispatcher$Worke r.run(AbstractMessageDispatcher.java:257)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Unknown Source)


    Any ideas?

    Thanks.

  • #2
    Re: Unable file reader

    That means you have an error in your Filter javascript. Can you paste your filter?

    Thanks,
    -Chris
    Chris Lang

    Comment


    • #3
      Re: Unable file reader

      I have no filter.

      I have a outbound channel read data from File a(HL7 ER7 messages) and sending to SOAP sender.

      It is a configuration for testing purposes.

      Thanks.

      Fernando.

      Comment


      • #4
        Re: Unable file reader

        Can you post you full channel XML? Thanks!
        Chris Lang

        Comment


        • #5
          Re: Unable file reader

          This is my channel XML.
          I have no transformers and no filters.

          <com.webreach.mirth.model.Channel>
          <id>248e28d1-3b7b-42a0-8a39-1930e910ffd5</id>
          <name>TURRIANO_OUT</name>
          <description></description>
          <enabled>true</enabled>
          <version>1.3.1</version>
          <revision>7</revision>
          <direction>OUTBOUND</direction>
          <protocol>HL7</protocol>
          <mode>ROUTER</mode>
          <sourceConnector>
          <name>sourceConnector</name>
          <properties>
          <property name="sortAttribute">date</property>
          <property name="pollingFrequency">5000</property>
          <property name="DataType">File Reader</property>
          <property name="fileAge">0</property>
          <property name="moveToPattern">*.bak</property>
          <property name="charsetEncoding">DEFAULT_ENCODING</property>
          <property name="checkFileAge">0</property>
          <property name="autoDelete">0</property>
          <property name="host">C:/TURRIANO</property>
          <property name="fileFilter">*.hl7</property>
          <property name="moveToDirectory"></property>
          </properties>
          <transformer>
          <steps/>
          </transformer>
          <filter>
          <rules/>
          </filter>
          <transportName>File Reader</transportName>
          </sourceConnector>
          <destinationConnectors>
          <com.webreach.mirth.model.Connector>
          <name>TURRIANO</name>
          <properties>
          <property name="DataType">SOAP Sender</property>
          <property name="wsdlUrl">http://localhost:8080/turriano_srv/s...sdl</property>
          <property name="definition">&lt;com.webreach.mirth.model.ws. WSDefinition&gt;
          &lt;operations&gt;
          &lt;entry&gt;
          &lt;string&gt;runService&lt;/string&gt;
          &lt;com.webreach.mirth.model.ws.WSOperation&gt;
          &lt;name&gt;runService&lt;/name&gt;
          &lt;parameters&gt;
          &lt;com.webreach.mirth.model.ws.WSParameter&gt;
          &lt;name&gt;in0&lt;/name&gt;
          &lt;type&gt;string&lt;/type&gt;
          &lt;value&gt;intLabReceiver&lt;/value&gt;
          &lt;array&gt;false&lt;/array&gt;
          &lt;Null&gt;false&lt;/Null&gt;
          &lt;minOccurs&gt;0&lt;/minOccurs&gt;
          &lt;maxOccurs&gt;0&lt;/maxOccurs&gt;
          &lt;nillable&gt;false&lt;/nillable&gt;
          &lt;complex&gt;false&lt;/complex&gt;
          &lt;/com.webreach.mirth.model.ws.WSParameter&gt;
          &lt;com.webreach.mirth.model.ws.WSParameter&gt;
          &lt;name&gt;in1&lt;/name&gt;
          &lt;type&gt;base64Binary&lt;/type&gt;
          &lt;value&gt;${message.encodedData}&lt;/value&gt;
          &lt;array&gt;false&lt;/array&gt;
          &lt;Null&gt;false&lt;/Null&gt;
          &lt;minOccurs&gt;0&lt;/minOccurs&gt;
          &lt;maxOccurs&gt;0&lt;/maxOccurs&gt;
          &lt;nillable&gt;false&lt;/nillable&gt;
          &lt;complex&gt;false&lt;/complex&gt;
          &lt;/com.webreach.mirth.model.ws.WSParameter&gt;
          &lt;/parameters&gt;
          &lt;soapActionURI&gt;&lt;/soapActionURI&gt;
          &lt;namespace&gt;http://webservices.bie.cisos.sescam..../namespace&gt;
          &lt;/com.webreach.mirth.model.ws.WSOperation&gt;
          &lt;/entry&gt;
          &lt;/operations&gt;
          &lt;complexTypes/&gt;
          &lt;serviceEndpointURI&gt;http://XXX.XXX.XXX.XXX:XXXX/higeia/s...ndpointURI&gt;
          &lt;/com.webreach.mirth.model.ws.WSDefinition&gt;</property>
          <property name="soapActionURI"></property>
          <property name="soapEnvelope">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
          &lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:soapenc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
          &lt;soap:Body soap:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt;
          &lt;runService xmlns=&quot;http://webservices.bie.cisos.sescam.org&quot;&gt;&#x0D;
          &lt;in0&gt;intLabReceiver&lt;/in0&gt;&#x0D;
          &lt;in1&gt;${message.encodedData}&lt;/in1&gt;&#x0D;
          &lt;/runService&gt;&#x0D;
          &lt;/soap:Body&gt;
          &lt;/soap:Envelope&gt;</property>
          <property name="host">axis:http://localhost:8080/turriano_srv/s...ice</property>
          <property name="serviceEndpoint">http://localhost:8080/turriano_srv/s...ice</property>
          <property name="method">runService</property>
          </properties>
          <transformer>
          <steps/>
          <template></template>
          </transformer>
          <filter>
          <rules/>
          <template></template>
          </filter>
          <transportName>SOAP Sender</transportName>
          </com.webreach.mirth.model.Connector>
          </destinationConnectors>
          <properties>
          <property name="initialState">started</property>
          <property name="synchronous">false</property>
          <property name="store_messages">true</property>
          <property name="recv_xml_encoded">false</property>
          <property name="encryptData">false</property>
          <property name="transactional">false</property>
          <property name="max_message_age">-1</property>
          <property name="error_messages_only">false</property>
          </properties>
          <preprocessingScript>// Modify the message variable below to pre process data&#x0D;
          return message;</preprocessingScript>
          </com.webreach.mirth.model.Channel>

          Comment


          • #6
            Re: Unable file reader

            Can you post an example of the data you are reading in from the file? The issue you see is due to the fact that the data you&#039;re reading in is not XML encoded. Outbound channels can only read data in that is in HL7 format.

            From the looks of your channel, the best option would be an Inbound channel. The inbound channel reads in ER7 encoded HL7 and lets you send it back out, however the Outbound channel reads in XML and outputs ER7 from the template you use in the transformer.

            -Chris
            Chris Lang

            Comment


            • #7
              Re: Unable file reader

              Thanks Chris.

              Any documentation to understand inbound and outbound channels?

              Comment


              • #8
                Re: Unable file reader

                Not yet, we&#039;re working on it!
                Chris Lang

                Comment

                Working...
                X