Announcement

Collapse
No announcement yet.

Form feed (unicode 0xc) causing transformer error

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

  • Form feed (unicode 0xc) causing transformer error

    We're currently rolling out Mirth in a test mode to act as an LLP listener, writing HL7 v2 messages out to files. It's been working great, but we ran into a problem recently where we're receiving transcription messages with form feed characters (unicode 0xc) in the body (OBX-5). When that happens, the message errors off with the error below. We strip those form feeds out downstream of Mirth, so if there's a way to do that in Mirth (or bypass this error) that would be great.

    Thanks in advance for any advice.

    ERROR-300: Transformer error
    ERROR MESSAGE: Error evaluating transformer
    com.webreach.mirth.model.converters.SerializerExce ption: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xc) was found in the element content of the document.
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:157)
    at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:50)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:393)
    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:243)
    at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageReceiver$TcpWorker.processData(MllpMessageR eceiver.java:362)
    at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageReceiver$TcpWorker.run(MllpMessageReceiver. java:284)
    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: An invalid XML character (Unicode: 0xc) was found in the element content of the document.
    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.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:152)
    ... 19 more

  • #2
    Re:Form feed (unicode 0xc) causing transformer err

    0x0c is forbidden in HL7 message. This is why the exception is generated.

    You can solve the problem using the preprocessors, removing this elements.

    Post edited by: albertosaez, at: 08/01/2007 07:18

    Comment


    • #3
      Re:Form feed (unicode 0xc) causing transformer err

      Thanks, I removed the characters in the preprocessing script and that worked.

      Comment


      • #4
        Re:Form feed (unicode 0xc) causing transformer err

        I am having the same problem...can you post your preprocessing script?

        Thanks

        Comment


        • #5
          Re:Form feed (unicode 0xc) causing transformer error

          I was getting the same errors in my messages.

          I stored the message containing the invalid characters in a string and did the following:

          string = string.replace(/\u000c+/g, "");


          Fixed the problem for me.

          Comment


          • #6
            DelimitedSerializer

            @ albertosaez :
            If Unicode 0xC is a forbidden HL7 character, why would Mirth throw an error in DelimitedSerializer? I find this weird.

            [2011-01-19 11:02:24,473] ERROR (com.mirth.connect.model.converters.DelimitedSeria lizer:54): org.xml.sax.SAXParseException:An invalid XML character (Unicode: 0xc) was found in the element content of the document.

            Comment

            Working...
            X