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

How to access to the database fields

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

  • How to access to the database fields

    Hi to all!

    Maybe it is a silly question, but I'm going crazy.

    I've created a channel that reads from a database and writes to a text file.
    The problem is that I don't know how to access to the fields that i want.

    when I put ${message.encodedData} in the template i get all the result of the query in xml format.

    But I only want to put the patient name in the text file. How can I access the fields, I've tried to put msg['patient'], but it didn't work.

    Thank you!

  • #2
    Re:How to access to the database fields

    Under Destinations, Edit Transformer.

    Map the incoming field (connector map) you want to print to the text file, say NAME maps to msg['PID']['PID.5']['PID.5.1'].toString() or some such.

    Exit Back to Channels.

    You should now have the variable available under "DESTINATIONS MAPPINGS".

    Comment


    • #3
      Re:How to access to the database fields

      Thank you very much Jhon, I didn't see the edit transformer button. ;-)

      Comment


      • #4
        Re:How to access to the database fields

        hey,
        hope you are using mirth 1.4.0/1.5.0/1.6.0/1.6.1. here you specify the SELECT query in the source tab. The variable will be shown in the variable windows of the same page. you have edit transformer in source tab, there you need to map this variable (query variable) to one userdefined variable (preferrebly channel map). go to destination --> edit transformer and then paste a sample HL7 template in the Outgoing tab. create new transform (message builder) and then map the corresponding field to the variable described in the source. and make sure in the template its message.encodedData.
        its easy and simple.

        Comment

        Working...
        X