Mirth 数据库 Reader 无法处理从通道中的数据库检索到的行(索引超出范围)?

Mirth Database Reader failed to process row retrieved from the database in channel (index out of range)?

我有一个 Mirth (v3.10) 数据库 Reader 频道源,它使用查询获取一些测试记录(来自 SQL 服务器源)...

select * 
  from [mydb].[dbo].[lab_test_MIRTHTEST_001]
  where orc_2_1_placer_order_number 
  in (
  'testid_001', 'testid_002', 'testid_003'
  )

即使通道似乎正常运行并且消息正在写入通道目标,我在部署通道时在仪表板的服务器日志中看到 SQL 错误:

[2020-12-16 08:16:28,266]  ERROR  (com.mirth.connect.connectors.jdbc.DatabaseReceiver:268): Failed to process row retrieved from the database in channel "MSSQL2SFTP_TEST"
com.mirth.connect.connectors.jdbc.DatabaseReceiverException: com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range.
    at com.mirth.connect.connectors.jdbc.DatabaseReceiverQuery.runPostProcess(DatabaseReceiverQuery.java:233)
    at com.mirth.connect.connectors.jdbc.DatabaseReceiver.processRecord(DatabaseReceiver.java:260)
    ...

我可以 运行 在 SQL Server Mgmt Studio 本身中正常查询(并且消息似乎传输正常),所以不确定为什么会弹出此错误,但我很担心是我在这里缺少的东西。

有经验的人知道这是怎么回事吗?如何解决?

请分享您用来处理结果集中数据的代码。同时,您可以将下面的代码视为起点。您可以将其放置在频道源连接器的 Javascript 转换器步骤中。

//Declaring variables to hold column values returned from the result set
var variable1;
var variable2;

//defining the sql read command
var  Query = "select * from [mydb].[dbo].[lab_test_MIRTHTEST_001]";
Query += " where orc_2_1_placer_order_number in";
Query += " ('testid_001', 'testid_002', 'testid_003')";

var result = dbconn.executeCachedQuery(Query);  
//where dbconn is your database connection string

//looping through the results
while(result.next())
{
    
variable1=result.getString("variable1");
variable2 = result.getString("variable2");
    
}

//optionally place the returned values in a channel map for use later
$c('variable1',variable1);
$c('variable2',variable2);

问题似乎出在数据库 Reader 的 post-process SQL 部分,因此消息似乎有效是有道理的。

您是否打算启用源选项卡底部的 post-process 部分?