Sidebar

How can I remove an OBR segment and all OBX/NTE that follow it if one OBX-5 has a value of "*"?

0 votes
781 views
asked Dec 10, 2015 by michael-h-5027 (14,350 points)

1 Answer

0 votes

You can use a custom mapping that has a removeAllNodes and specifies the group to remove.

 

message.removeAllNodes('OBR[group=!OBR;/OBX-5=*]');

 

OBR[group=!OBR is used to select the the nodes including OBR OBX NTE until the next OBR.

; can be used once within the brackets [ ]  adn is used to add another set of criteria.

/OBX selects any OBX segment after the OBR node.

 

If you have multipe OBR groups then the OBR, OBX, and NTE will be removed of any OBR with OBX-5 = *

answered Dec 10, 2015 by michael-h-5027 (14,350 points)
edited Dec 10, 2015 by gary-t-8719
...