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

Just trying to copy a simple XML file

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

  • Just trying to copy a simple XML file

    I love Mirth and want to use it to create and process CCR and CCD xml files. I tried more complex things, but I must be missing something basic. I've set up a file reader and file writer to move a simple XML file from one directory to another. And I get the following error. (I also got the same error on a sample CCR.xml file and decided to try something simple first). The file is attached and comes as an xalan sample.
    Thanks,
    gpl

    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    com.webreach.mirth.model.converters.SerializerExce ption: java.lang.ArrayIndexOutOfBoundsException: 1
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:199)
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:49)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:387)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:307)
    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:493)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:231)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:236)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:138)
    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: java.lang.ArrayIndexOutOfBoundsException: 1
    at com.webreach.mirth.model.converters.ER7XMLHandler. startElement(ER7XMLHandler.java:111)
    at org.apache.xerces.parsers.AbstractSAXParser.startE lement(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:194)
    ... 20 more

    birds.xml (9363 bytes)

  • #2
    Re:Just trying to copy a simple XML file

    I've had some success. I've added a transformation to the simple file copy of an XML file and now I get a new error (below) followed by a successful transformation message followed by the original "out of bounds" error as before. I'm attaching the sample XML file that I'm using now. It does not contain real patient data.

    Thanks for looking at it and perhaps giving me some guidance.

    George Lilly


    ERROR-301: Transformer conversion error
    ERROR MESSAGE: Error adapting message
    org.xml.sax.SAXParseException: The reference to entity "T" must end with the ';' delimiter.
    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:282)
    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:493)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:231)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:236)
    at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:138)
    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(Thread.java:619)

    patient2.xml (7614 bytes)

    Comment


    • #3
      Re:Just trying to copy a simple XML file

      Attached is the Channel i'm using to get the error.
      gpl CCR_Send.xml (23770 bytes)

      Comment


      • #4
        Re:Just trying to copy a simple XML file

        Perhaps you'd started configuring your channel using HL7 as incoming data format, and once you saved the configuration, you changed it to XML?

        I've experienced a problem very similar to this. In my case, the workarround was start configuring a new channel from scratch using XML as incoming data format.

        Comment


        • #5
          @quimicefa

          I want to thank you for your solution. Your solution did the trick.
          I had a transformation from HL7 to a CSV file but I did a save before changing the outbound template to delemited text. I did that afterwards I also keep getting that same error and finally I stumbled on Your answer and voila it worked.

          So resume Set the outbound message to the correct datatype before you save the changes to the channel.
          Stefan

          Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

          Comment


          • #6
            You simply need to go through each transformer (on both the source and every destination) and make sure both the Incoming and Outgoing data are set to the data type you want.

            This quirk actually happens because of how flexible Mirth Connect is. Before you first save your channel or edit your transformers, whatever you change the incoming data to changes the incoming/outgoing data type on every filter/transformer in the channel. After that, you will have to change each setting individually.

            Imagine you wanted to receive HL7 at the source, but send out XML to the destination (assuming you do the proper transforms). If the incoming data setting always changed all transformer data types, this sort of common conversion inside of a channel would not be possible. If you have changed your entire channel to XML, and then later after this "initial state" has been created you only change the incoming data back, then you will get these errors.

            It's really simple to fix once you understand what it's doing. I agree the current way it sets these properties is not very clean, but changing system wide settings the first time you set incoming data actually ends up solving this issue for most cases. The other option would be to force you to change the setting on every transformer in the source and each destination manually when you want to create a channel with something other than the default. That would be very time consuming. Perhaps a prompt with multiple options would be helpful in the future.
            Jacob Brauer
            Director, Software Development
            NextGen Healthcare

            sigpic

            Comment

            Working...
            X