The best way to do this is before the message is translated, because translation takes a lot of resource (compared to the rest of the flow). So best is to do this in routing, in Pre Procs with a tcl-proc.
I normally use the gc_filterHL7msgUsingFieldValue for this; not sure if this is a standard proc for everyone. With this proc you can kill/continue messages based on (regexp) values of a specified (sub)field. In your case the parameters for this proc would be:
if your filtering criteria is simple (one field / non-iterating), the incoming procedure is where you’d want to define it.
Using the generic proc to handle arguments is a modular method to be used for any thread’s filtering. Attached is generic proc that can use a list, range or even a lookup table. Put the generic proc in your master site so it is 1) central and 2) there is no other derivative in your environment.
Call the procedure in the route pre proc, then supply the arguments (below)
List space-delimited
{FILTERLIST {HMSHRPBH LECH}} {DISP KILL} {SEG PV1} {FLD 3} {CMP 3} {COMMENT {Remove facilities based on facility in PV1.3.4}}