If you use Managed Alerts, there is a custom FunctionSet function IsRecentManagedAlert() which you can use to suppress repeated alerts.  Here's an excerpt from the documentation:

The rule can check whether the alert is a repeat occurrence of a previous alert that is represented by a currently open managed alert. To do this, the rule uses the Ens.Alerting.Rule.FunctionSet.IsRecentManagedAlert() function. The IsRecentManagedAlert() function tests if there is a recent open managed alert that is from the same component and has the same text as the specified alert. You can optionally specify that the function adds a reoccurs action to the existing managed alert.

http://docs.intersystems.com/ens20161/csp/docbook/DocBook.UI.Page.cls?KE...

To do this in the message viewer, add an extended criteria to your search parameters.  Criterion Type = VDoc Property Path.  Class = EnsLib.HL7.Message.  DocType = Schema:Name of the type of documents you're searching for (e.g. 2.3.1:ADT_A01).  Property Path = the VDoc path of the field you're searching on (e.g. MSH:SendingApplication)

It should be noted that the message viewer will use SQL to get a list of messages based on the 'Basic Criteria' and then it loops over the results applying each of the 'Extended Criteria' as a filter.  This can be very slow.  If it takes more than 2 minutes, the message viewer will time out and either the Basic Criteria needs to be refined in order to return fewer results, or the search for messages must be done with code.

To do this with code, use embedded SQL to search on message headers based on basic criteria and then loop over the results checking VDoc paths.  Here's an example which looks for messages from a particular day that have a particular value in MSH:3, the Sending Application field:

&SQL(DECLARE C1 CURSOR FOR SELECT MessageBodyId INTO :id FROM Ens.MessageHeader WHERE MessageBodyClassName='EnsLib.HL7.Message' AND TimeCreated BETWEEN '2016-07-15' AND '2016-07-16')
&SQL(OPEN C1)
&SQL(FETCH C1)
while (SQLCODE = 0) {
   set msg = ##class(EnsLib.HL7.Message).%OpenId(id)
   if (msg.GetValueAt("MSH:SendingApplication") = "Ensemble") {
      //do something with this message
   }
   &SQL(FETCH C1)
}
&SQL(CLOSE C1)