NextGen (Mirth) Connect 3.10.0 Released!

NextGen (Mirth) Connect 3.10.0 is now available as an appliance update and on our GitHub page. This release includes better SQL Server database support, security improvements through fixes and library updates, and improvements for the Advanced Clustering plugin with a focus on improving performance of many of the tasks that are carried out on a frequent interval. 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

create repeating segments

  • Filter
  • Time
  • Show
Clear All
new posts

  • create repeating segments

    (when pulling data from database to hl7)
    Is there a way to create repeating segments like NK1 in the mirth?

  • #2
    Re:create repeating segments

    Can someone post a sample channel that has repeating segments in transformer?
    xml-> hl7
    hl7-> xml
    If we can download from file repository, that will be great.


    • #3
      Re:create repeating segments

      I don't have any examples, but I'll attempt to help as much as I can. I have some JS and JAVA experience but it's been about 5+ years since I've actually used it. So, it's the blind leading the blind.

      I'm still waiting for some assistance on my latest topic and as soon as I get my issues resolved, I'll be doing something similar to what you're asking for. So why shouldn't I just start now eh?

      1. I need to know what type of database you are running.
      2. Table structure and possible data.
      3. Any and all other information that will help.



      • #4
        Re:create repeating segments

        For NK1 segments for instance just use:
        msg['NK1'][no of segment]

        If you read messages
        you could iterate through them with:
        for (nk1 in msg['NK1'])
        then you can access the lastnames with
        msg['NK1'][nk1]['NK1.2']['XPN.1']['FN.1'].toString(); for instance

        Don't forget to check handle repetitions in incoming messages options

        Post edited by: Bleupomme, at: 06/27/2007 05:29


        • #5
          Re:create repeating segments

          Thank you for respond, Austin.
          Thank you for respond, Bleupomme.
          I do not have experience on javascript, but I am trying my best.
          1. I am testing with microsoft sql
          2. For this hl7-> xml channel, I use FILE READER as source in the channel and created a table with couple string fields in the sql server as destination:
          (This is the file I am reading from)
          MSH|^~&|REGADT|MCM|IFENG||199112311501||ADT^A08|00 0001|P|2.4|||
          PID|||191919^^^GENHOS^MR~333-33-8888^^^USSSA^SS|253763|WANG^SCOOBY^J||19880808|M|| |171 SCOOBY DR^^CARY^MI^58888^""^||(900)888-9999|(900)888-9999||S^^NC70002|C^^NC70006|10199925^^^GENHOS^AN|3 33-66-6666||
          NK1|1|MASSIE^ELLEN|SPOUSE^^NC55333|171 ZOO^^CARY^MI^58888^""^|(900)888-9999|(900)555-1234~(900)555-1200|EC1^FIRST EMERGENCY CONTACT^^NC70018
          NK1|2|MASSIE^LASTNAME|MOTHER^^NC55333|300 ZOO^^CARY^MI^58888^""^|(900)888-9999|(900)555-1234~(900)555-1200|EC2^SECOND EMERGENCY CONTACT^^NC70018
          NK1|4|||123 TEST WAY^^CARY^MI^58888^""^||(900)555-1200|EM^EMPLOYER^NC70018|19880606||PROGRAMMER|||AA A SOFTWARE COMPANY
          PV1||O|O/R||||0148^ADDISON,JAMES|0148^ADDISON,JAMES||AMB||| ||||0148^ADDISON,JAMES|S|1400|A||||||||||||||||||| GENHOS|||||199501101410|
          PV2||||||||199901101400|||||||||||||||||||||||||19 9901101400
          OBX||NM|3141-9^BODY WEIGHT^LN||62|kg|||||F
          GT1|1||WANG^SCOOBY^J^""^""^""^||171 ZOO^^CARY^MI^58888^""^|(900)888-9999|(900)888-9999||||SE^SELF^NC55333|333-66-555||||MOOSES AUTO CLINIC|171 ZOO^^CARY^MI^58888^""|(900)888-9999|
          IN1|0|0^NC70072|BC1|BLUE CROSS|171 ZOO^^CARY^M158888^""^||(900)888-9999|90||||||50 OK|

          3. All I need is how to setup some simple javascript in the transformer to create repeating segments. I'd like to try to use NK1 as testing purpose.

          I created the js in transformer like this, but it did not work:
          msg['NK1']['NK1.1']['NK1.1.1'] = $('nk1');
          msg['NK1']['NK1.2']['NK1.2.1'] = $('nk2');
          msg['NK1']['NK1.3']['NK1.3.1'] = $('nk3');
          for (nk1 in msg['NK1'])

          Post edited by: julia1231, at: 07/02/2007 12:48