Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Conditional Output based on Time - Mirth 1.7.1

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

  • Conditional Output based on Time - Mirth 1.7.1

    I am working on a pager alert system that receives messages and sends a page. I am now down to sending the page only within particular hours.

    Example: Send pages (via email) from 0600 to 2100 to cell phones, otherwise send an email to another address.

    I know I need to do something in JavaScript, but I am not sure where to place my code.

    Thanks...

  • #2
    Re:Conditional Output based on Time - Mirth 1.7.1

    I think some javascript in a filter is the way to go.

    The filter will check the time, and if its out of range then return false. The channel will filter the message and not run.
    Jon Bartels

    Zen is hiring!!!!
    http://consultzen.com/careers/
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.

    Comment


    • #3
      Re:Conditional Output based on Time - Mirth 1.7.1

      Jon is correct, you will want to do this through filters. The best way to do this would be to create a variable in your source transformer which checks the date and sets a flag "sendEmail" (or something similar) to true if the date is not within the specified range. Then, in each of your destinations, you can use this variable to right a filter that would allow the message to be sent (either as an email, or a pager) if the variable is true. So, in the filter for the pager destination, you would have:

      Code:
      if (sendEmail == "false"«»)
        return true
      else
        return false
      And in your email destination, you would have:

      Code:
      if (sendEmail == "true"«»)
        return true
      else
        return false
      Again, making sure that you set the "sendEmail" variable to either "true" or "false" in your transformer using your logic to determine the valid date range. Hope this helps.
      Gerald Bortis | Chief Information Officer | Mirth Corporation

      Comment

      Working...
      X