Hi,
I have a channel where I am trying to filter the messages to two different destinations based on the value of MSH.5.1
MSH.5.1 is basically going to contain any amount of two-digit character codes that represent an outside system.
example of what MSH.5.1 can contain:
- |RW|
- |RW~SL|
- |SL~TT~RW~RR|
These two character codes can essentially appear in any order within the MSH.5.1. Is there an easy way to create a Filter rule where I can search MSH.5.1 for any of the two character codes to see if they exist?
Currently, for test, I have two destinations setup each with their own filter:
- Dest #1
- Rule Builder
- Accept
- Field: /^RW.*/.test(msg.MSH['MSH.5']['MSH.5.1'])
- Value: true
- Dest #2
- Rule Builder
- Accept
- Field: /^SL.*/.test(msg.MSH['MSH.5']['MSH.5.1'])
- Value: true
It looks like only the 'RW' filter is working, but I think its because my filter is looking for characters only at the beginning/end of the string within the segment and not seeing if they just exist anywhere in the segment. Would anyone know how to fix this?
Ultimately, I hope to be able to just keep adding filters/destinations that search for any two character combo within MSH.5.1, no matter where the combo occurs.
I have a channel where I am trying to filter the messages to two different destinations based on the value of MSH.5.1
MSH.5.1 is basically going to contain any amount of two-digit character codes that represent an outside system.
example of what MSH.5.1 can contain:
- |RW|
- |RW~SL|
- |SL~TT~RW~RR|
These two character codes can essentially appear in any order within the MSH.5.1. Is there an easy way to create a Filter rule where I can search MSH.5.1 for any of the two character codes to see if they exist?
Currently, for test, I have two destinations setup each with their own filter:
- Dest #1
- Rule Builder
- Accept
- Field: /^RW.*/.test(msg.MSH['MSH.5']['MSH.5.1'])
- Value: true
- Dest #2
- Rule Builder
- Accept
- Field: /^SL.*/.test(msg.MSH['MSH.5']['MSH.5.1'])
- Value: true
It looks like only the 'RW' filter is working, but I think its because my filter is looking for characters only at the beginning/end of the string within the segment and not seeing if they just exist anywhere in the segment. Would anyone know how to fix this?
Ultimately, I hope to be able to just keep adding filters/destinations that search for any two character combo within MSH.5.1, no matter where the combo occurs.
Filter by values contained within a segment
0 commentaires:
Enregistrer un commentaire