Use File Reader and database reader on the same Channel #5576
Replies: 2 comments 3 replies
-
Option A:
Option B:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @jonbartels JavaScript Code: var dbConn;
var result;
var entryList = [];
var mapping = '5'
try {
dbConn = DatabaseConnectionFactory.createDatabaseConnection("com.microsoft.sqlserver.jdbc.SQLServerDriver","jdbc:sqlserver://MigrationServer:8002;instanceName=MigrationServer/Production9ecm;databaseName=Novo;integratedSecurity=true;",'sa','o123$');
logger.info(dbconn);
result = dbConn.executeCachedQuery("select FullName from Users where UserName = 'ihaj'");
while (result.next()) {
entryList.push(result(1));
}
mapping = entryList[Math.floor(Math.random()*entryList.length)];
}
catch (e) {
logger.error(e);
mapping = '5';
}
finally {
if (dbConn) {
dbConn.close();
}
}
logger.info(mapping);
channelMap.put('AssignedTo', validate(mapping, '', new Array())); Connection setting: |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I have a Hl7 file is auto generated by an app, I am using file reader to read this hl7 file from mirth channel, I need to change the value of PID.7.1 whereas the value is stored in database. how I can keep reading the hl7 file from mirth and at same time read values from database.
Please advise.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions