Announcement

Collapse
No announcement yet.

Decode hl7 fields on a db and some question

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

  • Decode hl7 fields on a db and some question

    I do not succeed to carry out a query from the trasformer (on step 2): the code is like following and its goal is to map some field in a ditionary (address, exam code, ...):
    ____________________________________
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('com.mysql.jdbc.Driver', 'jdbc:mysql://beta:3306/test', 'xxxx', 'xxxx'
    var result = dbConn.executeCachedQuery('select LOINC from EXAM_DECODE where ...'
    result.next();
    [_]
    var sReturnVal = result.getString(1);

    result.close();

    if (sReturnVal != null) {
    logger.info('Ok' + sReturnval);
    }
    else {
    logger.info('Ko'
    }
    dbConn.close();
    __________________________

    The error following:
    __________________
    INFO [Thread-0] com.webreach.mirth.server.Mirth: starting mirth server...
    ERROR [5_destination_2.dispatcher.1] org.mule.impl.DefaultExceptionStrategy:
    ************************************************** ******************************
    Message : syntax error (<cmd>#1) (org.mozilla.javascript.EvaluatorException)
    Type : org.mule.umo.transformer.TransformerException
    Code : 64999
    Transformer : Transformer{name=&#039;5_destination_2&#039;, returnClass=false, returnClass=false, sourceTypes=[]}
    JavaDoc : http://mule.codehaus.org/docs/apidoc...Exception.html
    ************************************************** ******************************
    Exception stack is:
    1. syntax error (<cmd>#1) (org.mozilla.javascript.EvaluatorException)
    org.mozilla.javascript.DefaultErrorReporter:95 (null)
    2. syntax error (<cmd>#1) (org.mozilla.javascript.EvaluatorException) (org.mule.umo.transformer.TransformerException)
    com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer:66 (http://mule.codehaus.org/docs/apidoc...Exception.html)
    ************************************************** ******************************
    Root Exception stack trace:
    org.mozilla.javascript.EvaluatorException: syntax error (<cmd>#1)
    at org.mozilla.javascript.DefaultErrorReporter.runtim eError(DefaultErrorReporter.java:95)
    at org.mozilla.javascript.DefaultErrorReporter.error( DefaultErrorReporter.java:82)
    at org.mozilla.javascript.Parser.addError(Parser.java :122)
    at org.mozilla.javascript.Parser.reportError(Parser.j ava:128)
    at org.mozilla.javascript.Parser.primaryExpr(Parser.j ava:2013)
    at org.mozilla.javascript.Parser.memberExpr(Parser.ja va:1640)
    at org.mozilla.javascript.Parser.unaryExpr(Parser.jav a:1503)
    at org.mozilla.javascript.Parser.mulExpr(Parser.java: 1432)
    at org.mozilla.javascript.Parser.addExpr(Parser.java: 1413)
    at org.mozilla.javascript.Parser.shiftExpr(Parser.jav a:1393)
    at org.mozilla.javascript.Parser.relExpr(Parser.java: 1367)
    at org.mozilla.javascript.Parser.eqExpr(Parser.java:1 323)
    at org.mozilla.javascript.Parser.bitAndExpr(Parser.ja va:1312)
    at org.mozilla.javascript.Parser.bitXorExpr(Parser.ja va:1301)
    at org.mozilla.javascript.Parser.bitOrExpr(Parser.jav a:1290)
    at org.mozilla.javascript.Parser.andExpr(Parser.java: 1278)
    at org.mozilla.javascript.Parser.orExpr(Parser.java:1 266)
    at org.mozilla.javascript.Parser.condExpr(Parser.java :1249)
    at org.mozilla.javascript.Parser.assignExpr(Parser.ja va:1231)
    at org.mozilla.javascript.Parser.assignExpr(Parser.ja va:1237)
    at org.mozilla.javascript.Parser.expr(Parser.java:122 0)
    at org.mozilla.javascript.Parser.statementHelper(Pars er.java:1107)
    at org.mozilla.javascript.Parser.statement(Parser.jav a:619)
    at org.mozilla.javascript.Parser.parseFunctionBody(Pa rser.java:413)
    at org.mozilla.javascript.Parser.function(Parser.java :519)
    at org.mozilla.javascript.Parser.parse(Parser.java:34 4)
    at org.mozilla.javascript.Parser.parse(Parser.java:28 9)
    at org.mozilla.javascript.Context.compileImpl(Context .java:2190)
    at org.mozilla.javascript.Context.compileString(Conte xt.java:1284)
    at org.mozilla.javascript.Context.compileString(Conte xt.java:1273)
    at org.mozilla.javascript.Context.evaluateString(Cont ext.java:1129)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:58)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at org.mule.providers.file.FileMessageDispatcher.doDi spatch(FileMessageDispatcher.java:66)
    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(Thread.java:595)

    ************************************************** ******************************
    ___________________


    I am novice and so some question:
    The DatabaseConnectionFactory object is a Mirth internal object?
    It&#039;s possible to get external bean (adding a jar?)?
    It&#039;s possible to debug a trasformer&#039;s map (or to obtain line errors in the script) ?

    Thanks for the attention.

  • #2
    Re: Decode hl7 fields on a db and some question

    ┬┐Are you using a &#039;JavaScript&#039; transformer or a Map Transformer&#039;?

    You can increment the level of the debug output (conf/log4j.properties) to see what JS sentence is beeing processed

    Comment


    • #3
      Re: Decode hl7 fields on a db and some question

      The code appears to be correct - yes make sure it is a Javascript transformer step and not a map, like Alberto stated.
      Chris Lang

      Comment

      Working...
      X