Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Error reading binary file

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

  • Error reading binary file

    I create a simple channel that read a binary file but the system is giving me this error:

    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    com.webreach.mirth.model.converters.SerializerExce ption: org.xml.sax.SAXParseException: Element type "MTEwMDAwMQ" must be followed by either attribute specifications, ">" or "/>".
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:168)
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:50)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:395)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:278)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:223)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:130)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:118)
    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)
    Caused by: org.xml.sax.SAXParseException: Element type "MTEwMDAwMQ" must be followed by either attribute specifications, ">" or "/>".
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalEr ror(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.XMLScanner.reportFatalError (Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anStartElement(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 com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:163)
    ... 20 more


    Anybody knows what this means?

    Thanks.

  • #2
    Re:Error reading binary file

    In your preprocessor, you need to wrap the data in XML tags. You channel also needs to be XML, not HL7.
    Chris Lang

    Comment


    • #3
      Re:Error reading binary file

      Now I'm having this error:

      ERROR-300: Transformer error
      ERROR MESSAGE: Error evaluating transformer
      org.mozilla.javascript.EcmaError: TypeError: error: Unexpected character encountered (lex state 8): '=' (010b7e4c-c28f-4ddf-ba25-e19678264937#3)
      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.c58._c7(010b7e4c-c28f-4ddf-ba25-e19678264937:3)
      at org.mozilla.javascript.gen.c58.call(010b7e4c-c28f-4ddf-ba25-e19678264937)
      at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
      at org.mozilla.javascript.gen.c58._c0(010b7e4c-c28f-4ddf-ba25-e19678264937:139)
      at org.mozilla.javascript.gen.c58.call(010b7e4c-c28f-4ddf-ba25-e19678264937)
      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.c58.call(010b7e4c-c28f-4ddf-ba25-e19678264937)
      at org.mozilla.javascript.gen.c58.exec(010b7e4c-c28f-4ddf-ba25-e19678264937)
      at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:361)
      at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:278)
      at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
      at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
      at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
      at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:476)
      at com.webreach.mirth.connectors.file.FileMessageDisp atcher.doDispatch(FileMessageDispatcher.java:79)
      at com.webreach.mirth.connectors.file.FileMessageDisp atcher.doSend(FileMessageDispatcher.java:213)
      at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
      at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
      at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:89)
      at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
      at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
      at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
      at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
      at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
      at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
      at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
      at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:161)
      at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
      at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
      at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:223)
      at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:130)
      at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:118)
      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)


      This is what I see in the raw message:
      <?xml version="1.0" encoding="UTF-8"?>
      <data>MDExMDAxMDEwMTExMTAwMDAxMTAwMDAxMDExMDExMDEw MTExMDAwMDAxMTAxMTAwMDExMDAxMDEw
      MDEwMDAwMDAxMTAxMTEgMTAxMTAwMTEwMDAxMDAwMDAwMTEwMD AxMDAxMTAxMDAxMDExMDExMTAw
      MTEwMDAwMTAxMTEwMDEwMDExMTEwMDEwMDEwMDAwMDAxIDEwMD EwMDAxMTAwMDAxMDExMTAxMDAw
      MTEwMDAwMQ==</data>


      What I'm trying is to read a binary file and then translate that in an ascii data.
      Example binary data: 010011010110000101101110
      Want in ascii data : Man

      But when Mirth read the binary data translate this data to base64 encoded data, how can I translate this encoded data to ascii data or send it like an hl7 message?

      Comment


      • #4
        Re:Error reading binary file

        For your first issue, you need to wrap the BASE64 data in a CDATA tag.

        Now if you would just like to convert the binary data to ASCII, you might not need to do BASE64 work at all. What type of binary data do you have? You can always try (in preprocessor):

        Code:
        message = new String(message);
        Chris Lang

        Comment


        • #5
          Re:Error reading binary file

          I'm reading this from a file:
          01100101011110000110000101101101011100000110110001 100101001000000110111 10110011000100000011000100110100101101110011000010 1110010011110010010000001 100100011000010111010001100001

          And I want Mirth to write this to an ascii file:
          example of binary data (this is the meaning of the bits)

          The problem is that when we extract data from a pharmacy application it comes binary and we need to send information when the prescriptions of any patiente changes to another application. And I'm looking a way to read this binary data, translate it and send it to the other application (like an hl7 message or reding the data from an ascii file).

          When I use
          message = new String(message);

          it generates this error:

          ERROR-301: Transformer conversion error
          ERROR MESSAGE: Error adapting message
          org.xml.sax.SAXParseException: Content is not allowed in prolog.
          at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
          at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(U nknown Source)
          at com.webreach.mirth.server.mule.adaptors.XMLAdaptor .populateMessage(XMLAdaptor.java:23)
          at com.webreach.mirth.server.mule.adaptors.Adaptor.ge tMessage(Adaptor.java:41)
          at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:250)
          at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
          at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
          at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
          at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
          at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
          at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
          at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
          at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
          at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
          at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
          at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:223)
          at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:130)
          at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:118)
          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)

          Comment


          • #6
            Re:Error reading binary file

            Please, could you post an example of your binary file ?

            Comment


            • #7
              Re:Error reading binary file

              Here is a simple example of my binary file. I want mirth translate this bits and create an ascii file with the content, in this example the system have to write in the ascii file: example of binary data. This is an example because the binary file that we are going to receive gonna have the patient information. Then this information we want to send it to another application trough an hl7 message or reading it from the ascii file. bin.txt (178 bytes)

              Comment

              Working...
              X