Search for &

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Search for &

  • Creator
    Topic
  • #54359
    Mike Campbell
    Participant

      Cloverleaf 6.0.2 on AIX

      So, within the xlate, I’m trying to determine the first occurrence of an ampersand within the OBX-5 field.

      The code is:  set COUNT [ string first & $xlateInVals ]

      Count is always -1 even though I know there is an & in the message.

      Any thoughts?  I was hoping the escape character before the & might have done the trick, but nope.

      Thanks.

      Mike C.

    Viewing 2 reply threads
    • Author
      Replies
      • #81166
        James Cobane
        Participant

          Mike,

          Because the ampersand is an HL7 encoding character, the engine is parsing the data on the ampersand, thus xlateInVals does not contain the ampersand.

        • #81167
          Mike Campbell
          Participant

            Looks like doing an llength on the xlateInVals will do the trick.

            set COUNT [ llength  $xlateInVals ]

            Thanks Jim K. for the hint!

          • #81168
            Troy Morton
            Participant

              For finding and/or removing special characters in a message, I always prefer to use a TPS proc.  This way you have the entire message at your disposal and you don’t have to worry about how Cloverleaf is parsing the HL7 fields.  

              I have written a tps proc before that will allow you to specify characters to remove from an HL7 message as well as which fields to search for the unwanted characters.  This evening, I’ll see if I can find it and post it to this thread.

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