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

Trouble with code for replacing value in MSH

  • Filter
  • Time
  • Show
Clear All
new posts

  • Trouble with code for replacing value in MSH

    I hate to admit it, but I surrender. I must be missing something simple in the formatting of this javascript code to change a value in an MSH header. I looked around and found this code from late last year in the forums:
    var obr21 = msg['OBR']['OBR.2']['OBR.2.1'].toString(); //assign the obr21 value to a variable
    obr21 = obr21.replace("-0","-2"«»); //perform replacement on variable
    msg['OBR']['OBR.2']['OBR.2.1'] = obr21; //place the new value back into the message
    I tried duplicating that - as it looked like it would work. However, the messages fly right through the channel without the slightest change in MSH3.

    "MY" CODE:
    var msh3 = msg['MSH']['MSH.3']['MSH.3.1'].toString();
    Please tell me what I am missing, I beg of you.

  • #2
    Re:Trouble with code for replacing value in MSH

    Hey, Chris L helped me figure this out (working with a project with the company)

    if (msg['MSH']['MSH.3']['MSH.3.1'].toString() == "oldValue"){
    msg['MSH']['MSH.3']['MSH.3.1'] = "newValue";

    Also, I had the Destination template stating ${message.rawData} and changed that to ${message.encodedData}.