Announcement

Collapse
No announcement yet.

use of Mirth for simple file transfer

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

  • use of Mirth for simple file transfer

    Hi!

    Using Mirth as an HL7 Interface engine for the transfer of HL7 files is simple and working fine. Now I've to integrate two older systems where the communication is file-based (plain text). The files have not a valid HL7 structure (but are very simmilar). Therefore I want to use Mirth (as a basic module), but I want to disable the parsing of the data and transmit the files without any checks. Is this possible? Which modifications in the source code should be done?

    Thank you
    Peter

  • #2
    Re: use of Mirth for simple file transfer

    Internally, Mirth is based on mule esb. In theory you could define a new connector for don't making any parsing. But I'm not sure if it worth the Cost.

    ¿What kind of input and output do you need?

    Comment


    • #3
      Re: use of Mirth for simple file transfer

      It is a plain text file with a specific syntax (similiar to HL7) of a local software company. I don't like to use a new connector for this syntax. What happens when the parsing is is executed, the result is false and I ignore the result and return true, so the file can be transfered. Is this approach too simple?

      Peter

      Comment


      • #4
        Re: use of Mirth for simple file transfer

        ¿And what kind of destination are you thinkink of?

        The problem is not the conector, but the internal processing. Now, Mirth support only XML (xml based on HL7 V2 or V3 schemas, or schema-free). With a plain text file, you don't have any XML...

        Perhaps, you could create an XML with the conten of the file, and in the destination use only the content.

        Comment


        • #5
          Re: use of Mirth for simple file transfer

          Because the source and destination is a file, do you think that is is possible to embed the original file in an XML file, transfer it and the writer extracts the content again in another file? Could this be done by Mirth? I want to use Mirth because I will migrate to HL7 (and Mirth) in the future.

          Thanks
          Peter

          Comment


          • #6
            Re: use of Mirth for simple file transfer

            Peter,

            You can read in the data from any connector and just in the pre-processor do:

            return "<message><data>" + message + "</data><message>";

            This converts the incoming data to XML and let&#039;s Mirth process it. In your transformer you can access your incoming message with:
            msg[&#039;data&#039;]

            -Chris
            Chris Lang

            Comment


            • #7
              Re: use of Mirth for simple file transfer

              Thank you for all the quick responses and the helpfull instruction.

              Peter

              Comment


              • #8
                Re:use of Mirth for simple file transfer

                I'd like to use the XML approach because I can't be guaranteed that the incoming XML is in a valid format. (I can call some Java to fix the message format, though.)

                When I first attempted this approach in my preprocessing script...

                Code:
                message = "<message><data>" + message + "</data></message>";
                return message;
                ...I received this error:

                [Fatal Error] :1:24: The entity name must immediately follow the '&' in the entity reference.
                because there happens to be an "&" in the message I passed in.

                So, I wrapped it in CDATA like this...
                Code:
                message = "<message><data><![CDATA[" + message + "]]></data></message>";
                return message;
                ... and got this:

                ERROR 2007-05-01 12:31:04,018 [e7eecabb-918b-4c0c-98fc-d9c40779573b_source_connector._fileEndpoint#-1829376643.receiver.1] com.webreach.mirth.server.mule.providers.file.File MessageReceiver: Unable to route. Stopping Connector: 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=file:///home/jkeller/mirth/vax_listener_xml/in, transformer=Transformer{name='ByteArrayToString', returnClass=false, returnClass=false, sourceTypes=[class [B, class java.lang.String]}, name='_fileEndpoint#-1829376643', 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: [B
                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:492)
                at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
                at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
                at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:186)
                at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:114)
                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(Thread.java:619)
                Caused by: org.mule.umo.transformer.TransformerException: null (java.lang.NullPointerException) (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.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 more
                Caused by: org.mule.umo.transformer.TransformerException: null (java.lang.NullPointerException)
                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)
                ... 17 more
                Caused by: java.lang.NullPointerException
                at ca.uhn.hl7v2.parser.XMLParser.supportsEncoding(XML Parser.java:137)
                at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:139)
                at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:147)
                at com.webreach.mirth.model.converters.ER7Serializer. fromXML(ER7Serializer.java:51)
                at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateTransformerScript(JavaScri ptTransformer.java:340)
                ... 18 more
                Apparently, the XMLParser class expects HL7 XML, not just ordinary XML. Any thoughts about how to get around this?

                Comment


                • #9
                  Re:use of Mirth for simple file transfer

                  Are you using Mirth 1.4.0?

                  If so, change your channel type to XML. You will need to also go into each transformer and filter and on both the incoming data and outgoing data tabs, change the type to XML (where it is not greyed out).
                  Chris Lang

                  Comment


                  • #10
                    Re:use of Mirth for simple file transfer

                    It was the outgoing tabs that weren't set correctly. Thank you.

                    Comment


                    • #11
                      Re: use of Mirth for simple file transfer

                      Where exactly is the preprocessor to be found ?

                      Comment


                      • #12
                        Re: use of Mirth for simple file transfer

                        This is just a guess (since I really haven't used 1.6 much yet), but in 1.6, you probably want to go to the "Scripts" tab and select "Preprocessor" for the script.

                        Comment

                        Working...
                        X