Mirth Connect 4.2.0 Released!

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

This is a major release containing new features like streamlining the process of selecting a listener port, adding the usernames to the overwriting channel changes warning message, adding additional, sortable columns to the Events screen, and being able to select multiple messages when sending messages through a channel. We also added new message integrity features like adding new JavaScript utility methods for hashing channel messages and automatically hashing outgoing messages. This release also contains enhancements for the Mirth Connect Administrator Launcher and several bug fixes, security improvements, and updates to the 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

Stripping / adding characters

  • Filter
  • Time
  • Show
Clear All
new posts

  • Stripping / adding characters

    Due to a field length issue, I am needing to strip characters from a field (obr.2.1) from messages coming out of a meditech system. When a message comes back to Meditech, i need to add the characters back in.


    OBR.2.1 comes from meditech looking like: ECHO20070904-0001

    I need to strip the century so OBR.2.1 outbound to GE Centricity looks like this: ECHO070904-0001

    When GE Centricity send back a message, i need to add back in the century so OBR.2.1 looks like it did when meditech first sent the message out.

    I know what i need to do as far as setting up the channels; i am not a programmer and have no code experience

    Any help would be greatly appreciated!


    Arron Ramsey

  • #2
    Re:Stripping / adding characters


    There are a couple of ways to do this. It depends on your set up. I would use this to receive in a javascript mapping...

    var str1 = ([OBR.2.1].substring(0,3)); // e.g. str1= "ECHO"
    var str2 = ([OBR.2.1].substring(6,16)); // e.g. str2= "070904-0001"
    var desired_result = str1.concat(str2);
    return desired_result;

    add a little for sending back...

    var str1 = ([OBR.2.1].substring(0,3)); // e.g. str1= "ECHO"
    var str2 = ([OBR.2.1].substring(4,14)); // e.g. str2= "070904-0001"
    var desired_result = str1.concat("20",str2);
    return desired_result;

    Might want to try it but I know that worked for me a couple versions ago.