Announcement

Collapse
No announcement yet.

create repeating segments

Collapse
X
 
  • 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.
    thanks,
    Julia

    Comment


    • #3
      Re:create repeating segments

      Julia,
      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?

      Questions/Info:
      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.

      Austin

      Comment


      • #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

        P.S.:
        Don't forget to check handle repetitions in incoming messages options

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

        Comment


        • #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|||
          EVN|A08|199901101500|199901101400|01||199901101410
          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|3
          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
          ROL||AD|CP^^NC70008|0148^ADDISON,JAMES
          OBX||NM|3141-9^BODY WEIGHT^LN||62|kg|||||F
          OBX||NM|3137-7^HEIGHT^LN||190|cm|||||F
          DG1|1|19||0815^BIOPSY^ACODE||00|
          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'])
          msg['NK1'][nk1]['NK1.2']['XPN.1']['FN.1'].toString();

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

          Comment

          Working...
          X