FindDuplicateRepeatingFormWithinRange( )
检测给定项在同一日期范围内的重复表单实例中的重复数据。数据由具有所提供搜索关键字的重复项值的表单 ID 标识。规则目标应位于相应的重复部分项上。
前两个参数应始终是日期范围。可以提供其他搜索关键字。
- 不能使用下拉列表、单选按钮或复选框值作为函数参数或目标。
- 如果变量设计为保存部分日期,则必须以相同的部分日期格式提供该参数的值。
- 如果记录没有为所需日期输入数据,则会跳过该记录进行比较。
这是一个聚集函数。如果目标位于重复表单上,则将为每个表单实例运行规则。
语法
FindDuplicateRepeatingFormWithinRange('startDateVariable', 'endDateVariable', 'variable1',...)
参数
注意:
允许在规则表达式的其他位置重复使用传递给此函数的变量,但是必须使用单引号将变量添加为参数。参数 | 必选/可选 | 说明 |
---|---|---|
startDateVariable |
必需 | 重复表单上的日期项,用作要评估的日期范围的开始日期。 |
endDateVariable |
必需 | 重复表单上的日期项,用作要评估的日期范围的结束日期。 |
variable(s) |
可选 | 要检查的项变量,使用单引号传入。 |
返回值
布尔值(true 或 false):
- True (如果发现重复的值)。
- 如果找不到重复的值,则为假。
示例
示例 3-44 检查是否存在相同开始日期范围和症状值内的任何重复表单实例
// 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.
父主题:重复表单功能