Announcement

Collapse
No announcement yet.

namespace error hl7xml

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

  • namespace error hl7xml

    Hello,

    I`m using mirth 1.4, and I have a SOAP to SOAP channel. The enter
    message is a HL7xml.

    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:RSP_K22 xmlns:ns2="http://mynamespace.com/hl7">
    <ns2:MSH>
    <ns2:MSH.1>^~\&</ns2:MSH.1>
    <ns2:MSH.2>ISO-8859-1</ns2:MSH.2>
    ....

    doesn´t Mirth work with different namespaces?

    this is the error:

    ERROR-200: Filter error
    ERROR MESSAGE: Error evaluating filter
    org.mozilla.javascript.EcmaError: TypeError: error: Use of undefined namespace prefix: ns2 (9e6f7aa1-3eab-4b0e-b788-414f01eedd7d#5)
    ....

    console:
    ERROR 2007-03-30 10:25:07,115 [_soapConnector#1619090.soap:Mirth.receiver.2] com.webreach.mirth.server.mule.providers.soap.Serv iceProxy$AxisServiceHandler: 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] e53c, endpointUri=soap://localhost:8090/services, transformer=Transformer{name=&#039;SOAPRequestToSt ring&#039;, returnClass=false, returnClass=false, sourceTypes=[]}, name=&#039;_soapEndpoint#-322513352&#039;, type=&#039;receiver&#039;, 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: [Ljava.lang.Object;




  • #2
    Re: namespace error hl7xml

    For a valid XML/HL7 you should use the formal namespace:
    Code:
    xmlns="urn:hl7-org:v2xml"

    Comment


    • #3
      Re: namespace error hl7xml

      Mirth strips out namespace declarations on incoming messages (to allow the use of msg[] and tmp[] notations).

      You can add namespaces back in the transformer by doing:

      msg.setNamespace(new Namespace("ns2", "http://mynamespace.com/hl7")); in a Javascript step.
      Chris Lang

      Comment


      • #4
        Re: namespace error hl7xml

        Thanks. Thats what I needed

        Comment


        • #5
          Re: namespace error hl7xml

          I&#039;m having the same problem. Working on Mirth 1.4.0 I find it difficult to follow suggestions when the documentation is behind and almost no examples are available.

          If I try to create a transformer step the only type I see is type=Mapper.

          So How do I create a javascript step ???

          Comment


          • #6
            Re: namespace error hl7xml

            Transformer screen / Right-click / Add New Step / Shows a row with "Name" and "Mapper" columns / Double click under "Type" / Dropdown List shows "Mapper", Message Builder", and "JavaScript" / Select "JavaScript".

            Comment


            • #7
              Re: namespace error hl7xml

              Transformer screen / Right-click / Add New Step / Shows a row with "Name" and "Type" columns / Double click under "Type" / Dropdown List shows "Mapper", "Message Builder", and "JavaScript" / Select "JavaScript".

              Comment


              • #8
                Re: namespace error hl7xml

                Thats a neat one

                But still , being a beginner I permit myself to ask a little bit further. The javascript does not have the intended effect.

                <?xml version="1.0" encoding="UTF-8"?>
                <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <soap:Body>

                ERROR-200: Filter error
                ERROR MESSAGE: Error evaluating filter
                org.mozilla.javascript.EcmaError: TypeError: error: Use of undefined namespace prefix: soap (ce5b78e9-be24-48dd-9a65-d7492eb3ed06#5)
                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.typeError(Scr iptRuntime.java:3232)
                at org.mozilla.javascript.xmlimpl.XML.createFromJS(XM L.java:378)
                at org.mozilla.javascript.xmlimpl.XML.jsConstructor(X ML.java:3050)
                at org.mozilla.javascript.xmlimpl.XMLObjectImpl.execI dCall(XMLObjectImpl.java:546)
                at org.mozilla.javascript.IdFunctionObject.call(IdFun ctionObject.java:124)
                at org.mozilla.javascript.BaseFunction.construct(Base Function.java:310)
                at org.mozilla.javascript.ScriptRuntime.newObject(Scr iptRuntime.java:2067)
                at org.mozilla.javascript.gen.c137._c2(ce5b78e9-be24-48dd-9a65-d7492eb3ed06:5)
                at org.mozilla.javascript.gen.c137.call(ce5b78e9-be24-48dd-9a65-d7492eb3ed06)
                at org.mozilla.javascript.optimizer.OptRuntime.callNa me0(OptRuntime.java:106)
                at org.mozilla.javascript.gen.c137._c0(ce5b78e9-be24-48dd-9a65-d7492eb3ed06:6)
                at org.mozilla.javascript.gen.c137.call(ce5b78e9-be24-48dd-9a65-d7492eb3ed06)
                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.c137.call(ce5b78e9-be24-48dd-9a65-d7492eb3ed06)
                at org.mozilla.javascript.gen.c137.exec(ce5b78e9-be24-48dd-9a65-d7492eb3ed06)
                at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateFilterScript(JavaScriptTra nsformer.java:268)
                at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:221)
                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.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.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:225)
                at com.webreach.mirth.server.mule.providers.vm.VMMess ageReceiver.getMessages(VMMessageReceiver.java:105 )
                at org.mule.providers.TransactedPollingMessageReceive r.poll(TransactedPollingMessageReceiver.java:108)
                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)


                I&#039;m trying to process the response on a SOAP request done in channel-1. Within the destination definition in channel-1 I send the response to channel-2, being a channel reader. On the source I defined a transformer step with

                msg.setNamespace(new Namespace("soap","http://schemas.xmlsoap.org/soap/envelope/"));

                Is there anything clearly wrong here ??

                I would like to transform the SOAP response to a HL7 message and send it to the orignal Client ??? Can I do that within channel-1 ??

                Comment


                • #9
                  Re: namespace error hl7xml

                  I looked at JavaScriptTransformer and evaluateFilterScript but there is no Filter defined. I tried to create a filter step with a simple return true;
                  but that did not help.

                  I tried to put the setNameSpace in the first step of a filterscript with no luck

                  There are some logger.debug and logger.error statements where can I find its output (I dont see it in the mirth.log or server console )?

                  Comment

                  Working...
                  X