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

Translate 1 field, not whole message?

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

  • Translate 1 field, not whole message?

    Is there a way to translate just 1 field without translating the whole message?

    I create a blank outbound template and map segment on just one value (PID.2.1).

    Message Segment: tmp['PID']['PID.2']['PID.2.1']
    Mapping: msg['PID']['PID.2']['PID.2.1']

    And then I build my string replacements.

    When I process my message, PID.2.1 gives me the translated value, but every other field are the values in my template, not my values from the message I'm processing. The only way I've been able to get this to work is to map segment for EVERY segment in the message. Is there an easier way if I'm wanting to just translate 1 value?

    Thanks for any help,
    Matt

  • #2
    Re:Translate 1 field, not whole message?

    Nevermind...
    I deleted my inbound and outbound templates and used a javascript transformer on the field I needed.
    Thanks!

    Comment


    • #3
      Re:Translate 1 field, not whole message?

      Matt,

      Would you mind posting the code you used to do this. I'm new to this and I'm still digesting many of the features. Most of my mapping/transforms are going to be limited to a few specific fields. Basically I want to pass the message along unchanged except for the 2 or 3 fields that need it. I've run into the issue you mention with Templates and I was guessing that they were best suited for building up new messages, instead of acting as a gateway.

      From what I understand from your post, you have no inbound or outbound Template defined and you make all changes via the Javascript?

      Chuck.
      Chuck Citrano

      [url][/http://www.tangible.comurl]

      Comment


      • #4
        Re:Translate 1 field, not whole message?

        Chuck,
        Not sure if you still need this but here's what I used:
        var PID21 = msg['PID']['PID.2']['PID.2.1'].toString();
        PID21=PID21.replace(/-0/g,"");
        PID21=PID21.replace(/-/g,".");
        msg['PID']['PID.2']['PID.2.1']=PID21;

        Thanks,
        Matt

        Comment

        Working...
        X