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

Improper ORU message

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

  • Improper ORU message

    [Mirth newest version]

    Having an issue here that's not a Mirth problem but hoping Mirth can fix it. I'm sending old report from a RIS to Mirth which will then send to PACS. I've setup and tested this with other RIS and have no problem at all.

    The problem lies in the way the RIS is formatting the report. The RIS sends in OBX.5

    [RTF formatted Report~~Plain TXT report]

    So I split the OBX.5 on the "~" to send which format I'm wanting. Problem is, through out the entire OBX.5, there are \r seperators. This is causing Mirth to error out before it can even transform the message.

    Error: DETAILS: TypeError: error: Unexpected character encountered (lex state 9): '{'

    Part of the OBX:
    Code:
    OBX|1|TX|||{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}}?
    {\colortbl ;\red0\green0\blue0;}?
    \viewkind4\uc1\pard\cf1\b\fs22 EXAM:    MRI LUMBAR SPINE WITHOUT CONTRAST?
    \par ?
    \par HISTORY:\b0    Progressive sciatica; compare with prior MRI of 10/28/06.
    If I do a preprocess message = message.replace( /\r/g, "" ); All \r are obviously replaced throughout message but then the message isn't in proper format. There is no seperation between Segement, no new lines at all. MSH,PID are all 1 line.

    I tried seperating on the message = message.replace( /?\r/g, "" ); but that fails on Mirth side as well. I don't even know why that "?" is even before a \r. Doesn't make sense to me.

    Any ideas?

  • #2
    Re:Improper ORU message

    Note: "r"s in the previous posts are
    Code:
    \\r
    [CR]s

    Post edited by: mcanalld, at: 05/28/2008 13:30

    Post edited by: mcanalld, at: 05/28/2008 13:30

    Comment


    • #3
      Re:Improper ORU message

      OK, was able to get it to kinda work:

      I added this to the preprocessor script:

      var splitReports = message.split("\\rOBX|");

      Code:
      var splitReports = message.split("\\rOBX|"«»);
      
      for( var i = 1; i<splitReports.length; i++ )
      {
      	splitReports[i] = "\\rOBX|" + splitReports[i].replace(/(\\r)/gi, '');
      }
      
      message = "";
      
      for( var i = 0; i<splitReports.length; i++ )
      {
      	message += splitReports[i];
      }
      
      return message;

      Now incoming messages coming in through the LLP connection fail....Now if I reprocess those messages the above script works and Sends/Transforms without issues. What gives?

      Error:
      [2008-05-28 23:55:29,228] ERROR (org.mule.impl.DefaultComponentExceptionStrategy:9 5): Caught exception in Exception Strategy for: 85fb8189-e35a-488b-be1f-6d1aae005256: org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.webreach.mirth [email protected], endpointUri=mllp://10.120.0.73:6663, transformer=Transformer{name='ByteArrayToString', returnClass=false, returnClass=false, sourceTypes=[class [B, class java.lang.String]}, name='_mllpEndpoint#1184274070', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon [email protected], filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: java.lang.String
      org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{connector=com.webreach.mirth [email protected], endpointUri=mllp://10.120.0.73:6663, transformer=Transformer{name='ByteArrayToString', returnClass=false, returnClass=false, sourceTypes=[class [B, class java.lang.String]}, name='_mllpEndpoint#1184274070', type='receiver', properties={}, transactionConfig=org.mule.impl.MuleTransactionCon [email protected], filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: java.lang.String
      at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:64)
      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:244)
      at com.webreach.mirth.connectors.mllp.MllpMessageRece iver$TcpWorker.processHL7Data(MllpMessageReceiver. java:440)
      at com.webreach.mirth.connectors.mllp.MllpMessageRece iver$TcpWorker.processData(MllpMessageReceiver.jav a:418)
      at com.webreach.mirth.connectors.mllp.MllpMessageRece iver$TcpWorker.run(MllpMessageReceiver.java:339)
      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)Caused by: org.mule.umo.transformer.TransformerException:
      CHANNEL:
      ADV reciever
      CONNECTOR:
      sourceConnector
      SCRIPT SOURCE:

      LINE NUMBER:
      1
      DETAILS:
      TypeError: error: Unexpected character encountered (lex state 9): '{' (com.webreach.mirth.server.MirthJavascriptTransfor merException)
      at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:448)
      at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:346)
      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)
      ... 11 moreCaused by: com.webreach.mirth.server.MirthJavascriptTransform erException:
      CHANNEL:
      ADV reciever
      CONNECTOR:
      sourceConnector
      SCRIPT SOURCE:

      LINE NUMBER:
      1
      DETAILS:
      TypeError: error: Unexpected character encountered (lex state 9): '{'
      at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:439)
      ... 18 more

      Comment

      Working...
      X