Locating Words/Patterns in the OBX

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Locating Words/Patterns in the OBX

  • Creator
    Topic
  • #54096
    Jon Melin
    Participant

      Hello,

      I am having an issue locating a specific set of words from within the OBX (using TCL in an XLATE).

      I have an OBX field that contains formatting such as “.brAuthor:     .br .brProcedure .brNEED THIS PART.brConfirmed:   .br”

      I am looking for the “NEED THIS PART” and I have tried a couple things and I can’t get it to locate it. I don’t need to capture the elements, just know that it exists in the message or not. So far I’ve tried (with OBX field as the Source):

      set Value [lsearch -all $xlateInVals “NEED THIS PART”]

      and

      set Value [string first “NEED THIS PART” $xlateInVals] (hoping to return and index and all I get is -1 )

      Any suggestions?

      Thank you in advance.

      Thank you,

      Jon

    Viewing 4 reply threads
    • Author
      Replies
      • #80140
        Jim Kosloskey
        Participant

          Jon,

          Have you tried the IF Action with the ct (Contains) operator?

          Like this

          COPY =NEED THIS PART

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

        • #80141
          Jon Melin
          Participant

            Thank you for the response.

            I tried this just now and it still doesn’t locate the string I’m looking for. I think it has something to do with the formatting br. ?

            Any other suggestions?

            Thank you,

            Jon

          • #80142
            Jim Kosloskey
            Participant

              Jon,

              While I don’t have your data I did test this by simulating your indicated information which would be in the OBX-5 and it worked correctly.

              I included the .br in my test.

              If you email me I can work on this off line with you.

              Jim

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

            • #80143
              Jon Melin
              Participant

                Jim,

                No problem. Here is an example of the data (with subs for data):

                1(0).1(0).1(0).OBX(0).#5(0).[0]  :  > .brPatient:   TEST,PATIENT          MRN: 0000000           FIN: 000000             .brAge:   199 years     Sex:  Female     DOB:  1/1/1000 .brAssociated Diagnoses:   Some Diagnosis .brAuthor:   LastName, Person .br .brProcedure .brNeed This line .brConfirmed: Yes. <

                I need to know if “Need This line” exists in the OBX5

                The copys in the IF ELSE are just echos to see if it found it or not, right now.

                Attached is a screenshot of my XLATE

                Thank you,

                Jon

              • #80144
                Jim Kosloskey
                Participant

                  Jon,

                  OK I cobbled up a OBX-5 to look more like what you have and the IF worked fine.

                  Again this can be mre effective if we work directly.

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

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