Mirth Connect 4.3.0 Released!

Mirth Connect 4.3.0 is now available as an appliance update and on our GitHub page.

This is a major release containing new features like adding new functionality to the Mirth Connect Setup Wizard, adding the ability for resource and channel-specific classloaders to load child-first or parent-first, and added a default implementation of the getObjectsForSwaggerExamples() method in the ServicePlugin class. This release also contains enhancements for the Mirth Connect Administrator Launcher, the Mirth Connect Docker images, and several bug fixes and security improvements.

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

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

how to modify date/time stamp?

  • Filter
  • Time
  • Show
Clear All
new posts

  • how to modify date/time stamp?

    Hi all,

    Using Mirth v1.5, I am trying to insert the current date/time into the MSH 7.1 segment via a JavaScript step in the source channel transformer. Am I headed in the right direction using something like this:

    var dateString = DateUtil.getCurrentDate(pattern);
    tmp['MSH']['MSH.7']['MSH.7.1'] = datestring;

    If so, then what is the format for "pattern" parameter for something like 20070729123955 ?
    Also, do I need a localMap.put statement at the end? Is it valid in v1.5?


  • #2
    Re:how to modify date/time stamp?


    You are indeed going down the right direction. You can use the date format from here:

    Try this:

    tmp['MSH']['MSH.7']['MSH.7.1'] = DateUtil.getCurrentDate("YYYYMMddhhmmss"«»);
    That would give you something like 20070729103045 for a date.

    You do not need to put anything in the localMap - it is not valid in 1.5 either (localMap is now channelMap)

    Chris Lang


    • #3
      Re:how to modify date/time stamp?


      Thanks for the prompt reply !

      The JavaScript works fine now, although I had to modify the pattern parameter slightly to get it to not throw an error (this works):

      tmp['MSH']['MSH.7']['MSH.7.1'] = DateUtil.getCurrentDate("yyyyMMddHHmmss");

      Apparently the pattern parameter is case-sensitive and you have to enter the "y" and "M" and "d" exactly as specified in the SimpleDateFormat reference. I forgot about the strict case-sensitive Java rules :unsure:

      thanks again, man.