Fragmento de código de como realizar consultas a base de datos desde un canal del Mirth.
var dbUri = "jdbc:jtds:sqlserver://127.0.0.1:1433/"; var sqldb_name = "mmslogkms"; var sqldb_user = "sa"; var sqldb_password = "Admin123"; var sqldb_instance=";INSTANCE=SQLEXPRESS"; var resultQuery = "SELECT * FROM PRODUCTO WHERE cod_producto='"+$('id_producto')+"'"; //var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sql server://localhost:1433/mirthdb;INSTANCE=SQLEXPRESS;instance=SQLEXPRESS','sa','Admin123'); var dbConn = DatabaseConnectionFactory.createDatabaseConnection ("net.sourceforge.jtds.jdbc.Driver", dbUri + sqldb_name+sqldb_instance, sqldb_user, sqldb_password); var result = dbConn.executeCachedQuery(resultQuery); dbConn.close(); if (result.next()) { var visitID=result.getString(3); globalChannelMap.put('response', visitID); }