Announcement

Collapse
No announcement yet.

reference error

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

  • reference error

    It gave me this error when I tried to parse a simple ADT_A01 message

    org.mozilla.javascript.EcmaError: ReferenceError: "tmp" is not defined. (f1c0f13f-d53e-4172-a3fa-4955b4c1559c#1)
    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.notFoundError (ScriptRuntime.java:3289)
    at org.mozilla.javascript.ScriptRuntime.nameOrFunctio n(ScriptRuntime.java:1633)
    at org.mozilla.javascript.ScriptRuntime.name(ScriptRu ntime.java:1572)
    at org.mozilla.javascript.gen.c3._c2(f1c0f13f-d53e-4172-a3fa-4955b4c1559c:1)
    at org.mozilla.javascript.gen.c3.call(f1c0f13f-d53e-4172-a3fa-4955b4c1559c)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c3._c0(f1c0f13f-d53e-4172-a3fa-4955b4c1559c:1)
    at org.mozilla.javascript.gen.c3.call(f1c0f13f-d53e-4172-a3fa-4955b4c1559c)
    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.c3.call(f1c0f13f-d53e-4172-a3fa-4955b4c1559c)
    at org.mozilla.javascript.gen.c3.exec(f1c0f13f-d53e-4172-a3fa-4955b4c1559c)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateInboundTransformerScript(J avaScriptTransformer.java:253)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.doTransform(JavaScriptTransformer. java:170)
    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.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 org.mule.providers.file.FileMessageReceiver.proces sFile(FileMessageReceiver.java:183)
    at org.mule.providers.file.FileMessageReceiver.poll(F ileMessageReceiver.java:111)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
    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)


    The HL7 message:

    MSH|^~\&|ADT1|MCM|LABADT|MCM|200701221500|SECURITY |ADT^A01^ADT_A01|MSG00001|P|2.5
    EVN|A01|198808181123
    PID|1||PATID1234^5^M11^ADT1^MR^MCM~123456789^^^USS SA^SS||JONES^WILLIAM^A^III||19610615|M||C|1200 N ELM STREET^^GREENSBORO^NC^27401-1020|GL|(919)379-1212|(919)271-3434||S||
    NK1|1|JONES^BARBARA^K|WI^WIFE||||NK^NEXT OF KIN
    PV1|1|I|2000^2012^01||||004777^LEBAUER^SIDNEY^J.|| |SUR||||ADM|A0|


    any idea would be great. thanks.

  • #2
    Re: reference error

    If you have a JavaScript step, check if the variabe tmp is defined, like:

    var tmp;

    or

    var tmp = "";

    Hope it helps!

    Comment


    • #3
      Re: reference error

      as far as i can tell i dont have javascript enabled. i'm new to mirth, if there anything else i might have missed?

      Comment


      • #4
        Re: reference error

        Can you post your channel XML?

        Comment


        • #5
          Re: reference error

          Your channel is Outbound and you do not have a template declared. If you are reading HL7 in, you want to use an inbound channel.

          However - if you do want to create HL7 from some source data (let's assume from a database):
          "tmp" is the outbound message constructor variable. When you define a template on an outbound channel (in the transformer - paste a message in the HL7 template tab), you can modify "tmp" to create new HL7 messages from source data. For example, to set the patient last name of your template HL7 message to a value you read in from a database:

          Code:
          tmp['PID']['PID.5']['XPN.2'] = msg['patient_lname']
          That code would set the XPN.2 value in the PID.5 segment to the value of 'patient_lname' (the name of the database column containing the patients last name). Mirth will then encode the tmp value to er7 and make it available to destination connectors. This is only for Outbound.

          -Chris
          Chris Lang

          Comment


          • #6
            Re: reference error

            thanks for all the reply. the problem was in the destinations template. i've created a transformer variable and put it in the destination template, that's where the error occured. does anyone have examples or references on how the transformer works? greatly appreciated.

            Comment

            Working...
            X