FindDuplicateRepeatingFormWithinRange( )

检测同一日期范围内给定项目的重复表单实例中的重复数据。数据由具有所提供搜索关键字的重复项值的表单 ID 标识。规则目标应位于相应的重复部分项上。

对于此函数:

  • 不能使用下拉列表、单选按钮或复选框值作为函数参数或目标。
  • 如果变量设计为保存部分日期,则必须以相同的部分日期格式提供该参数的值。
  • 如果记录在所需日期没有输入数据,则跳过记录进行比较。

前两个参数应始终是日期范围。可以提供其他搜索关键字。

注意:

这是一个聚集函数。如果目标位于重复表单上,则将为每个表单实例运行规则。

语法

FindDuplicateRepeatingFormWithinRange('startDateVariable', 'endDateVariable', 'variable1',...)

参数

注:

允许在规则表达式的其他位置重复使用传递给此函数的变量,但是必须使用单引号将变量添加为参数。
startDateVariable

必需。重复表单上的日期项。

endDateVariable

必需。重复表单上的日期项。

变量

可选。要搜索的附加项目变量。

返回值

如果找到重复值,则返回 true;如果找不到重复值,则返回 false

示例 3-43 检查是否存在同一设置日期范围和症状值内的重复表单实例

// Given 5 repeating form instances with items "onsetStartDate", "onsetEndDate and "Symptom"
if (FindDuplicateRepeatingFormWithinRange('itmOnsetDateStart', 'itmOnsetDateEnd', 'itmSymptom') === true) {
  return false;
} else {
  return true;
}
 
// Fires a query if more than 1 repeating form instance is found within the same symptom value within the same date range.
//
// Note: If any repeating form instance has a null start or end date then the system assumes a date in order to successfully
// perform the date range overlap check. If the start date is null then the system assumes it to be 01 Jan 0001 and if the
// end date is null then it is assumed to be 01 Dec 3099.