Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8635511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:59:30+00:00 2026-06-12T09:59:30+00:00

I have Source Connector Type as ‘File Reader’ which is reading HL7 files and

  • 0

I have Source Connector Type as ‘File Reader’ which is reading HL7 files and Destination Connector Type as ‘Database Writer’.
My database table has two columns

  1. Participant_Information
  2. SPR_Information

I want to transform a single HL7 file into two XML files one for Participant_Information column and other for SPR_Information column and need to insert both as a single record into the database table.

I’m able to insert one XML at a time but not able to find the way to insert both the XMLs as a single record into the database table.

Any help is really greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:59:31+00:00Added an answer on June 12, 2026 at 9:59 am

    I’m basing this answer on both the question, and your response to me in the comments.

    Please be aware that on my end, I am referencing version 1.8.2 of Mirth. If you are using something more recent, while I am confident that the techniques described here will still be valid, the user interface might deviate from my directions.

    I present here two techniques for solving this problem. While I would personally lean towards Technique 1, if you are less confortable with Javascript and E4X, then Technique 2 will likely be preferential.

    Technique 1.

    Use a Javascript transformer instead of a Message Builder.
    The challenge with using a message builder is that it takes the input message, and transforms it into a single output message. Javascript give you more power, but only if you know the langauge.

    a.

    Use a single Javascript transformer to make two copies of the message. Transform each variable as needed using Javascript E4X notation, and then store them both in the channelMap.

    // init local message variables
    var messageParticipant= msg;
    var messageSPR= msg.copy();
    
    // messageParticipant transformations using E4X notation: example
    messageParticipant['PID']['PID.5']['PID.5.1'][0] = 'Blah';
    
    
    // messageSPR transformations using E4X notation: example
    messageSPR['PID']['PID.5']['PID.5.1'][0] = 'Hey There';
    
    
    // stick messages in channel map so they can be accessed in your SQL script
    channelMap.put('messageParticipant', messageParticipant);
    channelMap.put('messageSPR',messageSPR);
    

    b.

    Reference the two channelMap variables in your SQL code.

    INSERT INTO report_queue (PARTICIPANT_IDENTIFICATION, SPR_Information)
    VALUES (${'messageParticipant'}, ${'messageSPR'})
    

    Technique 2.

    If you are less comfortable with using Javascript for your transformations, you might find this technique a bit easier – though, I find it a bit trickier to explain.

    Basically, you will have three destinations, and you will force them to execute in sequence. The first destination builds the XML for the PARTICIPANT_IDENTIFICATION, and the second destination builds the XML for the SPR_Information. The first two destinations don’t actually send the messages anywhere other than the channelMap. The third destination utilizes the results of the first two, and runs the SQL code.

    a.

    On the summary tab, ensure that “Synchronize channel” is checked. This will force the three destinations to execute in sequence.

    b.

    On the destinations tab, in addition to the existing Database Writer, create two Javascript writers. Organize the three destinations to appear in this order:

    Destination           Connector Type
    ---------------------------------------
    Build Participant     JavaScript Writer
    Build SPR             JavaScript Writer
    SQL                   Database Writer
    

    c.

    Select destination “Build Participant,” and in the Javascript text area, enter the following:

    channelMap.put('messageParticipant', messageObject.getTransformedData());
    

    d.

    Select destination “Build SPR,” and in the Javascript text area, enter the following:

     channelMap.put('messageSPR', messageObject.getTransformedData());
    

    e.

    In the Sql destination, use the same SQL code as in Technique 1.

    INSERT INTO report_queue (PARTICIPANT_IDENTIFICATION, SPR_Information)
    VALUES (${'messageParticipant'}, ${'messageSPR'})
    

    f.

    For each of the two Javascript destinations:
    i. Click “Edit Transformer”
    ii. Click the tab “Message Templates
    iii. In the section “Outbound Message Template,” ensure that the datatype is set to XML.
    iv. Add all the transformer steps you require, and feel free to use type Message Builder. (in destination Build Participant, you will add transformer steps applicable to the Participant XML. Likewise for destination Build SPR).

    g.

    The SQL Destination should not have any transformers. If it does, they won’t have any effect on the output.

    Good Luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a source XML file that is used to create C# files that
I have the MySQL Connector/NET installed on my PC. I modified the source code
I have a source file, openpage.pl, where I call use_module/1 to import SWI-Prolog's http_open/3:
I have three source files in a folder. I simply want to compile them
I have a source directory that includes a mix of different languages and files.
I have one source directory in which I am trying to create separate cod
I am using Connector/J 5.1.10 as the JDBC driver for my Database application (which
I have a XML file which holds configuration data for data sources, and the
I have a database which consists of a graph. The table I need to
I have a connector which has two ports. Two ports have a common root

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.