Announcement

Collapse
No announcement yet.

Error with SerializerFactory.getHL7Serializer() in Ver 1.4.0

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

  • Error with SerializerFactory.getHL7Serializer() in Ver 1.4.0

    Hi,

    Please help to new syntax to convert HL7 string into XML in 1.4.0


    I imported the Mirth 1.3 script into 1.4.0 and encounter error for the following code.

    tmp = serializer.toXML(msg['hl7msg'].toString());


    19921b3a-00fb-4f01-8e66-4eb05837c5f5: org.mule.umo.transformer.TransformerException: ReferenceError: "serializer" is not defined. (c34c8326-89dd-4bab-bc5b-de5aec713c3c#6) (org.mozilla.javascript.EcmaError) (org.mule.umo.transformer.TransformerException)
    org.mule.umo.transformer.TransformerException: ReferenceError: "serializer" is not defined. (c34c8326-89dd-4bab-bc5b-de5aec713c3c#6) (org.mozilla.javascript.EcmaError) (org.mule.umo.transformer.TransformerException)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:245)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:276)
    at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageDispatcher.doDispatch(MllpMessageDispatcher .java:131)
    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(Unknown Source)
    Caused by: org.mule.umo.transformer.TransformerException: ReferenceError: "serializer" is not defined. (c34c8326-89dd-4bab-bc5b-de5aec713c3c#6) (org.mozilla.javascript.EcmaError)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:348)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:229)
    ... 10 more


    Then, I changed it to the following.


    tmp = SerializerFactory.getHL7Serializer(useStrictParser , useStrictValidation).toXML(msg['hl7msg'].toString());
    default xml namespace = new Namespace('urn:hl7-org:v2xml'

    ERROR 2007-04-23 10:39:46,671 [19921b3a-00fb-4f01-8e66-4eb05837c5f5_destination_1_connector.dispatcher.1] org.mule.impl.DefaultComponentExceptionStrategy: Caught exception in Exception Strategy for: 19921b3a-00fb-4f01-8e66-4eb05837c5f5: org.mule.umo.transformer.TransformerException: ReferenceError: "useStrictParser" is not defined. (ebee9d39-6961-4a38-8d8a-028d40e59b91#6) (org.mozilla.javascript.EcmaError) (org.mule.umo.transformer.TransformerException)
    org.mule.umo.transformer.TransformerException: ReferenceError: "useStrictParser" is not defined.

    Then, I tried the following code.

    tmp = SerializerFactory.getHL7Serializer().toXML(msg['hl7msg'].toString());
    default xml namespace = new Namespace('urn:hl7-org:v2xml'

    I also unchecked the options in 'Properties' of Outgoing Data tab.


    RROR 2007-04-23 10:54:08,687 [19921b3a-00fb-4f01-8e66-4eb05837c5f5_destination_1_connector.dispatcher.1] org.mule.impl.DefaultComponentExceptionStrategy: Caught exception in Exception Strategy for: 19921b3a-00fb-4f01-8e66-4eb05837c5f5: org.mule.umo.transformer.TransformerException: Can't find method com.webreach.mirth.model.converters.SerializerFact ory.getHL7Serializer(). (b509acdc-7383-4f41-89a6-dd88c0c812bb#6) (org.mozilla.javascript.EvaluatorException) (org.mule.umo.transformer.TransformerException)
    org.mule.umo.transformer.TransformerException: Can't find method com.webreach.mirth.model.converters.SerializerFact ory.getHL7Serializer(). (b509acdc-7383-4f41-89a6-dd88c0c812bb#6) (org.mozilla.javascript.EvaluatorException) (org.mule.umo.transformer.TransformerException)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:245)
    at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
    at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
    at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
    at com.webreach.mirth.server.controllers.MessageObjec tController.getMessageObjectFromEvent(MessageObjec tController.java:276)
    at com.webreach.mirth.server.mule.providers.mllp.Mllp MessageDispatcher.doDispatch(MllpMessageDispatcher .java:131)
    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(Unknown Source)
    Caused by: org.mule.umo.transformer.TransformerException: Can't find method com.webreach.mirth.model.converters.SerializerFact ory.getHL7Serializer(). (b509acdc-7383-4f41-89a6-dd88c0c812bb#6) (org.mozilla.javascript.EvaluatorException)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:348)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:229)
    ... 10 more
    Caused by: org.mozilla.javascript.EvaluatorException: Can't find method com.webreach.mirth.model.converters.SerializerFact ory.getHL7Serializer(). (b509acdc-7383-4f41-89a6-dd88c0c812bb#6)
    at org.mozilla.javascript.DefaultErrorReporter.runtim eError(DefaultErrorReporter.java:95)
    at org.mozilla.javascript.Context.reportRuntimeError( Context.java:966)
    at org.mozilla.javascript.Context.reportRuntimeError( Context.java:1022)
    at org.mozilla.javascript.Context.reportRuntimeError1 (Context.java:985)
    at org.mozilla.javascript.NativeJavaMethod.call(Nativ eJavaMethod.java:158)
    at org.mozilla.javascript.optimizer.OptRuntime.callPr op0(OptRuntime.java:117)
    at org.mozilla.javascript.gen.c5._c3(b509acdc-7383-4f41-89a6-dd88c0c812bb:6)
    at org.mozilla.javascript.gen.c5.call(b509acdc-7383-4f41-89a6-dd88c0c812bb)
    at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
    at org.mozilla.javascript.gen.c5._c0(b509acdc-7383-4f41-89a6-dd88c0c812bb:7)
    at org.mozilla.javascript.gen.c5.call(b509acdc-7383-4f41-89a6-dd88c0c812bb)
    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.c5.call(b509acdc-7383-4f41-89a6-dd88c0c812bb)
    at org.mozilla.javascript.gen.c5.exec(b509acdc-7383-4f41-89a6-dd88c0c812bb)
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:308)
    ... 11 more

    Thanks,
    Charles




  • #2
    Re: Error with SerializerFactory.getHL7Serializer() in Ver 1.4.0


    tmp = SerializerFactory.getHL7Serializer(true, false).toXML(msg['hl7msg'].toString());
    Chris Lang

    Comment

    Working...
    X