Announcement

Collapse
No announcement yet.

Calling external bash script

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

  • Calling external bash script

    Hi all!

    I'm working in a channel that would ask a online PACS for availability of a certain study (triggered by an HTTP-published worklist), and then, if needed, it'd lauch a DICOM C-Move for the remote PACS to send it to mine.

    As far as I know, DICOM QR is not implemented within Mirth, so I did my external bash scripts to do this.

    Now I'm looking for the best way of calling this scripts and parsing the results within my Mirth Channel. I cannot find a way of doing this.

    Any help?

    Many thanks in advance,

    -David

  • #2
    Maybe by using a simple PHP script ...
    Best Regards

    Antaris

    Comment


    • #3
      Thanks Antaris !

      how would I call a php script within a Transformer? I was only able to find Javascript scripting sections and I cannot figure out how to call a php script ...

      Many thanks !

      Comment


      • #4
        You can only execute JavaScript, or call out to a Java class in the filters/transformers. This means that you'll either have to rewrite your PHP scripts in Java/JavaScript, or you can host your PHP scripts on a server and call out to them from your transformer using the HttpClient.
        Gerald Bortis | Chief Information Officer | Mirth Corporation

        Comment


        • #5
          Hi all!

          I found a solution. I hope this helps others:

          Calling an system command

          Code:
          var command = "touch /tmp/foo";
          java.lang.Runtime.getRuntime().exec(command);
          In order not to have Mirth waiting for the command to exit, I call the command with nohup and &:

          Code:
          var command = "nohup touch /tmp/foo &";
          Last edited by dgilperez; 05-07-2009, 02:06 AM.

          Comment


          • #6
            Originally posted by dgilperez View Post
            Hi all!

            I found a solution. I hope this helps others:

            Calling an system command

            Code:
            var command = "touch /tmp/foo";
            java.lang.Runtime.getRuntime().exec(command);
            In order not to have Mirth waiting for the command to exit, I call the command with nohup and &:

            Code:
            var command = "nohup touch /tmp/foo &";
            That will work, but you should be aware about the cross-platform limitations of using runtime exec commands.
            Jacob Brauer
            Director, Software Development
            NextGen Healthcare

            sigpic

            Comment


            • #7
              I desperately need to call an external script after each execution of the channel.
              Where would I enter the commands mentioned on this thread?
              I am hoping somebody can help me.
              You would think that a program as mind-bogglingly useful and well thought out as Mirth Connect would include the ability to fire a script on transformer completion.
              Last edited by stormcel; 04-01-2010, 08:53 AM. Reason: mistake

              Comment


              • #8
                You can call the script at the post-processor

                Comment


                • #9
                  thank you, thank you thankyou!!!!!
                  That was it, it's working!!!! WOW this program is GREAT! I'm going to use it for EVERYTHING!!!
                  Thanks albertosaez the Mirth Guru.

                  Just an update, the testscript I used to test this functionality worked perfectly, but when I pointed to the 'compex' script that I needed to run, it failed every time. It turned out that WITHIN THE BASH SCRIPT IT WAS NECESSARY TO USE ONLY ABSOLUTE PATHS. That was it, now it's perfect.
                  Thanks again.
                  Last edited by stormcel; 04-01-2010, 02:23 PM.

                  Comment

                  Working...
                  X