need help with either TCL proc or Translation

Clovertech Forums Cloverleaf need help with either TCL proc or Translation

  • Creator
    Topic
  • #122106
    michele
    Participant

      I’ve been asked to make this change in the OBX segment of an HL7 message:

      Change from this   OBX|||||https://ein.changehealthcare.com/viewer/encurl?mrn=M000001140\T\aa=DEFAULT\T\accession=A0000001021\T\os=DEFAULT

      To this                          OBX|||||https://ein.changehealthcare.com/viewer/encurl?mrn=M000001140&aa=DEFAULT&accession=A0000001021&os=DEFAULT

      Where I need to remove the \T\ everywhere in this URL string in segment 5 and substitute an & in that place.

       

      I’m thinking I need a TCL Proc that will split the URL string to the \T\ characters, substitute the & in the 3 places where it needs to be, then concatenate the string back together.    Which is the best way to do this, a TCL proc or Xlate?      Does anyone have an example of a TCL proc or Xlate that shows/explains how to do that?     I’m new to Cloverleaf and TCL so any help would be greatly appreciated!

       

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

          You do not indicate what release of Cloverleaf but if 6.0 or later, check out the Xlate STRING Action Map command I think that should do it without using Tcl. If you are not familiar with the STRING Action, email me and I will send you a packet with a presentation that explains all of the STRING Action Functions; some additional STRING Actions I created; an exercise Xlate for all of the STRING Actions (including the ones I have written/modified); and a test file to use with the Xlate in the Testing tool.

          If you decide to explore the STRING Action Map Function, realize the backslashes (\) are Tcl escape characters and you will need to escape them something like this \\T\\ in your map.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

          • #122108
            Jim Kosloskey
            Participant

              Also understand the & has special meaning as an HL/7 separator so the receiving system (depending on how it parses the message) may treat that as a separator rather than data.

              email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

          • #122109
            Tammy Hale
            Participant

              I used this in my xlate

              set spmap {\\T\\ &}
              set xlateOutVals [string map $spmap $xlateInVals]

          Viewing 1 reply thread
          • You must be logged in to reply to this topic.