Hi @Timo Lindenschmid ! Thank you for your answer, I've tried disabling that option but it doesn't work:

And the result for the query: 

[SQLCODE: <-230>:<Foreign table query Execute() failed>]

  [%msg: <Foreign Tables - ERROR #8104: Gateway Exception: <GATEWAY> java.sql.SQLSyntaxErrorException com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:112) Remote database reported error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"patient" T1' at line 1>]

In this article @Eduard Lebedyuk creates a production monitor to check the inactivities for the different components

You can modify the following code:

If (tDiff > tTimeout) && ((lastActivityReported="") || ($system.SQL.DATEDIFF("s",lastActivityReported,lastActivity)>0)) {
    Set tText = $$$FormatText("InactivityTimeoutAlert: Inactivity timeout of '%1' seconds exceeded for host '%2'", +$fn(tDiff,,0), tHost)
    Do ..SendAlert(##class(Ens.AlertRequest).%New($LB(tHost, tText)))
    Set $$$EnsJobLocal("LastActivity", tHost) = lastActivity
} 

Replacing the SendAlert by:

If (tDiff > tTimeout) && ((lastActivityReported="") || ($system.SQL.DATEDIFF("s",lastActivityReported,lastActivity)>0)) {
    Set tText = $$$FormatText("InactivityTimeoutAlert: Inactivity timeout of '%1' seconds exceeded for host '%2'", +$fn(tDiff,,0), tHost)
    Set tSC = ##class(Ens.Director).EnableConfigItem(tHost,0) 
    Set tSC = ##class(Ens.Director).EnableConfigItem(tHost,1) 
    Set $$$EnsJobLocal("LastActivity", tHost) = lastActivity
}

Description of assign action from the official documentation: 

Assigns values to properties in the business process execution context.

https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI...

This means that assign only works in the context of a business process, you can't modify the original message received.