SMAT Compund Conditions Regex Search

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf SMAT Compund Conditions Regex Search

  • Creator
    Topic
  • #54283
    Danny Wheeler
    Participant

    I am tying to search some OBX segments for 2 specific entries in the same segment.  I have figured how to search for individual pieces of data but not how to search for both conditions at the same time.

    I have these expressions that do what I need for viewing if the one field exists.  How do I make them compound so that they both need to exist at the same time in the same segment?

    rOBX(|[^|]*){2}|MyHealthOpOut1^|

    rOBX(|[^|]*){4}|Y|

    Thanks ahead of time!

Viewing 3 reply threads
  • Author
    Replies
    • #80863
      bill bearden
      Participant

      As usual… just tossing something out there. You are looking in OBX.3 for something and in OBX.5 for something?

      How about something like…

      rOBX(|[^|]*){2}|MyHealthOpOut1^(|[^|]*)|Y|

    • #80864
      Danny Wheeler
      Participant

      That seems to match everything.  I’m not really sure how?  This is an iterating segment and the possibilities I am trying to compare against are below.  But this is an example that is in iteration 6 but they could be at any iteration.

      OBX|6|CE|MyHealthOpOut1^^LSFUSERDATAP||N||||||R

      OBX|6|CE|MyHealthOpOut1^^LSFUSERDATAP||Y||||||R

      I need to know when OBX.3.0 is “MyHealthOpOut1” and OBX.5.0 is “Y”.

    • #80865
      David Barr
      Participant

      Are you trying to match a segment or match the entire message? If you’re comparing one segment at a time then you need to at least get rid of the r. Are you calling this from a TCL proc or an xlate?

      Bill’s expression looks correct. If it’s matching more than you expect then maybe you are doing something like putting the expression in quotes rather than curly braces. If you did that then TCL would strip the backslashes and your pattern would match anything. The last | would be translated to |, and a | at the end of the pattern says to match what’s before the pipe or anything else.

    • #80866
      Danny Wheeler
      Participant

      I was doing a search in the SMAT tool.  I only wanted to add messages to the view that contained the below segment.  But it could have been in any iteration so I couldn’t just search for this exact string.

      OBX|6|CE|MyHealthOpOut1^^LSFUSERDATAP||Y||||||R

      I used a program called RegexBuddy and finally worked this out.  It was able to get me what I needed.  Thanks for your help!

      rOBX(|[^|]*){2}|MyHealthOpOut1^^LSFUSERDATAP||Y

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10