Appending data to the value in a field ?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Appending data to the value in a field ?

  • Creator
    Topic
  • #48689
    Ariba Jones
    Participant

      I need to append two characters to the end of a value in a field.  Is this something that I can do within an xlate?  Does anyone know how to do this?  For example, the value in the field may be 12;GRANDCHILD.  I need it to go to the receiving system as 12IN;GRANDCHILD.  “IN” is the two-character string I need to append to the end of the numeric value in this field.  

      Thanks in advance,

      Ariba

    Viewing 7 reply threads
    • Author
      Replies
      • #59395
        garry r fisher
        Participant

          Hi,

          You could do it in Tcl in a number of ways using msgset or dat’s and grm’s. What is the message type – HL7?

          Garry

        • #59396
          Jim Kosloskey
          Participant

            Ariba,

            Have you tried the CONCAT Action in Xlate?

            Jim Kosloskey

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

          • #59397
            Ariba Jones
            Participant

              Garry this is an HL7 message.

              Thanks,

              Ariba

            • #59398
              Ariba Jones
              Participant

                Jim,

                I did not try the CONCAT in the xlate.  I will look into that.

                Thanks,

                Ariba

              • #59399
                Anonymous
                Participant

                  I think this may be what you are trying to do.  Simply use this as a tcl fragment inside the xlate:

                  set varlist [split $xlateInVals “;’]

                  set element1 [concat [lindex $varlist 0]IN]

                  set varlist [lreplace $varlist 0 0 $element1]

                  set xlateOutVals [join $varlist “;”]

                  I’m sure there may be a simpler way to do this, but this should be able to get you started.

                  Thomas G. Rioux

                • #59400
                  Jim Kosloskey
                  Participant

                    Ariba,

                    I guess I should have asked rather than assumed.

                    Is the ; a separator in the message (component separator perhaps)?

                    If it is CONCAT Action in Xlate will definitely work.

                    If it is not a separator, then you will need Tcl.

                    Let me know if you think you need Tcl.

                    Jim Kosloskey

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

                  • #59401
                    Ariba Jones
                    Participant

                      Jim,

                      Yes, the ; is a separator (component) in the message.  When Star sends out the HL7 message it uses colons and semicolons.  On the engine, those are changed to pipes and carets.  This was an example of the way the field looks coming from Star.

                      Thanks,

                      Ariba

                    • #59402
                      Jim Kosloskey
                      Participant

                        Ariba,

                        OK – then CONCAT will do the trick.

                        Jim Kosloskey

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

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