Xlate Help

  • Creator
    Topic
  • #52726
    Alka Sharma
    Participant

      Hi,

      I have an allergy message which I would like to split and create two messages and ultimately send the allergy fields and its reactions to SQL Server. I know how to insert the fields in SQL. I am having trouble splitting the message in two via tcl or xlate. Any help is greately appreciated. In xlate I have a iteration on the group and then on each segment.

      Incoming Message:

      MSH|^~@|DAMALLGY|HFT|||201109281209||ADT^A60|CHPFDA01||2.3|||||||

      ZSH|PHM~ADT|IDX-INFO

      PID|||8904355^^^HFT^PN~T90000079^^^HFT^MR~38206^^^HFT^PI||TESTPHYS^NINETEEN^^^^^L||19780909|F||W|X^””^UNIVERSITY OF CT HEALTH CTR^CT^06030|||||U|UNK|8904355|||||||||||||

      PV1|0001|I|SURG^7031^A|R|||4075^DOCTOR CONVERSION|||GPE||||RP||N|4075^DOCTOR CONVERSION|I|000000021092|S|||||||||||||||||||SURG|||||201109281209|||||||||

      PV2||||||||||||||||||||0||||IA|||||||||||||

      IAM||DA|00001085^carbidopa^99ING|||X|||||||||||C^ACTIVE|TRMD09^DOCTOR09^TRAINING^^^^^^H0FT||201107060906|||||||00006358^Sinemet^99DRG

      IAR|^Anaphylaxis|SV|AL|

      IAR|^Hives|MI|AD|5

      IAR|^Eye Irritation|U|SE|

      IAR|^Chills||AL|

      IAM||DA|00001639^levodopa^99ING|||X|||||||||||C^ACTIVE|TRMD09^DOCTOR09^TRAINING^^^^^^H0FT||201107060906|||||||00006358^Sinemet^99DRG

      IAR|^Anaphylaxis|SV|AL|

      IAR|^Hives|MI|AD|5

      IAR|^Eye Irritation|U|SE|

      IAR|^Chills||AL|

      Desired Outcome:

      MSH|^~@|DAMALLGY|HFT|||201109281209||ADT^A60|CHPFDA01||2.3|||||||

      ZSH|PHM~ADT|IDX-INFO

      PID|||8904355^^^HFT^PN~T90000079^^^HFT^MR~38206^^^HFT^PI||TESTPHYS^NINETEEN^^^^^L||19780909|F||W|X^””^UNIVERSITY OF CT HEALTH CTR^CT^06030|||||U|UNK|8904355|||||||||||||

      PV1|0001|I|SURG^7031^A|R|||4075^DOCTOR CONVERSION|||GPE||||RP||N|4075^DOCTOR CONVERSION|I|000000021092|S|||||||||||||||||||SURG|||||201109281209|||||||||

      PV2||||||||||||||||||||0||||IA|||||||||||||

      IAM||DA|00001085^carbidopa^99ING|||X|||||||||||C^ACTIVE|TRMD09^DOCTOR09^TRAINING^^^^^^H0FT||201107060906|||||||00006358^Sinemet^99DRG

      IAR|^Anaphylaxis|SV|AL|

      IAR|^Hives|MI|AD|5

      IAR|^Eye Irritation|U|SE|

      IAR|^Chills||AL|

      MSH|^~@|DAMALLGY|HFT|||201109281209||ADT^A60|CHPFDA01||2.3|||||||

      ZSH|PHM~ADT|IDX-INFO

      PID|||8904355^^^HFT^PN~T90000079^^^HFT^MR~38206^^^HFT^PI||TESTPHYS^NINETEEN^^^^^L||19780909|F||W|X^””^UNIVERSITY OF CT HEALTH CTR^CT^06030|||||U|UNK|8904355|||||||||||||

      PV1|0001|I|SURG^7031^A|R|||4075^DOCTOR CONVERSION|||GPE||||RP||N|4075^DOCTOR CONVERSION|I|000000021092|S|||||||||||||||||||SURG|||||201109281209|||||||||

      PV2||||||||||||||||||||0||||IA|||||||||||||

      IAM||DA|00001639^levodopa^99ING|||X|||||||||||C^ACTIVE|TRMD09^DOCTOR09^TRAINING^^^^^^H0FT||201107060906|||||||00006358^Sinemet^99DRG

      IAR|^Anaphylaxis|SV|AL|

      IAR|^Hives|MI|AD|5

      IAR|^Eye Irritation|U|SE|

      IAR|^Chills||AL|

    Viewing 1 reply thread
    • Author
      Replies
      • #75300
        Jim Kosloskey
        Participant

          Alka,

          In your Xlate:

          Place a SUPPRESS at the beginning.

          Copy your MSH, PID, PV1, and PV2 segments to the outbound (using PATHCOPY or individual COPYs, or a mix – NOT BULKCOPY).

          ITERATE over your IAM group.

          Inside your IAM group handling take care of the IAM segment and the repetitions of the IAR segments.

          After your ITERATE for the IAR segments inside the IAM group issue a CONTINUE Action (don’t use SEND unless you have to bypass post Xlate processing – normally you do not).

          If you have questions about the SUPPRESS or the CONTINUE vs SEND or about the particulars of the above email me and we will chat off line.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #75301
          David Barr
          Participant

            If you do it in TCL, you get one message handle coming in. You just do a msgcopy for each extra message that you want going out to create the extra message handles. Then you do a msgset on each of the message handles with the data that you want in those messages.

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.